Rusqlite is an ergonomic wrapper for using SQLite from Rust

Overview

Rusqlite

Latest Version Documentation Build Status (GitHub) Build Status (AppVeyor) Code Coverage Dependency Status Discord Chat

Rusqlite is an ergonomic wrapper for using SQLite from Rust. It attempts to expose an interface similar to rust-postgres.

use rusqlite::{params, Connection, Result};

#[derive(Debug)]
struct Person {
    id: i32,
    name: String,
    data: Option<Vec<u8>>,
}

fn main() -> Result<()> {
    let conn = Connection::open_in_memory()?;

    conn.execute(
        "CREATE TABLE person (
                  id              INTEGER PRIMARY KEY,
                  name            TEXT NOT NULL,
                  data            BLOB
                  )",
        [],
    )?;
    let me = Person {
        id: 0,
        name: "Steven".to_string(),
        data: None,
    };
    conn.execute(
        "INSERT INTO person (name, data) VALUES (?1, ?2)",
        params![me.name, me.data],
    )?;

    let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
    let person_iter = stmt.query_map([], |row| {
        Ok(Person {
            id: row.get(0)?,
            name: row.get(1)?,
            data: row.get(2)?,
        })
    })?;

    for person in person_iter {
        println!("Found person {:?}", person.unwrap());
    }
    Ok(())
}

Supported SQLite Versions

The base rusqlite package supports SQLite version 3.6.8 or newer. If you need support for older versions, please file an issue. Some cargo features require a newer SQLite version; see details below.

Optional Features

Rusqlite provides several features that are behind Cargo features. They are:

  • load_extension allows loading dynamic library-based SQLite extensions.
  • backup allows use of SQLite's online backup API. Note: This feature requires SQLite 3.6.11 or later.
  • functions allows you to load Rust closures into SQLite connections for use in queries. Note: This feature requires SQLite 3.7.3 or later.
  • window for window function support (fun(...) OVER ...). (Implies functions.)
  • trace allows hooks into SQLite's tracing and profiling APIs. Note: This feature requires SQLite 3.6.23 or later.
  • blob gives std::io::{Read, Write, Seek} access to SQL BLOBs. Note: This feature requires SQLite 3.7.4 or later.
  • limits allows you to set and retrieve SQLite's per connection limits.
  • chrono implements FromSql and ToSql for various types from the chrono crate.
  • serde_json implements FromSql and ToSql for the Value type from the serde_json crate.
  • time implements FromSql and ToSql for the time::OffsetDateTime type from the time crate.
  • url implements FromSql and ToSql for the Url type from the url crate.
  • bundled uses a bundled version of SQLite. This is a good option for cases where linking to SQLite is complicated, such as Windows.
  • sqlcipher looks for the SQLCipher library to link against instead of SQLite. This feature overrides bundled.
  • bundled-sqlcipher uses a bundled version of SQLCipher. This searches for and links against a system-installed crypto library to provide the crypto implementation.
  • bundled-sqlcipher-vendored-openssl allows using bundled-sqlcipher with a vendored version of OpenSSL (via the openssl-sys crate) as the crypto provider.
    • As the name implies this depends on the bundled-sqlcipher feature, and automatically turns it on.
    • If turned on, this uses the openssl-sys crate, with the vendored feature enabled in order to build and bundle the OpenSSL crypto library.
  • hooks for Commit, Rollback and Data Change notification callbacks.
  • unlock_notify for Unlock notification.
  • vtab for virtual table support (allows you to write virtual table implementations in Rust). Currently, only read-only virtual tables are supported.
  • series exposes generate_series(...) Table-Valued Function. (Implies vtab.)
  • csvtab, CSV virtual table written in Rust. (Implies vtab.)
  • array, The rarray() Table-Valued Function. (Implies vtab.)
  • i128_blob allows storing values of type i128 type in SQLite databases. Internally, the data is stored as a 16 byte big-endian blob, with the most significant bit flipped, which allows ordering and comparison between different blobs storing i128s to work as expected.
  • uuid allows storing and retrieving Uuid values from the uuid crate using blobs.
  • session, Session module extension. Requires buildtime_bindgen feature. (Implies hooks.)
  • extra_check fail when a query passed to execute is readonly or has a column count > 0.
  • column_decltype provides columns() method for Statements and Rows; omit if linking to a version of SQLite/SQLCipher compiled with -DSQLITE_OMIT_DECLTYPE.
  • collation exposes sqlite3_create_collation_v2.

Notes on building rusqlite and libsqlite3-sys

libsqlite3-sys is a separate crate from rusqlite that provides the Rust declarations for SQLite's C API. By default, libsqlite3-sys attempts to find a SQLite library that already exists on your system using pkg-config, or a Vcpkg installation for MSVC ABI builds.

You can adjust this behavior in a number of ways:

  • If you use the bundled, bundled-sqlcipher, or bundled-sqlcipher-vendored-openssl features, libsqlite3-sys will use the cc crate to compile SQLite or SQLCipher from source and link against that. This source is embedded in the libsqlite3-sys crate and is currently SQLite 3.37.0 (as of rusqlite 0.26.0 / libsqlite3-sys 0.23.0). This is probably the simplest solution to any build problems. You can enable this by adding the following in your Cargo.toml file:

    [dependencies.rusqlite]
    version = "0.26.0"
    features = ["bundled"]
  • When using any of the bundled features, the build script will honor SQLITE_MAX_VARIABLE_NUMBER and SQLITE_MAX_EXPR_DEPTH variables. It will also honor a LIBSQLITE_FLAGS variable, which can have a format like "-USQLITE_ALPHA -DSQLITE_BETA SQLITE_GAMMA ...". That would disable the SQLITE_ALPHA flag, and set the SQLITE_BETA and SQLITE_GAMMA flags. (The initial -D can be omitted, as on the last one.)

  • When using bundled-sqlcipher (and not also using bundled-sqlcipher-vendored-openssl), libsqlite3-sys will need to link against crypto libraries on the system. If the build script can find a libcrypto from OpenSSL or LibreSSL (it will consult OPENSSL_LIB_DIR/OPENSSL_INCLUDE_DIR and OPENSSL_DIR environment variables), it will use that. If building on and for Macs, and none of those variables are set, it will use the system's SecurityFramework instead.

  • When linking against a SQLite (or SQLCipher) library already on the system (so not using any of the bundled features), you can set the SQLITE3_LIB_DIR (or SQLCIPHER_LIB_DIR) environment variable to point to a directory containing the library. You can also set the SQLITE3_INCLUDE_DIR (or SQLCIPHER_INCLUDE_DIR) variable to point to the directory containing sqlite3.h.

  • Installing the sqlite3 development packages will usually be all that is required, but the build helpers for pkg-config and vcpkg have some additional configuration options. The default when using vcpkg is to dynamically link, which must be enabled by setting VCPKGRS_DYNAMIC=1 environment variable before build. vcpkg install sqlite3:x64-windows will install the required library.

  • When linking against a SQLite (or SQLCipher) library already on the system, you can set the SQLITE3_STATIC (or SQLCIPHER_STATIC) environment variable to 1 to request that the library be statically instead of dynamically linked.

