Module transact::database::sqlite[][src]

Expand description

An Sqlite-backed implementation of the database traits.

Note

When using this feature with an in-memory sqlite instance, DatabaseReaders cannot be opened at the same time as an existing DatabaseWriter. This is particularly true when using a database path like `“file::memory:?cache=shared”. In this case, the underlying connection pool will use the same database instance.

For a single, non-shared memory instances, the database should be created with a connection pool size of 1, such that creating readers or writers across threads will block until a connection is available.

This can be accomplished via

let database = SqliteDatabase::builder()
    .with_path(":memory:")
    .with_connection_pool_size(NonZeroU32::new(1).unwrap())
    .build()
    .unwrap();

Feature

This is available via the optional feature “sqlite-db”.

This is currently an experimental feature.

Structs

A Database implementation backed by a Sqlite instance.

A builder for generating SqliteDatabase instances.

An error that may be returned during SqliteDatabase-specific operations.

Enums

Journal Mode setting values.

Synchronous setting values.

Constants

The default size