ποΈFeatures
Aligned to SQLite 3.44.0 for bundled builds;
A single executable file (written in Rust);
Can be built against the system's SQLite or embedding one;
HTTP/JSON access, with client libraries for convenience;
Directly call
sqliterg
on a database (as above), many options available using a YAML companion file;In-memory DBs are supported;
Serving of multiple databases in the same server instance;
Named or positional parameters in SQL are supported;
Batching of multiple value sets for a single statement;
All queries of a call are executed in a transaction;
For each query/statement, specify if a failure should rollback the whole transaction, or the failure is limited to that query;
"Stored Statements": define SQL in the server, and call it from the client;
"Macros": lists of statements that can be executed at db creation, at startup, periodically or calling a web service;
Backups, rotated and also runnable at db creation, at startup, periodically or calling a web service;
CORS mode, configurable per-db;
Journal Mode (e.g. WAL) can be configured;
Embedded web server to directly serve web pages that can access
sqliterg
without CORS;Comprehensive test suite;
Docker images, for x86_64 and arm64;
Binaries are provided with a bundled SQLite "inside" them, or linked against the system's installed SQLite.
Security Features
Authentication can be configured
on the client, either using HTTP Basic Authentication or specifying the credentials in the request;
on the server, either by specifying credentials (also with hashed passwords) or providing a query to look them up in the db itself;
customizable
Not Authorized
error code (if401
is not optimal);
A database can be opened in read-only mode (only queries will be allowed);
It's possible to enforce using only stored statements, to avoid some forms of SQL injection and receiving SQL from the client altogether;
CORS Allowed Origin can be configured and enforced;
It's possible to bind to a network interface, to limit access.
Design choices
Very thin layer over SQLite. Errors and type translation, for example, are those provided by the SQLite driver;
Doesn't include HTTPS, as this can be done easily (and much more securely) with a reverse proxy.
Last updated