Binding generation

We use bindgen to generate the Rust declarations from SQLite's C header file. bindgen recommends running this as part of the build process of libraries that used this. We tried this briefly (rusqlite 0.10.0, specifically), but it had some annoyances:

  • The build time for libsqlite3-sys (and therefore rusqlite) increased dramatically.
  • Running bindgen requires a relatively-recent version of Clang, which many systems do not have installed by default.
  • Running bindgen also requires the SQLite header file to be present.

As of rusqlite 0.10.1, we avoid running bindgen at build-time by shipping pregenerated bindings for several versions of SQLite. When compiling rusqlite, we use your selected Cargo features to pick the bindings for the minimum SQLite version that supports your chosen features. If you are using libsqlite3-sys directly, you can use the same features to choose which pregenerated bindings are chosen:

  • min_sqlite_version_3_6_8 - SQLite 3.6.8 bindings (this is the default)
  • min_sqlite_version_3_6_23 - SQLite 3.6.23 bindings
  • min_sqlite_version_3_7_7 - SQLite 3.7.7 bindings

If you use any of the bundled features, you will get pregenerated bindings for the bundled version of SQLite/SQLCipher. If you need other specific pregenerated binding versions, please file an issue. If you want to run bindgen at buildtime to produce your own bindings, use the buildtime_bindgen Cargo feature.

If you enable the modern_sqlite feature, we'll use the bindings we would have included with the bundled build. You generally should have buildtime_bindgen enabled if you turn this on, as otherwise you'll need to keep the version of SQLite you link with in sync with what rusqlite would have bundled, (usually the most recent release of SQLite). Failing to do this will cause a runtime error.

Contributing

Rusqlite has many features, and many of them impact the build configuration in incompatible ways. This is unfortunate, and makes testing changes hard.

To help here: you generally should ensure that you run tests/lint for --features bundled, and --features "bundled-full session buildtime_bindgen".

If running bindgen is problematic for you, --features bundled-full enables bundled and all features which don't require binding generation, and can be used instead.

Checklist

  • Run cargo fmt to ensure your Rust code is correctly formatted.
  • Ensure cargo clippy --workspace --features bundled passes without warnings.
  • Ensure cargo clippy --workspace --features "bundled-full session buildtime_bindgen" passes without warnings.
  • Ensure cargo test --workspace --features bundled reports no failures.
  • Ensure cargo test --workspace --features "bundled-full session buildtime_bindgen" reports no failures.

Author

Rusqlite is the product of hard work by a number of people. A list is available here: https://github.com/rusqlite/rusqlite/graphs/contributors

Community

Feel free to join the Rusqlite Discord Server to discuss or get help with rusqlite or libsqlite3-sys.

License

Rusqlite and libsqlite3-sys are available under the MIT license. See the LICENSE file for more info.

Licenses of Bundled Software

Depending on the set of enabled cargo features, rusqlite and libsqlite3-sys will also bundle other libraries, which have their own licensing terms:

  • If --features=bundled-sqlcipher is enabled, the vendored source of SQLcipher will be compiled and statically linked in. SQLcipher is distributed under a BSD-style license, as described here.

  • If --features=bundled is enabled, the vendored source of SQLite will be compiled and linked in. SQLite is in the public domain, as described here.

Both of these are quite permissive, have no bearing on the license of the code in rusqlite or libsqlite3-sys themselves, and can be entirely ignored if you do not use the feature in question.

