sqlite3 Rewritten in RiiR Rust 🦀🦀🦀

Overview

sqlite3 Rewritten in RiiR Rust 🦀 🦀 🦀

Finally, one of the best written software paired with one of the best writable programming language‽ Fearless and memory safe, since the uncountable amount of unsafe {} blocks makes you not care anymore.

Build and run

$ cargo +nightly build --release
# ... bunch of stuff I choose not to understand/read
warning: `rsqlite3` (bin "rsqlite3") generated 37 warnings (24 duplicates)
    Finished release [optimized] target(s) in 39.84s
$ ./target/release/rsqlite3
-- Loading resources from /home/epilys/.sqliterc
SQLite version 3.37.0 2021-10-17 10:31:09
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open rrrrrruuuuuust.db
sqlite> CREATE TABLE opinions(x);
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> insert into opinions(x) values (hex(randomblob(16)));
sqlite> select * from opinions;
x
--------------------------------
343D4BE24D07A96F8550B0942F664A6C
D6289536E4A8057EB44754358EACD31A
B4CA8E714CB57B11E7336263D214F30F
A6491CA289ABF90EB2D76F5E1F919272
sqlite> PRAGMA journal_mode = wal;
journal_mode
------------
wal
sqlite> PRAGMA integrity_check;
integrity_check
---------------
ok
sqlite> VACUUM;
sqlite> ^D

Wait, what?

This is just the sqlite3 code passed throught the c2rust transpiler, along with some cleanup from me. I've found no way to hook it to sqlite3's testing harnesses yet so I doubt it's completely functional; but opening the shell seems to work.

I am suspicious that a lot of code under ifdefs or not is lost through the transpilation, because the binary size difference is substantial:

$ du -sh $(which sqlite3)
9.5M    /home/epilys/.local/bin/sqlite3
$ du -sh target/release/rsqlite3
5.1M    target/release/rsqlite3
You might also like...
Sofa - CouchDB for Rust
Sofa - CouchDB for Rust

Sofa - CouchDB for Rust Documentation Here: http://docs.rs/sofa Installation [dependencies] sofa = "0.6" Description This crate is an interface to Cou

⚡🦀 🧨 make your rust types fit DynamoDB and visa versa

🦀 🧨 dynomite dynomite makes DynamoDB fit your types (and visa versa) Overview Goals ⚡ make writing dynamodb applications in rust a productive experi

A Rust client for the ElasticSearch REST API

rs-es Introduction An ElasticSearch client for Rust via the REST API. Targetting ElasticSearch 2.0 and higher. Other clients For later versions of Ela

An Elasticsearch REST API client for Rust

elastic elastic is an efficient, modular API client for Elasticsearch written in Rust. The API is targeting the Elastic Stack 7.x. elastic provides st

An etcd client library for Rust.

etcd An etcd client library for Rust. etcd on crates.io Documentation for the latest crates.io release Running the tests Install Docker and Docker Com

etcd for rust

etcd for Rust An etcd(API v3) client for Rust, and it provides async/await APIs backed by tokio and tonic. Documentation on the library can be found a

Rust bindings for LMDB

lmdb-rs Rust bindings for LMDB Documentation (master branch) Building LMDB is bundled as submodule so update submodules first: git submodule update --

The official MongoDB Rust Driver

MongoDB Rust Driver This repository contains the officially supported MongoDB Rust driver, a client side library that can be used to interact with Mon

Redis library for rust

redis-rs Redis-rs is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-lev

Owner
Manos Pitsidianakis
Electrical and Computer Engineering
Manos Pitsidianakis
SQLite3 Bindings for Rust

SQLite3 Bindings for Rust To compile use rustc src/sqlite3.rs or if you have Cargo installed cargo build. The interface is currently evolving both alo

null 74 Aug 6, 2022
Rustic bindings for sqlite3

Rust-Sqlite3 Rustic bindings for sqlite3. OBSOLETE in favor of jgallagher/rusqlite Copyright (c) 2014-2017 Dan Connolly and contributors Share and enj

Dan Connolly 57 Sep 26, 2022
PgBouncer rewritten in Rust, with sharding, load balancing and failover support

PgCat Meow. PgBouncer rewritten in Rust, with sharding, load balancing and failover support. Alpha: don't use in production just yet. Local developmen

Lev Kokotov 1.2k Jan 7, 2023
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx ?? The Rust SQL Toolkit Install | Usage | Docs Built with ❤️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

launchbadge 7.6k Dec 31, 2022
Redis re-implemented in Rust.

rsedis Redis re-implemented in Rust. Why? To learn Rust. Use Cases rsedis does not rely on UNIX-specific features. Windows users can run it as a repla

Sebastian Waisbrot 1.6k Jan 6, 2023
A generic connection pool for Rust

r2d2 A generic connection pool for Rust. Documentation Opening a new database connection every time one is needed is both inefficient and can lead to

Steven Fackler 1.2k Jan 8, 2023
An ArangoDB driver for Rust

Rincon Rincon is an ArangoDB driver for Rust. It enables low level access to ArangoDB in a typesafe and Rust idiomatic manner. The name Rincon is deri

Innoave 35 Mar 21, 2021
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. ?? Looking for an async version? async-std https://github.c

Alex Pikalov 338 Jan 1, 2023
Cassandra (CQL) driver for Rust, using the DataStax C/C++ driver under the covers.

cassandra-cpp This is a maintained Rust project that exposes the DataStax cpp driver at https://github.com/datastax/cpp-driver/ in a somewhat-sane cra

null 93 Jan 7, 2023
CouchDB client-side library for the Rust programming language

Chill Chill is a client-side CouchDB library for the Rust programming language, available on crates.io. It targets Rust Stable. Chill's three chief de

null 35 Jun 26, 2022