Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed Nov 20, 2024
1 parent fc07445 commit c4d4136
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c4d4136

Please sign in to comment.