pub struct SqliteRuntime { /* private fields */ }Expand description
vldb-sqlite 纯库多库运行时。
Pure library multi-database runtime for vldb-sqlite.
Implementations§
Source§impl SqliteRuntime
impl SqliteRuntime
Sourcepub fn new() -> Self
pub fn new() -> Self
使用默认参数创建一个新的多库 runtime。 Create a new multi-database runtime with default options.
Sourcepub fn with_default_options(default_options: SqliteOpenOptions) -> Self
pub fn with_default_options(default_options: SqliteOpenOptions) -> Self
使用给定默认参数创建多库 runtime。 Create a multi-database runtime with caller-provided default options.
Sourcepub fn default_options(&self) -> &SqliteOpenOptions
pub fn default_options(&self) -> &SqliteOpenOptions
获取默认打开选项。 Get the default open options.
Sourcepub fn open_database(
&self,
db_path: impl AsRef<str>,
) -> Result<Arc<SqliteDatabaseHandle>, BoxError>
pub fn open_database( &self, db_path: impl AsRef<str>, ) -> Result<Arc<SqliteDatabaseHandle>, BoxError>
打开或复用指定路径的数据库句柄。 Open or reuse a database handle for the specified path.
Sourcepub fn open_database_with_options(
&self,
db_path: impl AsRef<str>,
options: SqliteOpenOptions,
) -> Result<Arc<SqliteDatabaseHandle>, BoxError>
pub fn open_database_with_options( &self, db_path: impl AsRef<str>, options: SqliteOpenOptions, ) -> Result<Arc<SqliteDatabaseHandle>, BoxError>
使用显式选项打开或复用指定路径的数据库句柄。 Open or reuse a database handle for the specified path with explicit options.
Sourcepub fn get_database(
&self,
db_path: impl AsRef<str>,
) -> Option<Arc<SqliteDatabaseHandle>>
pub fn get_database( &self, db_path: impl AsRef<str>, ) -> Option<Arc<SqliteDatabaseHandle>>
获取已缓存的数据库句柄。 Get an already-cached database handle.
Sourcepub fn close_database(&self, db_path: impl AsRef<str>) -> bool
pub fn close_database(&self, db_path: impl AsRef<str>) -> bool
关闭并移除指定数据库句柄。 Close and remove a database handle.
Sourcepub fn list_databases(&self) -> Vec<String>
pub fn list_databases(&self) -> Vec<String>
列出当前 runtime 中已注册的数据库路径。 List database paths currently registered in the runtime.
Sourcepub fn database_count(&self) -> usize
pub fn database_count(&self) -> usize
返回当前 runtime 中已注册的数据库数量。 Return the number of databases currently registered in the runtime.
Trait Implementations§
Source§impl Debug for SqliteRuntime
impl Debug for SqliteRuntime
Auto Trait Implementations§
impl !Freeze for SqliteRuntime
impl RefUnwindSafe for SqliteRuntime
impl Send for SqliteRuntime
impl Sync for SqliteRuntime
impl Unpin for SqliteRuntime
impl UnsafeUnpin for SqliteRuntime
impl UnwindSafe for SqliteRuntime
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request