pub struct PgExecutor { /* private fields */ }Expand description
The PostgreSQL executor as a fireweed_dsl::Executor. Each call takes
an idle connection, or opens one, and gives it back when the call
finishes. A call that is dropped part way drops its connection instead,
so no connection with an open transaction is reused. Connections are
opened on demand; at most max_idle are kept between calls.
Implementations§
Source§impl PgExecutor
impl PgExecutor
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Connects without TLS using config, spawning each connection’s task
on the current Tokio runtime.
Sourcepub fn with_connector<F, Fut>(connect: F) -> Self
pub fn with_connector<F, Fut>(connect: F) -> Self
Opens connections with connect, for TLS or other settings. It must
also drive (spawn) each connection’s task.
Trait Implementations§
Source§impl Executor for PgExecutor
impl Executor for PgExecutor
Source§fn apply_schema<'a>(
&'a self,
tenant: &'a str,
space: &'a str,
schema: &'a Schema,
expected: Option<i64>,
) -> BoxFuture<'a, Result<Applied>>
fn apply_schema<'a>( &'a self, tenant: &'a str, space: &'a str, schema: &'a Schema, expected: Option<i64>, ) -> BoxFuture<'a, Result<Applied>>
Creates a space, or changes its schema.
expected is the version
the caller expects to replace: None for a new space.Source§fn get_schema<'a>(
&'a self,
tenant: &'a str,
space: &'a str,
) -> BoxFuture<'a, Result<Option<Schema>>>
fn get_schema<'a>( &'a self, tenant: &'a str, space: &'a str, ) -> BoxFuture<'a, Result<Option<Schema>>>
The stored schema of a space, if it exists.
Source§fn execute<'a>(
&'a self,
tenant: &'a str,
space: &'a str,
program: &'a Program,
) -> BoxFuture<'a, Result<Response>>
fn execute<'a>( &'a self, tenant: &'a str, space: &'a str, program: &'a Program, ) -> BoxFuture<'a, Result<Response>>
Runs a program as one transaction.
Auto Trait Implementations§
impl !Freeze for PgExecutor
impl !RefUnwindSafe for PgExecutor
impl !UnwindSafe for PgExecutor
impl Forget for PgExecutor
impl Move for PgExecutor
impl Send for PgExecutor
impl Sync for PgExecutor
impl Unpin for PgExecutor
impl UnsafeUnpin for PgExecutorwhere
*const dyn Fn() -> Pin<Box<dyn Future<Output = Result<Client, Error>> + Send>> + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Fn() -> Pin<Box<dyn Future<Output = Result<Client, Error>> + Send>> + Sync + Send>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Client>: UnsafeUnpin,
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