-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,39 +35,40 @@ | |
|
||
## Getting Started | ||
|
||
Installing: | ||
First, install the `limbo` command line tool: | ||
|
||
``` | ||
curl --proto '=https' --tlsv1.2 -LsSf \ | ||
https://github.com/penberg/limbo/releases/latest/download/limbo-installer.sh | sh | ||
``` | ||
|
||
Limbo is currently work-in-progress so it's recommended that you either use the `sqlite3` program to create a test database: | ||
Then use the SQL shell to create and query a database: | ||
|
||
```console | ||
$ sqlite3 database.db | ||
SQLite version 3.42.0 2023-05-16 12:36:15 | ||
$ limbo database.db | ||
Limbo v0.0.6 | ||
Enter ".help" for usage hints. | ||
sqlite> CREATE TABLE users (id INT PRIMARY KEY, username TEXT); | ||
sqlite> INSERT INTO users VALUES (1, 'alice'); | ||
sqlite> INSERT INTO users VALUES (2, 'bob'); | ||
limbo> CREATE TABLE users (id INT PRIMARY KEY, username TEXT); | ||
limbo> INSERT INTO users VALUES (1, 'alice'); | ||
limbo> INSERT INTO users VALUES (2, 'bob'); | ||
limbo> SELECT * FROM users; | ||
1|alice | ||
2|bob | ||
``` | ||
|
||
or use the testing script to generate one for you: | ||
You can also access the database from JavaScript: | ||
|
||
```console | ||
pipenv run ./testing/gen-database.py | ||
``` | ||
```js | ||
import { Database } from 'limbo-wasm'; | ||
|
||
You can then start the Limbo shell with: | ||
const db = new Database('hello.db'); | ||
|
||
```console | ||
$ limbo database.db | ||
Welcome to Limbo SQL shell! | ||
> SELECT * FROM users LIMIT 1; | ||
|1|Cody|Miller|[email protected]|525.595.7319x21268|33667 Shaw Extension Suite 104|West Robert|VA|45161|` | ||
``` | ||
const stmt = db.prepare('SELECT * FROM users'); | ||
|
||
const users = stmt.all(); | ||
|
||
console.log(users); | ||
``` | ||
## Developing | ||
|
||
Run tests: | ||
|