• Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Rust
  • Created about 3 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

sqlite3 Rewritten in RiiR Rust πŸ¦€πŸ¦€πŸ¦€ /s

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

More Repositories

1

gerb

Graphical font editor (GTK + Rust)
Rust
324
star
2

bb

simple toy process viewer in rust https://crates.io/crates/bb
Rust
223
star
3

bibliothecula

document organizer with tags and full-text-search, in a simple and clean sqlite3 schema
Python
163
star
4

rlr

interactive pixel screen ruler and protractor
Rust
59
star
5

nntpserver.py

No-dependency, single file NNTP server library for developing modern, rfc3977-compliant (bridge) NNTP servers.
Python
51
star
6

bitmappers-companion

zine/book about bitmap drawing algorithms and math with code examples in Rust
Rust
46
star
7

vfsstat.rs

Example sqlite3 Dynamic Loadable Extension in Rust - vfs and vtab modules - port of vfsstat.c
Rust
33
star
8

buke

full text search manpages
Rust
29
star
9

tade

tade is a discussion/forum/link aggregator application. It provides three interfaces: a regular web page, a mailing list bridge and an NNTP server
Python
24
star
10

kitkat

Kit-kat clock utility rewritten in Rust using minifb
Rust
19
star
11

sic

link aggregator community organised by tags (with no javascript)
Python
17
star
12

ocaml-prolog

prolog interpreter in ocaml
OCaml
7
star
13

sqlite-carelink

An sqlite3 schema for glucose sensor readings from Medtronic Minimed Carelink
Python
4
star
14

ChaucerFont

A font based on William Morris' Chaucer typeface from the Kelmscott Chaucer edition
TeX
4
star
15

anatomy-of-melancholy-latex

The 17th century book "The Anatomy Of Melancholy" by Robert Burton typeset with XeLaTeX.
TeX
3
star
16

libssg

static site generation library - make your own static site generator
Rust
2
star
17

iconbar

mirror of http://iconbar.sourceforge.net/
C
1
star
18

fantastic-rust-gtk-adventure

Rust
1
star
19

tony

Rust
1
star
20

qemu-virtio-snd

C
1
star
21

libarmv8

Rust
1
star
22

scrcpy-input.py

scrcpy doesn't support non-ascii (unicode) key input. This tool copies your input to system clipboard and then synchronises it with android's clipboard and pastes it with Alt-v command. Obviously this will overwrite your clipboard contents. Make sure you focus on the text input on the scrcpy window before you attempt to paste. (see README for demo pics)
Python
1
star