sqlite-vfs-http
The sqlite-vfs-http
is a library based on the SQLite VFS extension, designed to access static SQLite files located on a CDN via HTTP/HTTPS protocol.
By using this library, you can host SQLite database files on a remote server and perform queries without downloading the files locally.
Requirements
- any crate that link SQLite3 to your binary, such as
rusqlite
,sqlx
orlibsqlite3-sys
Usage
- add the following to your
Cargo.toml
:
[]
= "0.1.0"
- use the library in your code:
use ;
use ;
// Register the HTTP VFS for sqlite
register_http_vfs;
let base = "https://example.com";
let conn = open_with_flags_and_vfs?;
conn.query_row.unwrap;
Limitations
- Before uploading to the CDN, the database needs to change the journal mode to
MEMORY
:
PRAGMA journal_mode = MEMORY;
License
This project is licensed under the AGPL-3.0 license.