diff --git a/rust/core/src/lib.rs b/rust/core/src/lib.rs index c8df8a9c18..80485c9c26 100644 --- a/rust/core/src/lib.rs +++ b/rust/core/src/lib.rs @@ -43,15 +43,12 @@ pub mod constants; pub mod error; pub mod options; pub mod schemas; +pub mod sync; -use std::collections::HashSet; +pub use sync::*; -use arrow_array::{RecordBatch, RecordBatchReader}; use arrow_schema::Schema; -use error::Result; -use options::{OptionConnection, OptionDatabase, OptionStatement, OptionValue}; - pub type LoadFlags = u32; pub const LOAD_FLAG_SEARCH_ENV: LoadFlags = 1 << 1; @@ -63,448 +60,6 @@ pub const LOAD_FLAG_DEFAULT: LoadFlags = LOAD_FLAG_SEARCH_ENV | LOAD_FLAG_SEARCH_SYSTEM | LOAD_FLAG_ALLOW_RELATIVE_PATHS; -/// Ability to configure an object by setting/getting options. -pub trait Optionable { - type Option: AsRef; - - /// Set a post-init option. - fn set_option(&mut self, key: Self::Option, value: OptionValue) -> Result<()>; - - /// Get a string option value by key. - fn get_option_string(&self, key: Self::Option) -> Result; - - /// Get a bytes option value by key. - fn get_option_bytes(&self, key: Self::Option) -> Result>; - - /// Get an integer option value by key. - fn get_option_int(&self, key: Self::Option) -> Result; - - /// Get a float option value by key. - fn get_option_double(&self, key: Self::Option) -> Result; -} - -/// A handle to an ADBC driver. -pub trait Driver { - type DatabaseType: Database; - - /// Allocate and initialize a new database without pre-init options. - fn new_database(&mut self) -> Result; - - /// Allocate and initialize a new database with pre-init options. - fn new_database_with_opts( - &mut self, - opts: impl IntoIterator, - ) -> Result; -} - -/// 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. -pub trait Database: Optionable