Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Sqlite backend #240

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ serde_derive = "1.0"
thiserror = "1.0"
url = "2.0"
uuid = "1.0"
elsa = "1.10.0"
crossbeam-channel = "0.5.12"

[dependencies.rusqlite]
version = "0.26.1"
features = ["bundled"]

[dev-dependencies]
byteorder = "1"
Expand Down
12 changes: 12 additions & 0 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod common;
#[cfg(feature = "lmdb")]
mod impl_lmdb;
mod impl_safe;
mod impl_sqlite;
mod traits;

pub use common::*;
Expand All @@ -38,3 +39,14 @@ pub use impl_safe::{
RwTransactionImpl as SafeModeRwTransaction, StatImpl as SafeModeStat,
WriteFlagsImpl as SafeModeWriteFlags,
};

pub use impl_sqlite::{
DatabaseFlagsImpl as SqliteDatabaseFlags, DatabaseImpl as SqliteDatabase,
EnvironmentBuilderImpl as Sqlite, EnvironmentFlagsImpl as SqliteEnvironmentFlags,
EnvironmentImpl as SqliteEnvironment, ErrorImpl as SqliteError, InfoImpl as SqliteInfo,
IterImpl as SqliteIter, RoCursorImpl as SqliteRoCursor,
RoTransactionImpl as SqliteRoTransaction, RwCursorImpl as SqliteRwCursor,
RwTransactionImpl as SqliteRwTransaction, StatImpl as SqliteStat,
WriteFlagsImpl as SqliteWriteFlags,
};

31 changes: 31 additions & 0 deletions src/backend/impl_sqlite.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2018-2019 Mozilla
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.


mod cursor;
mod database;
mod environment;
mod error;
mod flags;
mod info;
mod iter;
mod stat;
mod transaction;


pub use cursor::{RoCursorImpl, RwCursorImpl};
pub use database::DatabaseImpl;
pub use environment::{EnvironmentBuilderImpl, EnvironmentImpl};
pub use error::ErrorImpl;
pub use flags::{DatabaseFlagsImpl, EnvironmentFlagsImpl, WriteFlagsImpl};
pub use info::InfoImpl;
pub use iter::IterImpl;
pub use stat::StatImpl;
pub use transaction::{RoTransactionImpl, RwTransactionImpl};
Loading
Loading