| Crates.io | sqlite-vfs-http |
| lib.rs | sqlite-vfs-http |
| version | 0.1.4 |
| created_at | 2024-12-25 12:33:15.180221+00 |
| updated_at | 2024-12-29 16:05:51.237268+00 |
| description | Query sqlite database over http |
| homepage | |
| repository | https://github.com/darkskygit/sqlite-vfs-http |
| max_upload_size | |
| id | 1494970 |
| size | 58,553 |
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.
rusqlite, sqlx or libsqlite3-sysCargo.toml:[dependencies]
sqlite-vfs-http = "0.1.0"
use rusqlite::{Connection, NO_PARAMS};
use sqlite_vfs_http::{register_http_vfs, HTTP_VFS};
// Register the HTTP VFS for sqlite
register_http_vfs();
let base = "https://example.com";
let conn = Connection::open_with_flags_and_vfs(
format!("{base}/0.db"),
OpenFlags::SQLITE_OPEN_READ_WRITE
| OpenFlags::SQLITE_OPEN_CREATE
| OpenFlags::SQLITE_OPEN_NO_MUTEX,
// Use HTTP VFS
HTTP_VFS,
)?;
conn.query_row(
"SELECT count(1) FROM sqlite_master WHERE type = 'table'",
[], |row| row.get::<usize>(0)
).unwrap();
MEMORY:PRAGMA journal_mode = MEMORY;
This project is licensed under the AGPL-3.0 license.