Comments
  • Error building libsqlite3-sys v0.25.2 in WSL2 on NTFS drive

    Error building libsqlite3-sys v0.25.2 in WSL2 on NTFS drive

    Trying to add SQLite support to a Rust application. So far went through several crates but they all depend on libsqlite3-sys, therefore all have the same issue.

    Building (crate build) the application fails with

       Compiling libsqlite3-sys v0.25.2
    error: failed to run custom build command for `libsqlite3-sys v0.25.2`
    
    Caused by:
      process didn't exit successfully: `/mnt/d/src/pricedb-rust/target/debug/build/libsqlite3-sys-85871a1a1dec6be7/build-script-build` (exit status: 101)
      --- stderr
      thread 'main' panicked at 'Could not copy bindings to output directory: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', /home/alen/.cargo/registry/src/github.com-1ecc6299db9ec823/libsqlite3-sys-0.25.2/build.rs:102:18
      stack backtrace:
         0:     0x55f4870ad300 - std::backtrace_rs::backtrace::libunwind::trace::h32eb3e08e874dd27
                                     at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
    

    etc.

    I've tried both in Alpine and Debian distributions running under Windows Subsystem for Linux (WSL2). The build directory is on an NTFS volume, mounted in WSL. This does not seem to affect normal development otherwise. The error puzzles me.

    rusqlite is added to Crate.toml as

    rusqlite = { version = "0.28.0", features = ["bundled"] }
    

    Let me know, please, if I can provide any additional useful information.

    opened by alensiljak 21
  • Omit unnecessary code from bundled SQLite build

    Omit unnecessary code from bundled SQLite build

    Following the explanations from SQLite's recommended compile-time options, this adds a Cargo feature to libsqlite-sys so that the bundled SQLite can be better tailored to the specific needs of rusqlite. The feature is enabled by default and rusqlite does explicitly not request it, so that if any other crate pulls libsqlite-sys into the dependency, no features are removed.

    As a first step, this commit

    • adds SQLITE_OMIT_PROGRESS_CALLBACK as rusqlite does not use sqlite3_progress_handler
    • and sets SQLITE_DEFAULT_MEMSTATUS to 0 as rusqlite does not use sqlite3_status.
    invalid 
    opened by adamreichold 21
  • Bundled sqlcipher?

    Bundled sqlcipher?

    I've been experimenting with a fork of this repository where I enable building a bundled version of sqlcipher, optionally also bundling in an openssl/libressl libcrypto. Would you be interested in, or in principle open to a PR with this functionality?

    Some related issues: #219, #558.

    opened by dubiousjim 18
  • Transactions don't work with async/await

    Transactions don't work with async/await

    I'm migrating a pretty big codebase to use async/await and ran into problem with making rusqlite work. I understand why Connection is not Sync and normally i would use a Mutex to hold a connection in a multi threaded environment, but in this case i'm holding a reference to a Connection and &T: Send is not Send.

    playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c25f81c48a319e5fbaf88b79ac1989eb

    use rusqlite;
    use tokio; // 0.2.13
    
    fn main() {
        let rt = tokio::runtime::Runtime::new().unwrap();
    
        let handle = rt.spawn(async {
            let conn = rusqlite::Connection::open_in_memory().unwrap();
            let tx = conn.transaction().unwrap();
            async {
                // do something async
            }
            .await;
            tx.execute_batch("SELECT 1").unwrap();
            tx.commit();
        });
    
        rt.block_on(handle).unwrap();
    }
    
    opened by aaronabramov 18
  • Add support for dot commands like `.mode` and `.import`

    Add support for dot commands like `.mode` and `.import`

    Currently executing with either commands leads to a panic syntax error. It would be useful to have these, as an example, for importing CSV files with .mode csv and .import <file> <table> which makes loading the database file a lot faster than doing an INSERT transaction for each row of information. I have to use a helper bash script in my project in order for my app to loader faster when starting up for the first time because of generating a new database file. It would be nice to do this in Rust instead.

    enhancement 
    opened by ghost 18
  • Added feature

    Added feature "bundled" to provide a fully self-contained cross-platform build.

    Howdy!

    In reference to #46 and #89 I'm submitting this PR which adds a feature "bundled" that will build and link with a static libsqlite3 from the included amalgamation.

    If you don't want the amalgamation bundled then I'm happy to toss that and come up with another solution too.

    opened by photex 17
  • Compile error in Rust 1.36.0

    Compile error in Rust 1.36.0

    rusqlite fails to compile on Rust 1.36.0:

       Compiling rusqlite v0.19.0
    error[E0277]: `*const libsqlite3_sys::sqlite3_module` cannot be sent between threads safely
      --> /home/tehdog/.cargo/registry/src/github.com-1ecc6299db9ec823/rusqlite-0.19.0/src/vtab/series.rs:21:1
       |
    21 | / lazy_static! {
    22 | |     static ref SERIES_MODULE: Module<SeriesTab> = eponymous_only_module::<SeriesTab>(1);
    23 | | }
       | |_^ `*const libsqlite3_sys::sqlite3_module` cannot be sent between threads safely
       |
       = help: within `vtab::Module<vtab::series::SeriesTab>`, the trait `std::marker::Send` is not implemented for `*const libsqlite3_sys::sqlite3_module`
       = note: required because it appears within the type `libsqlite3_sys::sqlite3_vtab`
       = note: required because it appears within the type `vtab::series::SeriesTab`
       = note: required because it appears within the type `std::marker::PhantomData<vtab::series::SeriesTab>`
       = note: required because it appears within the type `vtab::Module<vtab::series::SeriesTab>`
       = note: required because of the requirements on the impl of `std::marker::Sync` for `spin::once::Once<vtab::Module<vtab::series::SeriesTab>>`
       = note: required because it appears within the type `lazy_static::lazy::Lazy<vtab::Module<vtab::series::SeriesTab>>`
       = note: shared static variables must have a type that implements `Sync`
       = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
    
    error[E0277]: `*mut i8` cannot be sent between threads safely
      --> /home/tehdog/.cargo/registry/src/github.com-1ecc6299db9ec823/rusqlite-0.19.0/src/vtab/series.rs:21:1
       |
    21 | / lazy_static! {
    22 | |     static ref SERIES_MODULE: Module<SeriesTab> = eponymous_only_module::<SeriesTab>(1);
    23 | | }
       | |_^ `*mut i8` cannot be sent between threads safely
       |
       = help: within `vtab::Module<vtab::series::SeriesTab>`, the trait `std::marker::Send` is not implemented for `*mut i8`
       = note: required because it appears within the type `libsqlite3_sys::sqlite3_vtab`
       = note: required because it appears within the type `vtab::series::SeriesTab`
       = note: required because it appears within the type `std::marker::PhantomData<vtab::series::SeriesTab>`
       = note: required because it appears within the type `vtab::Module<vtab::series::SeriesTab>`
       = note: required because of the requirements on the impl of `std::marker::Sync` for `spin::once::Once<vtab::Module<vtab::series::SeriesTab>>`
       = note: required because it appears within the type `lazy_static::lazy::Lazy<vtab::Module<vtab::series::SeriesTab>>`
       = note: shared static variables must have a type that implements `Sync`
       = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
    
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0277`.
    error: Could not compile `rusqlite`.
    
    To learn more, run the command again with --verbose.
    

    Seems to happen for both 0.19.0 and 0.18.0 Via this error report: https://github.com/phiresky/ripgrep-all/issues/22

    bug 
    opened by phiresky 15
  • Support for Number (Integer/Float) and Null in serde_json

    Support for Number (Integer/Float) and Null in serde_json

    I was trying to serialize query result into a serde_json Value inside query_map but I got an InvalidColumn error, which was a bit confusing because README.md claims that serde_json is supported (via cargo optional feature).

    After Looking around I found that the serde_json.rs has FromSQL implementation only for Text and Blob types, and thus the error.

    Is this by design or a mistake?

    if a bug then I'd love to try and extend support for other serde_json types.

    I am trying to implement a function in my application that would execute arbitrary SQLs and return a json_serve::Map vector using the column name as the key and the json_serve::Value as the Value (Without the need of having defined structs).

    opened by dramikei 14
  • Certain requests with empty strings produce

    Certain requests with empty strings produce "Illegal Instruction" errors in release mode

    The following program will produce a "Illegal Instruction" when run with cargo run --release under Linux (x64) (bug does not trigger in debug mode):

    extern crate rusqlite;
    
    fn main() {
        let conn = rusqlite::Connection::open_in_memory().unwrap();
        conn.execute("CREATE TABLE my_table (name TEXT)", &[]).unwrap();
    
        let query = "INSERT INTO my_table (name) VALUES ($1)";
        conn.execute(query, &[&"".to_string()]).unwrap();
    }
    

    Output:

    $ cargo run --release
       Compiling undef v0.1.0 (/home/user/undef)
        Finished release [optimized] target(s) in 0.54s
         Running `target/release/undef`
    Illegal instruction (core dumped)
    

    GDB backtrace:

    (gdb) run
    Starting program: /home/user/undef/target/release/undef 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    
    Program received signal SIGILL, Illegal instruction.
    0x00005555555601a0 in libsqlite3_sys::SQLITE_STATIC ()
    (gdb) bt
    #0  0x00005555555601a0 in libsqlite3_sys::SQLITE_STATIC ()
    #1  0x000055555555f25b in rusqlite::statement::Statement::bind_parameter ()
    #2  0x000055555555eeb6 in rusqlite::statement::Statement::bind_parameters::h7188e5d4b82166d7 ()
    #3  0x000055555555e248 in rusqlite::Connection::execute ()
    #4  0x000055555555dc2a in undef::main ()
    #5  0x000055555555d833 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
    #6  0x000055555555d809 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hb1d0b344861e9740 ()
    #7  0x00005555555713fa in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + std::panic::RefUnwindSafe)> ()
        at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259
    #8  std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + std::panic::RefUnwindSafe), i32> () at library/std/src/panicking.rs:401
    #9  std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + std::panic::RefUnwindSafe)> () at library/std/src/panicking.rs:365
    #10 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + std::panic::RefUnwindSafe), i32> () at library/std/src/panic.rs:434
    #11 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:45
    #12 std::panicking::try::do_call<std::rt::lang_start_internal::{closure#2}, isize> () at library/std/src/panicking.rs:401
    #13 std::panicking::try<isize, std::rt::lang_start_internal::{closure#2}> () at library/std/src/panicking.rs:365
    #14 std::panic::catch_unwind<std::rt::lang_start_internal::{closure#2}, isize> () at library/std/src/panic.rs:434
    #15 std::rt::lang_start_internal () at library/std/src/rt.rs:45
    #16 0x000055555555ddc2 in main ()
    
    bug help wanted 
    opened by zgtm 13
  • Make `ToSqlOutput<'a>` implement `ToSql`

    Make `ToSqlOutput<'a>` implement `ToSql`

    I'd like to understand why ToSqlOutput<'a> does not implement ToSql.

    Over in https://github.com/mozilla/mentat, we're using rusqlite to implement a knowledge store on top of an embedded SQLite store. Part of what we're doing is implementing our own value encoding: our values are strictly richer than the set of SQLite values, and therefore we encode them as a pair (value_type_tag, sqlite_value) to write them to the database. (The type tag is a TINYINT.) I've worked out how to use rusqlite::Value to read a value with a dynamic type from the SQLite store, but I'm having trouble writing a SQL value with a dynamic type to SQLite store.

    I think my issue is specifically around minimizing copies, because I'm pretty sure I can make

    to_sql(value: &mentat::Value, value_type: mentat::ValueType) -> (rusqlite::Value, i32)
    

    work. What I want, however is to make

    to_sql<'a>(value: &'a mentat::Value, value_type: mentat::ValueType) -> (rusqlite::ToSqlOutput<'a>, i32)
    

    work, since that should let me avoid copying potentially large strings, blobs, etc. (By not work, I mean that I can't bind &'a rusqlite::ToSqlOutput<'a> as a parameter.) That is, I might sometimes produce a ValueRef::Borrowed(...) borrowing something internal to my mentat::Value, potentially avoiding copying. The obvious thing doesn't work, since ToSqlOutput<'a> doesn't implement ToSql. It's not trivial to implement either, since there needs to be some copying, but I might be able to figure out what is appropriate in my case.

    Is the missing implementation an oversight? Is there something I am fundamentally misunderstanding about this situation? Does it not make sense to do this in general, so that implementing a newtype sibling to ToSqlOutput<'a> but specialized to my situation is the way to proceed? Thanks!

    opened by ncalexan 13
  • Savepoints with same name

    Savepoints with same name

    Currently, all the created savepoints have the same name sp. See the following test case: https://github.com/gwenn/rusqlite/commit/7c5f74447a2a24e322ed0ab41989086ef5229a6e#diff-d0e9b1d1df1c5795eac22a324e40477eR265 for an example that unexpectedly fails: https://ci.appveyor.com/project/gwenn/rusqlite/build/1.0.64 It seems to me that savepoints must have distinct names. Regards.

    opened by gwenn 13
  • Option to expose `bundled` sqlite dll when building `libsqlite-sys` (dynamically linked instead of statically linked)

    Option to expose `bundled` sqlite dll when building `libsqlite-sys` (dynamically linked instead of statically linked)

    I am currently writing a Rust application and an additional .NET application which both read from the same .db file. I want to the .NET component to use the same sqlite library as the Rust application so that there will be no issues regarding feature usage (especially the sqlite version). The target platform is Windows 11 64-bit.

    Currently, the Rust application is using the bundled and blob features. I was expecting the release build of the Rust application to have a separate sqlite3.dll that gets dynamically loaded, but instead it seems like it gets statically linked into the final executable (so we have one big executable). While this is normally a good thing, I would like for the bundled library to be dynamically linked instead (but built using the bundled libsqlite-sys package) so that I can in turn dynamically link to this library to be used in the .NET component.

    opened by Enigmatrix 0
  • Linkage issue in windows

    Linkage issue in windows

    It always tell me that

    c:\sql>cargo build
       Compiling libsqlite3-sys v0.25.2 (c:\sql\libsqlite3-sys)
    warning: cl : Command line warning D9027 : source file 'C:\Program Files\OpenSSL-Win64\lib\libcrypto.lib' ignored
       Compiling rusqlite v0.28.0 (c:\sql)
        Finished dev [unoptimized + debuginfo] target(s) in 5.11s
    

    so I change the script.

    I think it can fix issue #966 also

    opened by ssrlive 0
  • Consider removing/obscuring the `winsqlite3` feature?

    Consider removing/obscuring the `winsqlite3` feature?

    Hi folks! This is a bit of an odd issue (and I apologize if you're already aware of this!), but it seems like the compiled version of SQLite inside of Windows is only meant to be used by projects that are bundled as part of the Windows operating system ( https://github.com/microsoft/win32metadata/issues/824#issuecomment-1067220882), not non-Microsoft projects.

    If removal isn't in the cards, would you all consider moving it behind RUSTFLAGS (e.g., as Tokio does) to reduce the hazard of accidentally enabling this feature?

    opened by davidbarsky 1
  • Support bundling a Statement and a Rows object together

    Support bundling a Statement and a Rows object together

    As near as I can tell, it is currently impossible to write a function which takes a Connection and returns a Rows or an iterator derived from a Rows object. This is due to Rows not owning the Statement on which it is based. There should be a version of query which consumes the Statement and returns an object that bundles the Statement and the Rows object together. This would allow functions of the sort I mention.

    opened by obsgolem 2
  • write access violation in execute batch

    write access violation in execute batch

    Stop reason: Exception 0xc0000005 encountered at address 0x7ff62710f39b: Access violation writing location 0x2cdff1d8

    This happened while unit testing, two tests used this function:

        fn make_harness() -> Connection {
    
            let con = Connection::open_in_memory().unwrap();
            con.execute_batch(
                "
            CREATE TABLE imgs(url text);
            INSERT INTO imgs VALUES ('banana');
            INSERT INTO imgs VALUES ('mango');
            INSERT INTO imgs VALUES ('kiwi');
            INSERT INTO imgs VALUES ('3');
            INSERT INTO imgs VALUES ('4');
            INSERT INTO imgs VALUES ('5');
            INSERT INTO imgs VALUES ('6');
            INSERT INTO imgs VALUES ('7');
            INSERT INTO imgs VALUES ('8');
            INSERT INTO imgs VALUES ('9');
            INSERT INTO imgs VALUES ('10');
            INSERT INTO imgs VALUES ('11');
            INSERT INTO imgs VALUES ('12');
            INSERT INTO imgs VALUES ('13');
            INSERT INTO imgs VALUES ('14');
            INSERT INTO imgs VALUES ('15');
            INSERT INTO imgs VALUES ('16');
            INSERT INTO imgs VALUES ('17');
            INSERT INTO imgs VALUES ('18');
            ",
            )
            .unwrap()        
        }
    

    The first test works fine, but the second one just hangs in execute_batch. Only by debugging I was able to find the problem.

    invalid 
    opened by dev-ardi 4
Releases(sys0.25.2)
  • sys0.25.2(Oct 27, 2022)

    Bumped bundled version of SQLcipher to 4.5.2, equivalent to SQLite 3.39.2, which contains a fix for CVE-2022-35737.

    Note that the bundled SQLite already contained this fix, in 0.25.1. (If you do not use the bundled-sqlcipher feature, you do not need this change).

    Source code(tar.gz)
    Source code(zip)
  • sys0.25.1(Jul 22, 2022)

  • v0.28.0(Jul 14, 2022)

    What's Changed

    • Update bundled SQLcipher to v4.5.1 (equivalent to SQLite 3.37.2) #1131
    • Implement Params for tuples, improve documentation some. #1133
    • Force use of buildtime_bindgen under winsqlite3 for now #1135
    • Add some missing wrappers #1139
    • Upgrade SQLite bundled version to 3.39.0 #1200
    • Disable winsqlite3 on 32 bit targets #1151
    • Fix non-bundled tests against macOS system SQLite #1153
    • Expose sqlite3_changes (or sqlite3_changes64 if available) #1152
    • Improve the docs for opening the connection a bit #1155
    • Small doc grammar fix #1156
    • Add support to updatable virtual tables #1141
    • Add Error methods to get SQLite error values by #1158
    • Add Connection::release_memory method #1164
    • derive Eq for Type #1165
    • Upgrade uuid dependency #1167
    • Params for 28-length arrays #1169
    • Introduce SqlInputError with offset #1137
    • Derive Debug for Savepoint #1179
    • document winsqlite3 #1109
    • Fix typo in libsqlite flags variable #1115
    • Upgrade bindgen to version 0.60 #1196

    Full Changelog: https://github.com/rusqlite/rusqlite/compare/v0.27.0...v0.28.0

    Source code(tar.gz)
    Source code(zip)
  • sys0.24.1(Mar 5, 2022)

    This release contains an update to the bundled version of SQLcipher, and no other changes. The update moves it to SQLcipher v4.5.1, which is equivalent to SQLite 3.37.2. (The version of SQLcipher bundled previously was v4.5.0, equivalent to SQLite 3.36.0)

    Note that this is still a version behind the copy of "plain" SQLite we pull in under features = ["bundled"], which is SQLite 3.38.0.

    There is no corresponding rusqlite release, as this will trickle out out over time, and Rusqlite itself does not care about the version change. That said, if you use rusqlite, and absolutely must ensure you have this change, it should be sufficient to run cargo update in the rusqlite-using workspace, which will update the version in your Cargo.lock file. You may instead add a direct dependency on libsqlite3-sys = "0.24.1" to your Cargo.toml, in case relying on Cargo.lock for this is undesirable.

    Source code(tar.gz)
    Source code(zip)
  • v0.27.0(Feb 27, 2022)

    What's Changed

    • Fix documentation typo for rollback_hook #1051
    • Remove lazy_static dependency for vtab #1063
    • Sync series with official source by #1064
    • Enable modern-full feature for docs.rs #1066
    • Fix markdown rendering of Connection::transaction doc #1067
    • Add ToSql/FromSql for [u8; N] #1069
    • Upgrade bundled SQLCipher to 4.5.0 #1073
    • Clean up unlock_notify code a bit #1077
    • Use caching in our CI #1078
    • Enable buildtime_bindgen tests on windows CI #1090
    • Replace Gitter with Discord #1079, #1091
    • Use stable rust for doc checking in CI #1092
    • Exclude some configuration files from package #1093
    • Remove the SQLite version check #1094
    • Move Limits enum from libsqlite3-sys into rusqlite #1096
    • Uncomment config::DbConfig::SQLITE_DBCONFIG_RESET_DATABASE #1113
    • Upgrade SQLite bundled version to 3.38.0 #1124, #1127

    Full Changelog: https://github.com/rusqlite/rusqlite/compare/v0.26.3...v0.27.0

    Source code(tar.gz)
    Source code(zip)
  • sys0.9.4(Jan 4, 2022)

  • v0.26.0(Oct 4, 2021)

    Nice to have: make possible to remove authorizer hook

    • Add bundle-sqlcipher and bundle-ssl #860
    • Breaking changes: Add support for authorizer hook #946 / #975 Action is not visible from root anymore
    • Add a function to return the path of a Connection #963 / #962
    • Add a helper function for getting the byte data from a ValueRef, regardless of if its Text or Blob #983
    • Make the empty placeholder params be Send + Sync #1005
    • Use a generic ToSql param in pragma functions #1009
    • Breaking changes: Implement AsRef<Statement> for Row(s) #887 Rows::column* and Row::column* removed now that you have access to underlying statement.
    • Fix FromSql impl for OffsetDateTime #970
      • Upgrade time crate to version 0.3.0
    • Bump bundled sqlite3 version to 3.36.0 #979
    • Allow static linking against the VC runtime #1021
    • Breaking changes: Make load_extension unsafe #1016
    • Add as_type_or_null to ValueRef #1012
    • Correct pkg-config version #960
    • Improve VTab API: Iterate on both index constraint and usage #1001 / #1006
    • Access to sqlite3_db_cacheflush via Connection #984 / #985
    • Retrieve error message from database connection handle #988
    • Include the session FFI in the bundled bindings #982
    • Use #[doc(cfg)] instead of manually indicating feature = "blah" in the comments #835 / #973
    • Use env::var instead of cfg in some cases in build.rs #961
    • Add time back to modern-full feature #969
    • Fix InnerConnection decode_result / changes #974 / #931
    • Upgrage bindgen to version 0.59 #994
    Source code(tar.gz)
    Source code(zip)
  • v0.25.3(May 9, 2021)

  • v0.25.2(May 9, 2021)

    Note: rusqlite v0.25.2 has been yanked because it accidentally enabled bundled-full as a default feature. v0.25.3 has been cut that is equivalent but without that change. The libsqlite3-sys release that happened at the same time is still fine.

    This release is a patch release that enables builds on some older versions of Rust. Rusqlite does not commit to a particular MSRV, but this release is known to work at least back to Rust 1.41.0.

    It is likely that the next release will require a newer version of Rust, whether or not it is mentioned in the release notes.

    Source code(tar.gz)
    Source code(zip)
  • v0.25.1(Apr 19, 2021)

  • v0.25.0(Apr 3, 2021)

    • BREAKING CHANGE: Overhaul parameter API #830 / #609
    • Add ToSql implementations for u64 and usize #826 / #821
    • Implement FromSql for u64, usize and f32, and ToSql for f32 #823 / #822 / #821
    • Reduce required lifetime in create_scalar_function #825
    • Expose query progress information and introduce Batch iterator #824 / #803
    • Add #[inline] and #[cold] in far more places #834
    • Fix create_collation #839
    • Remove #[non_exhaustive] attribute on IndexConstraintOp #840 / #783
    • Document that optional() requires import of trait rusqlite::OptionalExtension #842
    • Update time to appease deps.rs #849
    • Upgrade to bindgen 0.57
    • Improve busy handler documentation #854
    • Upgrade SQLite bundled version to 3.35.4
    • Expands/cleans up documentation. Also renames (and documents) the so-far-undocumented LIBSQLITE3_FLAGS. #861
    • Add get_connection method to function context #867
    • Fix smallvec version #896
    • BREAKING CHANGE: Pass context to aggregate init and finalize #866
    • BREAKING CHANGE: Rename get_raw to get_ref_unwrap and get_raw_checked to get_ref #838
    • BREAKING CHANGE: Fix DateTime format #886 / #885 + Leniently parse rfc3339 timezones #928
    Source code(tar.gz)
    Source code(zip)
  • v0.24.2(Dec 5, 2020)

    v0.24.2 is identical to v0.24.1 except it allows building with an older version of smallvec, as the newer one caused meaningful performance issues in Firefox.

    See https://github.com/rusqlite/rusqlite/pull/855 for more info.

    Source code(tar.gz)
    Source code(zip)
  • v0.24.1(Oct 7, 2020)

    • The lru-cache crate has been replaced with hashlink, which may fix panics on Rust nightly caused by unsoundness in some versions of the lru-cache crate (#811).

    • A positional BLOB I/O API has been added, which more closely mirrors SQLites actual BLOB I/O api, and is similar to unix-style pwrite/pread. (#780).

    • A winsqlite3 feature as been added to both rusqlite and libsqlite3-sys which allows linking against the SQLite present in newer versions of Windows 10 (#796).

    • Rusqlite's iterator types are now #[must_use] (#799).

    • Several dependencies have been updated.

    Source code(tar.gz)
    Source code(zip)
  • 0.24.0(Aug 22, 2020)

    • BREAKING CHANGE: Upgrade to time v0.2 and put it behind a feature flag (#653)
    • impl TryFrom<&Row<'_>> for (...) This change implements TryFrom<&Row> for tuples up to 16 fields. This is a convenience function that can be used to map rows more easily.
    • adding ability to work with sqlite compiled with SQLITE_OMIT_DECLTYPE (feature column_decltype)
    • LIBSQLITE3_FLAGS hook Enables compiling bundled sources with different flags.
    • Add cross-compilation with mingw (#774)
    • Support wasm32-wasi target (#785)
    • Implement our own sqlite3_execwhich supports unlock notify (#767)
    • Fix order of parameters in InvalidParameterCount message (#779)
    • Don't implement Into for Statement (#763)
    • Publically expose Map
    • little speedup for bundled sqlite3.c on unix (HAVE_LOCALTIME_R)
    • BREAKING CHANGE: VTabCursor lifetime should be bound to VTab lifetime (#753)
    • preupdate_hook feature requires buildtime_bindgen
    • Upgrade SQLite bundled sources to 3.33.0
    • Upgrade to bindgen 0.54
    • Fix missing docs
    • Add link to gitter channel (#738)
    • Include LICENSE into the libsqlite3-sys crate (#736)
    Source code(tar.gz)
    Source code(zip)
  • 0.23.1(Apr 23, 2020)

  • 0.23.0(Apr 23, 2020)

    The release primarily contains a number of security/memory safety fixes, which were mostly found due to an audit of the unsafe code in the crate. An advisory will be published for these shortly.

    They mostly impact APIs exposed through features, so while there are a lot of them, if you're using rusqlite under default features, you're fine. None of them impact libsqlite3-sys.

    It's a major release as these APIs were fundamentally unsound and could not be fixed without breaking changes.

    • Make VTab / VTabCursor unsafe trait as implementing them on the wrong type is unsound https://github.com/rusqlite/rusqlite/commit/c9ef5bd63cad5c0c123344c072b490a1a9bcbe1f. (Note that a safe VTab API is planned in the future).
    • Make create_module take a &'static Module as that's what the reference was treated as. https://github.com/rusqlite/rusqlite/commit/3c6b57fe1b2cc87e7ebecde43dd836ffb1c4ea5c
    • Make UnlockNotification hold the Mutex while notifying the CondVar. Also, ensure &mut is not used to reference a value shared across another thread. https://github.com/rusqlite/rusqlite/commit/45fd77ee43c38eea4d6f4e2e56c1667a55ec654f
    • Fix potential format string vuln in rusqlite::trace::log https://github.com/rusqlite/rusqlite/commit/2327d3b774927fdf48903c0bdc1ca7ec93c7c8d0
    • Auxdata API has been changed and has new bounds.
      • Fix potential use-after-free and data race in auxdata api https://github.com/rusqlite/rusqlite/commit/2ef3628dac35aeba0a97d5fb3a57746b4e1d62b3
      • Fix repr(Rust) type being used as if it were repr(C) https://github.com/rusqlite/rusqlite/commit/71b2f5187b0cbace3f8b6ff53432ff2ca0defcf0
    • Fix use-after-free in sessions.rs in https://github.com/rusqlite/rusqlite/commit/ac30e169ae51b262bc8cf7026469851ce39b23c6

    Non-safety changes in this release:

    • Bundled SQLite has been updated to 3.31.1 https://github.com/rusqlite/rusqlite/commit/22564d3099f7fab835347edf8b5d3eda1364014b
    • Non-unicode paths are now handled properly, at least on unix https://github.com/rusqlite/rusqlite/pull/692
    • Functions using va_list are excluded from the bundled bindings, as these are platform specific. You can still use them if you enable the buildtime_bindgen feature. https://github.com/rusqlite/rusqlite/commit/288aa961a75ac29f704bfe2f9794148e0a197e10
    • An unchecked_transaction function has been added which allows opting-out of compile time transaction checking. Despite it's name, it's still checked, it just downgrades a compilation error to a runtime one: https://github.com/rusqlite/rusqlite/pull/693
    • std::error::Error::source is implemented in favor of std::error::Error::cause for all error types.
    Source code(tar.gz)
    Source code(zip)
  • 0.22.0(Apr 8, 2020)

    • Add ability to open sqlite connection with specified vfs (#630)
    • Fix i32 overflow in Connection::busy_timeout (#604)
    • Separate the modern_sqlite and bundled features. (#613)
    • Add FromSql for Box<str>, Rc<str> and Arc<str>
    • Fix params macro (#614)
    • Fix error while executing ALTER statement (#645)
    • Ignore PATH change (#435)
    • Add playground metadata for rusqlite, hopefully fixing it (#647)
    • Don't perform threading mode checks on wasm32 (#640)
    • Upgraded the bundled SQLite version to 3.31.0. (#619)
    • Add support to function flags (#622)
    • Add missing IndexConstraintOp entries (#623)
    • Add missing error codes (#624)
    • Add missing constants (#629)
    • Introduce alloc to generate C string allocated by sqlite3 (#644)
    • rusqlite now exposes the bundled-windows feature, forwarding to libsqlite3-sys. (#682)
    • rusqlite::Result<T> is now defined as type Result<T, E = rusqlite::Error>. This avoids needing to access std::result::Result explicitly when rusqlite::Result is brought into scope. (#678)
    • Rows now support mapped and and_then functions which return Iterators. This is useful if you cannot use query_map or query_and_then for some reason. (#676)
    • A new error variant was added for using the wrong number of bound parameters. Previously this caused a panic (#675).
    • Many rusqlite enums have been made #[non_exhaustive] for better extensibility. (#673)
    • Various low-level Statement apis have been added to allow separating parameter binding and statement execution. (#668)
    • ToSql is implemented for various smart pointers (Box, Cow, Rc, Arc) in more cases. (#660)
    • bundled-full feature now exists to enable both bundled and other features which do not conflict. It is mainly intended to improve developer ergonomics for working on rusqlite (#687)
    • The features vtab_v3 and unstable are removed. The former is no longer necessary and the latter was only used for #[bench]. (#687)
    • rusqlite::Error now implements std::error::Error::source instead of only std::error::Error::cause. Use of cause will still work, as it goes through source by default. (#683)
    Source code(tar.gz)
    Source code(zip)
  • 0.21.0(Dec 13, 2019)

    • Fix memory leak when using Statement.expanded_sql (#552)
    • Fix segfault on prepare_cached with an empty query (#583)
    • Handle old versions of visual studio (#554)
    • Conversion from FromSqlError to Error (#556)
    • Parse Option<T> into Value/ValueRef where applicable (#571)
    • Make column_name() public and forward all column methods in Row and Rows (#568)
    • Check SQL query passed to execute (#565)
    • Check that only one statement is provided when extra_check feature is activated (#397)
    • Improve error message when we can't open a database (#578)
    • Upgrade bundled SQLite version to 3.30.1 (#579)
    • Replace deprecated tempdir with tempfile (#594)
    • Download sqlite source via HTTPS (#599)
    • Fix session extension (#588)
    • Upgrade to uuid 0.8 (#576)
    • Disable vcpkg in appveyor build (#580)
    Source code(tar.gz)
    Source code(zip)
  • 0.20.0(Jul 27, 2019)

    • BREAKING CHANGE: Do not assume sqlite3_column_text is valid UTF-8. (#548)
    • Make Module impl Send (#543)
    • Upgrade bundled SQLite version to 3.29
    • Upgrade bindgen to 0.51
    Source code(tar.gz)
    Source code(zip)
  • 0.19.0(Jun 26, 2019)

    • Increase bundled SQLite variables and depth (#522)
    • Fix error when building with uuid and functions features. (#515)
    • Upgrade bundled SQLite sources to 3.28.0 (#513)
    • Fix nightly build (#514)
    • Add query_row_named for prepared statement (#528)
    • Add binding to sqlite3_create_collation_v2 (#534)
    • Add bundled-windows feature (#537)
    • Add binding to sqlite3_create_window_function (#539)
    • Include the name of the column in InvalidColumnType errors (#541)
    Source code(tar.gz)
    Source code(zip)
  • 0.18.0(Apr 24, 2019)

    • Add support for Uuid (#506)
    • impl ToSql for Box<dyn ToSql> (#500)
    • Allow specifying both sqlcipher and bundled (#511)
    • Introduce Statement::columns (#494)
    • Rebuild when VCPKGRS_DYNAMIC changes (#483)
    • Upgrade to fallible-iterator 0.2
    Source code(tar.gz)
    Source code(zip)
  • 0.17.0(Mar 10, 2019)

    • BREAKING CHANGE: Cannot insert heterogeneous elements with .execute #462 Add params/named_params macro, and expose ToSql from top level #471
    • BREAKING CHANGE: Do not panic by default #485 Replace Row::get by Row::get_checked, And rename original Row::get to Row::get_unwrap. Stmt::query_map, Stmt::query_map_named, Stmt::query_row, Conn::query_row and Conn::query_row_named callback parameter must return a Result.
    • BREAKING CHANGE: Make Rows implement FallibleStreamingIterator #478 Rows::next returns Result<Option<&Row<'_>>> instead of Option<Result<Row<...>>>.
    • Avoid unnecessary copies/allocations when passing strings to sqlite #487
    • Ease PRAGMA usage (#273 and #265) #476
    • Add optional support for rust-url #491
    • Impl PartialEq for Error #416
    • Make get_aux safe by storing the TypeId with the data.
    • Introduce Connection::from_handle #453
    • Support for sqlite3_db_config #468
    • Make the libsqlite3_sys as ffi export pub #469
    • Derive Debug for Transaction #470
    • Upgrade bundled version to SQLite 3.27.2
    • BREAKING CHANGE: Session extension
    • Restore old bindgen for Diesel
    • Upgrade to bindgen 0.48
    Source code(tar.gz)
    Source code(zip)
  • 0.16.0(Dec 16, 2018)

    • Update README example.
    • Allow build time bindgen of bundled SQLite
    • Fix Timespec FromSql implementations (#431)
    • Add support for forcing cargo:rustc-link-lib to link as native
    • BREAKING CHANGE: Callbacks must not be able to unwind into sqlite code
    • Introduce OptionalExtension
    • Upgrade bundled version to SQLite 3.26.0
    • BREAKING CHANGE: remove deprecated stuff
    • Fix compilation error with functions and i128 features
    • Fix test_interrupt #415
    • Rust 2018
    • Upgrade to bindgen 0.45
    Source code(tar.gz)
    Source code(zip)
  • 0.15.0(Oct 21, 2018)

    • Allow getting a ValueRef out of Row and Context, fixes #259
    • Remove version check when bundled
    • Add a feature for storing i128 as blobs.
    • Add a method of interrupting a query executing on a separate thread, fixes #407
    • BREAKING CHANGE: Take IntoIterator rather than &[&ToSql] (#312)
    • Impossible to execute a pragma in 0.14.0 #400
    • BREAKING CHANGE: Remove old bindgens
    • array feature should not require bundled #384
    • Upgrade SQLite bundled sources to 3.25.2
    • Upgrade to bindgen 0.42
    Source code(tar.gz)
    Source code(zip)
  • 0.14.0(Aug 17, 2018)

    • BREAKING CHANGE: ToSql implementation for time::Timespec uses RFC 3339 (%Y-%m-%dT%H:%M:%S.%fZ). Previous format was %Y-%m-%d %H:%M:%S:%f %Z.
    • BREAKING CHANGE: Remove potentially conflicting impl of ToSqlOutput (#313).
    • BREAKING CHANGE: Replace column index/count type (i32) with usize.
    • BREAKING CHANGE: Replace parameter index/count type (i32) with usize.
    • BREAKING CHANGE: Replace row changes/count type (i32) with usize.
    • BREAKING CHANGE: Scalar functions must be Sendable and 'static.
    • Bugfix: Commit failure unhandled, database left in unusable state (#366).
    • Bugfix: free_boxed_hook does not work for fn.
    • Update the bundled SQLite version to 3.24.0 (#326).
    • Add DropBehavior::Panic to enforce intentional commit or rollback.
    • Implement sqlite3_update_hook (#260, #328), sqlite3_commit_hook and sqlite3_rollback_hook.
    • Add support to unlock notification behind unlock_notify feature (#294, #331).
    • Make Statement::column_index case insensitive (#330).
    • Add comment to justify &mut Connection in Transaction.
    • Fix tyvar_behind_raw_pointer warnings.
    • Fix handful of clippy warnings.
    • Fix Connection::open documentation (#332)
    • Add binding to sqlite3_get_autocommit and sqlite3_stmt_busy.
    • Add binding to sqlite3_busy_timeout and sqlite3_busy_handler.
    • Add binding to sqlite3_expanded_sql.
    • Use rerun-if-env-changed in libsqlite3-sys (#329).
    • Return an InvalidQuery error when SQL is not read only.
    Source code(tar.gz)
    Source code(zip)
  • 0.13.0(Nov 13, 2017)

    • Added ToSqlConversionFailure case to Error enum.
    • Now depends on chrono 0.4, bitflats 1.0, and (optionally) cc 1.0 / bindgen 0.31.
    • The ToSql/FromSql implementations for time::Timespec now include and expect fractional seconds and timezone in the serialized string.
    • The RowIndex type used in Row::get is now publicly exported.
    • New sqlcipher feature allows linking against SQLCipher instead of SQLite.
    • Doc link in README now point to docs.rs.
    Source code(tar.gz)
    Source code(zip)
  • 0.12.0(May 29, 2017)

    • Defines HAVE_USLEEP when building with a bundled SQLite (#263).
    • Updates dependencies to their latest versions, particularly serde to 1.0.
    • Adds support for vcpkg on Windows.
    • Adds ToSql impls for str and [u8].
    Source code(tar.gz)
    Source code(zip)
  • 0.11.0(May 29, 2017)

    • Avoid publicly exporting SQLite constants multiple times from libsqlite3-sys.
    • Adds FromSql and ToSql impls for isize. Documents why usize and u64 are not included.
    Source code(tar.gz)
    Source code(zip)
  • 0.10.2(Apr 5, 2017)

    • Avoid publicly exporting SQLite constants multiple times from libsqlite3-sys.
    • Adds FromSql and ToSql impls for isize. Documents why usize and u64 are not included.
    Source code(tar.gz)
    Source code(zip)
  • 0.10.1(Mar 3, 2017)

    • Updates the bundled SQLite version to 3.17.0.
    • Changes the build process to no longer require bindgen. This should improve build times and no longer require a new-ish Clang. See the README for more details.
    Source code(tar.gz)
    Source code(zip)
Owner
Rusqlite
Ergonomic Rust wrapper for SQLite
Rusqlite
duckdb-rs is an ergonomic wrapper for using duckdb from Rust.

duckdb-rs duckdb-rs is an ergonomic wrapper for using duckdb from Rust. It attempts to expose an interface similar to rusqlite. Acctually the initial

Wang Fenjin 126 Dec 30, 2022
Asynchronous handle for rusqlite library.

tokio-rusqlite Asynchronous handle for rusqlite library. Usage use rusqlite::{params, Result}; use tokio_rusqlite::Connection; #[derive(Debug)] struc

Eray Karatay 22 Dec 22, 2022
A boilerplate eliminator for rusqlite.

Exemplar A boilerplate eliminator for rusqlite. Getting Started A taste of what you can do: #[derive(Debug, PartialEq, Model)] #[table("users")] #[che

null 4 Oct 20, 2023
Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another.

Mycelite What is Mycelite? Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another. Currently, it

Mycelial 16 Jan 2, 2023
Provides a Rust-based SQLite extension for using Hypercore as the VFS for your databases.

SQLite and Hypercore A Rust library providing SQLite with an virtual file system to enable Hypercore as a means of storage. Contributing The primary r

Jacky Alciné 14 Dec 5, 2022
A Rust-based comment server using SQLite and an intuitive REST API.

soudan A Rust-based comment server using SQLite and an intuitive REST API. Soudan is built with simplicity and static sites in mind. CLI usage See sou

Elnu 0 Dec 19, 2022
Using embedded database modeled off SQLite - in Rust

Rust-SQLite (SQLRite) Rust-SQLite, aka SQLRite , is a simple embedded database modeled off SQLite, but developed with Rust. The goal is get a better u

Hand of Midas 3 May 19, 2023
Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD(create/read/update/delete) it using gRPC.

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC. Why Create Thi

Bruce Yuan 33 Dec 16, 2022
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx ?? The Rust SQL Toolkit Install | Usage | Docs Built with ❤️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

launchbadge 7.6k Dec 31, 2022
SQLite clone from scratch in Rust

Rust-SQLite (SQLRite) Rust-SQLite, aka SQLRite , is a simple embedded database modeled off SQLite, but developed with Rust. The goal is get a better u

João Henrique Machado Silva 952 Jan 5, 2023
ChiselStore is an embeddable, distributed SQLite for Rust, powered by Little Raft.

ChiselStore ChiselStore is an embeddable, distributed SQLite for Rust, powered by Little Raft. SQLite is a fast and compact relational database manage

null 516 Jan 2, 2023
cogo rust coroutine database driver (Mysql,Postgres,Sqlite)

cdbc Coroutine Database driver Connectivity.based on cogo High concurrency,based on coroutine No Future<'q,Output=*>,No async fn, No .await , no Poll*

co-rs 10 Nov 13, 2022
Build SQLite virtual file systems (VFS) by implementing a simple Rust trait.

sqlite-vfs Build SQLite virtual file systems (VFS) by implementing a simple Rust trait. Documentation | Example This library is build for my own use-c

Markus Ast 56 Dec 19, 2022
SQLite-based on-disk cache for Rust.

sqlite-cache SQLite-based on-disk cache for Rust. Usage let cache = Cache::new( CacheConfig::default(), rusqlite::Connection::open_in_memory()

Heyang Zhou 21 Jun 1, 2023
Query is a Rust server for your remote SQLite databases and a CLI to manage them.

Query Query is a Rust server for your remote SQLite databases and a CLI to manage them. Table Of Contents Run A Query Server CLI Install Use The Insta

Víctor García 6 Oct 6, 2023
Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLite.

Description Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLit

Eduard Tolosa 27 Nov 22, 2022
Some bunch of test scripts to generate a SQLite DB with 1B rows in fastest possible way

To find out the fastest way to create an SQLite DB with 1B random rows.

null 309 Dec 20, 2022
🐸Slippi DB ingests Slippi replays and puts the data into a SQLite database for easier parsing.

The primary goal of this project is to make it easier to analyze large amounts of Slippi data. Its end goal is to create something similar to Ballchasing.com but for Melee.

Max Timkovich 20 Jan 2, 2023
A tool for automated migrations for PostgreSQL, SQLite and MySQL.

Models Models is an implementation for a SQL migration management tool. It supports PostgreSQL, MySQL, and SQLite. Quick Start install the CLI by runn

null 45 Nov 16, 2022