https://github.com/chromy/crunch
sqlite3 compiled to WASM for the browser and server
https://github.com/chromy/crunch
sql sqlite sqlite3 wasm webassembly
Last synced: 10 months ago
JSON representation
sqlite3 compiled to WASM for the browser and server
- Host: GitHub
- URL: https://github.com/chromy/crunch
- Owner: chromy
- License: mit
- Created: 2019-05-05T14:46:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T13:23:26.000Z (over 4 years ago)
- Last Synced: 2025-04-03T19:51:21.367Z (10 months ago)
- Topics: sql, sqlite, sqlite3, wasm, webassembly
- Language: Python
- Homepage: http://crunch.tsundoku.io
- Size: 54.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Crunch
sqlite3 compiled to WASM with Javascript bindings.
For the browser and the server.
```
$ node -e "require('repl').start({ignoreUndefined: true})" --experimental-repl-await
> const {createEngine} = require('@tsundoku/crunch');
> const engine = await createEngine();
> const db = await engine.open();
> db.exec('CREATE TABLE peaks (name TEXT, m INTEGER)');
> db.exec('INSERT INTO peaks (name, m) VALUES ("Olympus Mons", 21171)');
> [...db.query('SELECT * FROM peaks')];
[ { name: 'Olympus Mons', m: 21171 } ]
```
## Setup
```
$ git clone https://github.com/chromy/crunch.git
$ cd crunch
$ tools/deps
$ tools/gen out
$ tools/deps/ninja -C out
```
## Build
```
$ tools/deps/ninja -C out
```
## Test
```
$ tools/test
```