#sqlite #connection-pool #server #database-server #thread-pool #applications #pooling

sqlsrv

Utility functions for managing SQLite connections in a server application

9 releases (4 breaking)

0.4.0 Feb 20, 2024
0.3.0 Feb 10, 2024
0.2.0 Jan 28, 2024
0.1.1 Jan 24, 2024
0.0.4 Jan 19, 2024

#1821 in Database interfaces

Download history 4/week @ 2024-01-08 22/week @ 2024-01-15 8/week @ 2024-01-22 130/week @ 2024-02-19 13/week @ 2024-02-26 1/week @ 2024-03-04 15/week @ 2024-03-11 46/week @ 2024-03-25 4/week @ 2024-04-01

65 downloads per month

0BSD license

37KB
719 lines

sqlsrv

Utility functions for use in server applications that use an SQLite database.


lib.rs:

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

Feature Function
tpool Enable functions/methods that use a thread pool.

Dependencies

~29MB
~430K SLoC