pub struct MssqlSource { /* private fields */ }Expand description
SQL Server source. Owns the async driver + the runtime that drives it.
pub (not pub(crate)) so integration tests can reach proxy_kind() the
same way they reach MysqlSource::proxy_kind(); the rest of the type
carries the same “no external API contract” disclaimer as MysqlSource.
Implementations§
Source§impl MssqlSource
impl MssqlSource
Sourcepub fn connect_with_tls(url: &str, tls: Option<&TlsConfig>) -> Result<Self>
pub fn connect_with_tls(url: &str, tls: Option<&TlsConfig>) -> Result<Self>
Connect to SQL Server, honouring the shared TlsConfig. url is the
resolved sqlserver://user:pass@host:port/db form. A successful return
has completed a TLS login handshake and a SELECT 1 round-trip.
Sourcepub fn proxy_kind(&self) -> MssqlProxyKind
pub fn proxy_kind(&self) -> MssqlProxyKind
Expose the proxy classification for diagnostics (preflight, integration
tests). Not part of the Source trait — same internal-may-change
contract as the rest of rivet::source::mssql::*.
Trait Implementations§
Source§impl Drop for MssqlSource
impl Drop for MssqlSource
Source§fn drop(&mut self)
fn drop(&mut self)
Pooler-safe session teardown (Epic 18 B2). rivet never opens a
transaction on this connection — every read is an autocommit SELECT,
so there is no transaction to leave dangling across the block_on
bridge (ADR-0011). The only session state the export mutates is
SET LOCK_TIMEOUT; reset it to the SQL Server default (-1, wait
indefinitely) before the connection closes so a multiplexed pooler
that keeps the backend connection alive cannot hand our non-default
LOCK_TIMEOUT to the next session that reuses it.
Best-effort and time-boxed: after a failed read the stream is
half-drained and the connection is dying anyway, so the reset (and the
physical connection) just goes away; the 2 s cap guarantees Drop
can never hang on a wedged connection.
Source§impl Source for MssqlSource
impl Source for MssqlSource
Source§fn export(
&mut self,
request: &ExportRequest<'_>,
sink: &mut dyn BatchSink,
) -> Result<()>
fn export( &mut self, request: &ExportRequest<'_>, sink: &mut dyn BatchSink, ) -> Result<()>
request.query and stream batches into sink.