pub struct ClientBuilder { /* private fields */ }
Expand description
A ClientBuilder
can be used to create a Client
with custom
configuration.
For more information on creating a duckdb connection, see the duckdb docs.
§Examples
let client = ClientBuilder::new().path("path/to/db.duckdb").open().await?;
// ...
client.close().await?;
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns a new ClientBuilder
with the default settings.
Sourcepub fn path<P: AsRef<Path>>(self, path: P) -> Self
pub fn path<P: AsRef<Path>>(self, path: P) -> Self
Specify the path of the duckdb database to open.
By default, an in-memory database is used.
Sourcepub fn flagsfn(self, flags: fn() -> Result<Config>) -> Self
pub fn flagsfn(self, flags: fn() -> Result<Config>) -> Self
Specify the [OpenFlags
] to use when opening a new connection.
By default, [OpenFlags::default()
] is used.
Trait Implementations§
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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