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

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

SqliteDatabase

A Database implementation backed by a Sqlite instance.

SqliteDatabaseBuilder

A builder for generating SqliteDatabase instances.

SqliteDatabaseError

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

Enums

Synchronous

Synchronous setting values.

Constants

DEFAULT_MMAP_SIZE

The default size