Skip to content

Commit e3521df

Browse files
authored
Update README.md
1 parent 8d2d87d commit e3521df

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,21 @@ While it can run any query asychronously, it currently only supports the followi
2626

2727
## Queries
2828

29+
### Base Options
30+
`{ file?: string, table?: string }`
31+
32+
Any query can be run with the `file` option, which represents the relative path to a database file. The database will be accessed dynamically during the query and will only remain open until its resolution. This is ideal for avoiding the clutter of synchronously accessing a database when only a single query needs to be run.
33+
34+
```javascript
35+
// No need to call db.open('./database.db') or db.close(). This query will handle that itself!
36+
const data = await db.select({ file: './database.db', all: true, from: 'table' });
37+
```
38+
2939
### Insert
30-
`insert({ table: string, columns?: string[], values: string[] })`
40+
`insert({ into: string, columns?: string[], values: string[] })`
3141
```javascript
32-
const id = '123456789';
33-
const username = 'user99';
42+
var id = '123456789';
43+
var username = 'user99';
3444

3545
await db.insert({
3646
table: 'users',
@@ -42,7 +52,7 @@ await db.insert({
4252
### Select
4353
### Update
4454
### Delete
45-
### Run
55+
4656
## Expressions
4757
- Boolean
4858
- Aggregate

0 commit comments

Comments
 (0)