pub struct SpannerConnection {
pub project_id: String,
pub instance: String,
pub database: String,
pub auth: SpannerCredentials,
pub max_sessions: usize,
pub emulator_host: Option<String>,
}Expand description
Connection block shared by the Spanner source and sink configs (flattened
into each connector config via #[serde(flatten)]).
Fields§
§project_id: StringGCP project ID that owns the Spanner instance.
instance: StringSpanner instance ID.
database: StringDatabase name within the instance.
auth: SpannerCredentialsCredentials. Defaults to Application Default Credentials.
max_sessions: usizeUpper bound on pooled Spanner sessions (server-side resources). Channels are sized automatically at one per 100 sessions.
emulator_host: Option<String>Emulator endpoint override (host:port, e.g. localhost:9010).
When set, the connection is plaintext and unauthenticated — exactly
what SPANNER_EMULATOR_HOST does, but scoped to this connector so
parallel pipelines/tests don’t race on a process-global env var.
The env var is still honored when this field is unset.
Implementations§
Source§impl SpannerConnection
impl SpannerConnection
Sourcepub fn database_path(&self) -> String
pub fn database_path(&self) -> String
Fully-qualified database path:
projects/{project}/instances/{instance}/databases/{database}.
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate the connection block at config-load time.
Sourcepub async fn connect(&self) -> Result<Client, FaucetError>
pub async fn connect(&self) -> Result<Client, FaucetError>
Build the data-plane Client. Honors emulator_host (and, when
unset, the SPANNER_EMULATOR_HOST env var via the client default).
Sourcepub async fn connect_admin(&self) -> Result<AdminClient, FaucetError>
pub async fn connect_admin(&self) -> Result<AdminClient, FaucetError>
Build the admin (DDL) client. Same credential and emulator handling
as connect.
Trait Implementations§
Source§impl Clone for SpannerConnection
impl Clone for SpannerConnection
Source§fn clone(&self) -> SpannerConnection
fn clone(&self) -> SpannerConnection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpannerConnection
impl Debug for SpannerConnection
Source§impl<'de> Deserialize<'de> for SpannerConnection
impl<'de> Deserialize<'de> for SpannerConnection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SpannerConnection
impl JsonSchema for SpannerConnection
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for SpannerConnection
impl RefUnwindSafe for SpannerConnection
impl Send for SpannerConnection
impl Sync for SpannerConnection
impl Unpin for SpannerConnection
impl UnsafeUnpin for SpannerConnection
impl UnwindSafe for SpannerConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request