Crate sqlsrv

source ·
Expand description

A library for implementing an in-process SQLite database server.

§Connection pooling

sqlsrv implements connection pooling that reflects the concurrency model of SQLite: It supports multiple parallel readers, but only one writer.

§Thread pooling

In addition to pooling connections, the library supports optionally using a thread pool for diaptching database operations onto threads.

§Incremental auto-clean

The connection pool has built-in support for setting up incremental autovacuum, and can be configured to implicitly run incremental vacuuming.

To use this feature, a “maximum dirt” value is configured on the connection pool. Whenever the writer connection performs changes to the database it can add “dirt” to the connection. When the writer connection is returned to the connection pool it checks to see if the amount of dirt is equal to or greater than the configured “maximum dirt” threshold. If the threshold has been reached, an incremental autovacuum is performed.

§Features

FeatureFunction
tpoolEnable functions/methods that use a thread pool.

Re-exports§

Modules§

  • Utility functions around SQL commands.

Structs§

  • Builder for constructing a ConnPool object.
  • SQLite connection pool.
  • SQLite connection object that can be used for operations that modify the database.

Enums§

  • Database hook action type.
  • Errors that are returned by sqlsrv.
  • Wrapper around a SQL functions registration callback used to select which connection types to perform registrations on.

Traits§

  • Application callback used to process committed changes to the database.
  • Application callback used to process changes to the database.
  • Used to register application callbacks to set up database schema.