pub struct SQLite { /* private fields */ }
Expand description
SQLite structure, own a connection to the database with options.
Implementations§
Source§impl SQLite
impl SQLite
Sourcepub fn new<P: AsRef<Path>>(path: P, opts: SQLiteOpts) -> Result<Self, String>
pub fn new<P: AsRef<Path>>(path: P, opts: SQLiteOpts) -> Result<Self, String>
Create a connection to a database, the parent folder should exists.
Sourcepub fn create_tables(&self) -> Result<(), String>
pub fn create_tables(&self) -> Result<(), String>
Create all tables, indexes and configure the database.
Sourcepub fn add_file<P: AsRef<Path>>(&self, path: P) -> Result<(), String>
pub fn add_file<P: AsRef<Path>>(&self, path: P) -> Result<(), String>
Add a file to the database, the file must be a WOF GeoJSON.
Sourcepub fn add_string(&self, buf: String) -> Result<(), String>
pub fn add_string(&self, buf: String) -> Result<(), String>
Add the string content to the database, it must be a WOF GeoJSON.
Sourcepub fn add(&self, document: WOFGeoJSON<'_>) -> Result<(), String>
pub fn add(&self, document: WOFGeoJSON<'_>) -> Result<(), String>
Add a WOFGeoJSON document to the database.
The SQLiteOpts
is used here and it will define in which table the document should be added.
pub fn write_all_ids<W: Write>(&self, writer: &mut W) -> Result<(), String>
pub fn write_all_geojsons<W: Write>( &self, writer: &mut W, predicate: &Predicate, ) -> Result<(), String>
pub fn get_geojson_by_id(&self, id: i64) -> Result<Option<JsonValue>, String>
pub fn set_geojson_alt( &self, id: i32, source: &String, is_alt: i64, ) -> Result<(), String>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SQLite
impl !RefUnwindSafe for SQLite
impl Send for SQLite
impl !Sync for SQLite
impl Unpin for SQLite
impl !UnwindSafe for SQLite
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