Struct snowflake_api::SnowflakeApi
source · pub struct SnowflakeApi { /* private fields */ }
Expand description
Snowflake API, keeps connection pool and manages session for you
Implementations§
source§impl SnowflakeApi
impl SnowflakeApi
sourcepub fn with_password_auth(
account_identifier: &str,
warehouse: &str,
database: Option<&str>,
schema: Option<&str>,
username: &str,
role: Option<&str>,
password: &str
) -> Result<Self, SnowflakeApiError>
pub fn with_password_auth( account_identifier: &str, warehouse: &str, database: Option<&str>, schema: Option<&str>, username: &str, role: Option<&str>, password: &str ) -> Result<Self, SnowflakeApiError>
Initialize object with password auth. Authentication happens on the first request.
sourcepub fn with_certificate_auth(
account_identifier: &str,
warehouse: &str,
database: Option<&str>,
schema: Option<&str>,
username: &str,
role: Option<&str>,
private_key_pem: &str
) -> Result<Self, SnowflakeApiError>
pub fn with_certificate_auth( account_identifier: &str, warehouse: &str, database: Option<&str>, schema: Option<&str>, username: &str, role: Option<&str>, private_key_pem: &str ) -> Result<Self, SnowflakeApiError>
Initialize object with private certificate auth. Authentication happens on the first request.
sourcepub async fn close_session(&mut self) -> Result<(), SnowflakeApiError>
pub async fn close_session(&mut self) -> Result<(), SnowflakeApiError>
Closes the current session, this is necessary to clean up temporary objects (tables, functions, etc) which are Snowflake session dependent. If another request is made the new session will be initiated.
sourcepub async fn exec(&self, sql: &str) -> Result<QueryResult, SnowflakeApiError>
pub async fn exec(&self, sql: &str) -> Result<QueryResult, SnowflakeApiError>
Execute a single query against API. If statement is PUT, then file will be uploaded to the Snowflake-managed storage
sourcepub async fn exec_response(
&mut self,
sql: &str
) -> Result<ExecResponse, SnowflakeApiError>
pub async fn exec_response( &mut self, sql: &str ) -> Result<ExecResponse, SnowflakeApiError>
Useful for debugging to get the straight query response
Auto Trait Implementations§
impl !RefUnwindSafe for SnowflakeApi
impl Send for SnowflakeApi
impl Sync for SnowflakeApi
impl Unpin for SnowflakeApi
impl !UnwindSafe for SnowflakeApi
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
Mutably borrows from an owned value. Read more