Provides a Rust-based SQLite extension for using Hypercore as the VFS for your databases.

Overview

SQLite and Hypercore

Build Status

A Rust library providing SQLite with an virtual file system to enable Hypercore as a means of storage.

Contributing

The primary repository for this project is stored at git.jacky.wtf and mirrored to github.com. You can use whichever code forge you'd prefer.

It is recommended to always use cargo-crev to verify the trustworthiness of each of your dependencies, including this one.

Things to Do

  • Complete the wrapper over sqlite3_vfs in sqlite_hypercore::vfs.
  • Implement individual database lookups by petnames into Hypercore in sqlite_hypercore::vfs::hyper.
  • Ensure multi-thread support.
  • Add tests.
  • (Eventually) upstream the VFS wrapper logic to rusqlite.
  • Figure out how to handle peering of the Hypercore backend.
  • Support opening remote databases using a URL, i.e.: hyper://$HOST/path?vfs=$HYPERCORE_VFS_NAME
  • ... and local ones i.e.: hyper:path?vfs=$HYPERCORE_VFS_NAME or hyper:///full/path?vfs=$HYPERCORE_VFS_NAME.

End Goal

The final result is to be able to open up a connection to a Hypercore daemon on a local (or remote machine), find a database that can be written to and continue to work with SQLite as if it were a regular instance on the local machine.

use rusqlite::{Connection, OpenFlags};
use hypersqlite::{Instance, Vfs, VfsOptions, Storage};

#[async_std::main]
async fn main() -> anyhow::Result<()> {
  let mut hyper_vfs_options = VfsOptions::default();
  hyper_vfs_options.storage = Storage::InMemory;

  let hyper_vfs = Vfs::connect(hyper_vfs_options)
    .expect("Failed to connect to Hypercore daemon.");

  let inst = Instance::register("hyper-memory", hyper_vfs, false);

  let conn = Connection::open_with_flags("docs.db",
    OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE,
    inst.deref().borrow().vfs_name()?
    );

  // The database's been written into memory but into the Hypercore!
  Ok(())
}

Licensing

This project is dual-licensed under the BSD 2 and MIT. Just don't use it for things like ICE or the like!

You might also like...
Optimistic multi-version concurrency control (MVCC) for main memory databases, written in Rust.

MVCC for Rust This is a work-in-progress the Hekaton optimistic multiversion concurrency control library in Rust. The aim of the project is to provide

Rust library and daemon for easily starting postgres databases per-test without Docker

pgtemp pgtemp is a Rust library and cli tool that allows you to easily create temporary PostgreSQL servers for testing without using Docker. The pgtem

CLI tool to work with Sled key-value databases.

sledtool CLI tool to work with Sled key-value databases. $ sledtool --help Usage: sledtool dbpath command [args] CLI tool to work with Sled da

Engula empowers engineers to build reliable and cost-effective databases.
Engula empowers engineers to build reliable and cost-effective databases.

Engula is a storage engine that empowers engineers to build reliable and cost-effective databases with less effort and more confidence. Engula is in t

Sled - the champagne of beta embedded databases
Sled - the champagne of beta embedded databases

key value buy a coffee for us to convert into databases documentation chat about databases with us sled - it's all downhill from here!!! An embedded d

Rusqlite is an ergonomic wrapper for using SQLite from Rust

Rusqlite Rusqlite is an ergonomic wrapper for using SQLite from Rust. It attempts to expose an interface similar to rust-postgres. use rusqlite::{para

Using embedded database modeled off SQLite - in Rust
Using embedded database modeled off SQLite - in Rust

Rust-SQLite (SQLRite) Rust-SQLite, aka SQLRite , is a simple embedded database modeled off SQLite, but developed with Rust. The goal is get a better u

SQLite-based on-disk cache for Rust.

sqlite-cache SQLite-based on-disk cache for Rust. Usage let cache = Cache::new( CacheConfig::default(), rusqlite::Connection::open_in_memory()

Document your SQLite tables and columns with in-line comments
Document your SQLite tables and columns with in-line comments

sqlite-docs A SQLite extension, CLI, and library for documentating SQLite tables, columns, and extensions. Warning sqlite-docs is still young and not

Owner
Jacky Alciné
GitHub (and Microsoft) needs to stop supporting ICE and other forms of anti-human rights works. My _actual_ bio is at https://jacky.wtf
Jacky Alciné
Example sqlite3 Dynamic Loadable Extension in Rust - vfs and vtab modules - port of vfsstat.c

Example sqlite3 Dynamic Loadable Extension in Rust - vfs and vtab modules The vfs and vtab This is a port of the official ext/misc/vfsstat.c sqlite3 e

Manos Pitsidianakis 28 Oct 10, 2022
Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another.

Mycelite What is Mycelite? Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another. Currently, it

Mycelial 16 Jan 2, 2023
Query is a Rust server for your remote SQLite databases and a CLI to manage them.

Query Query is a Rust server for your remote SQLite databases and a CLI to manage them. Table Of Contents Run A Query Server CLI Install Use The Insta

Víctor García 6 Oct 6, 2023
This project provides a Rust-based solution for migrating MSSQL databases to MySQL.

MSSQL to MySQL Database Migration A Rust project to migrate MSSQL databases to MySQL, including table structures, column data types, and table data ro

Bitalizer 2 Jul 10, 2023
A SQLite extension for quickly generating random numbers, booleans, characters, and blobs

sqlite-fastrandom A SQLite extension for quickly generating random numbers, booleans, characters, and blobs. Not cryptographically secure. Based on sq

Alex Garcia 11 Feb 2, 2023
SQLite extension for working with operating system's clipboard (copy/paste functions)

SQLite extension for working with operating system's clipboard This extension adds the following functions to SQLite: Copy Paste Long name CLIPBOARD_C

Sergey Khabibullin 4 Jun 12, 2023
SQLite Extension adding various hashing functions like MD5, SHA1, SHA256, SHA512, etc.

sqlite-hashes Use this crate to add various hash functions to SQLite, including MD5, SHA1, SHA256, and SHA512. This crate uses rusqlite to add user-de

Yuri Astrakhan 3 Jul 28, 2023
Replibyte - a powerful tool to seed your databases

Seed Your Development Database With Real Data ⚡️ Replibyte is a powerful tool to seed your databases with real data and other cool features ?? Feature

Qovery 3.4k Jan 9, 2023
A Rust-based comment server using SQLite and an intuitive REST API.

soudan A Rust-based comment server using SQLite and an intuitive REST API. Soudan is built with simplicity and static sites in mind. CLI usage See sou

Elnu 0 Dec 19, 2022
Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD(create/read/update/delete) it using gRPC.

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC. Why Create Thi

Bruce Yuan 33 Dec 16, 2022