pub trait Database: Optionable<Option = OptionDatabase> {
type ConnectionType: Connection;
// Required methods
fn new_connection(&mut self) -> Result<Self::ConnectionType>;
fn new_connection_with_opts(
&mut self,
opts: impl IntoIterator<Item = (OptionConnection, OptionValue)>,
) -> Result<Self::ConnectionType>;
}Expand description
A handle to an ADBC database.
Databases hold state shared by multiple connections. This typically means configuration and caches. For in-memory databases, it provides a place to hold ownership of the in-memory database.
Databases must be kept alive as long as any connections exist.
Required Associated Types§
Required Methods§
Sourcefn new_connection(&mut self) -> Result<Self::ConnectionType>
fn new_connection(&mut self) -> Result<Self::ConnectionType>
Allocate and initialize a new connection without pre-init options.
Sourcefn new_connection_with_opts(
&mut self,
opts: impl IntoIterator<Item = (OptionConnection, OptionValue)>,
) -> Result<Self::ConnectionType>
fn new_connection_with_opts( &mut self, opts: impl IntoIterator<Item = (OptionConnection, OptionValue)>, ) -> Result<Self::ConnectionType>
Allocate and initialize a new connection with pre-init options.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.