pub struct SnowflakeEngine { /* private fields */ }Expand description
The account-agnostic Snowflake query engine: lazy multiplexed auth, bounded per-identity session pools, and concurrent arbitrary-SQL execution.
Implementations§
Source§impl SnowflakeEngine
impl SnowflakeEngine
Sourcepub fn new(config: SnowflakeEngineConfig) -> Self
pub fn new(config: SnowflakeEngineConfig) -> Self
Builds an engine. Cheap — no eager auth or I/O.
Sourcepub fn sessions(&self) -> Vec<SessionInfo>
pub fn sessions(&self) -> Vec<SessionInfo>
A snapshot of every active pool.
Sourcepub fn pool_count(&self) -> usize
pub fn pool_count(&self) -> usize
The number of active pools ((account, user) identities).
Sourcepub fn disconnect(&self, account: &str, user: &str) -> bool
pub fn disconnect(&self, account: &str, user: &str) -> bool
Evicts the pool for (account, user). Returns whether one existed.
Sourcepub fn disconnect_by_id(&self, id: u64) -> bool
pub fn disconnect_by_id(&self, id: u64) -> bool
Evicts the pool with the given id. Returns whether one existed.
Sourcepub fn disconnect_all(&self) -> usize
pub fn disconnect_all(&self) -> usize
Evicts every pool. Returns how many were removed.
Sourcepub async fn query(&self, req: QueryRequest) -> Result<Value>
pub async fn query(&self, req: QueryRequest) -> Result<Value>
Runs arbitrary SQL against the (account, user) pool, authenticating a
session on first use, and returns a self-describing { columns, rows }
payload. Concurrent calls run on separate pooled sessions (up to the pool
size).
§Errors
Returns an error if no account/user can be resolved, a context flag is not a valid identifier, authentication fails, or the query fails. On a session-expiry error that session is discarded and the next query re-authenticates.