Skip to content

Commit 0434fc4

Browse files
committed
Add readme.
1 parent 023b520 commit 0434fc4

File tree

7 files changed

+90
-15
lines changed

7 files changed

+90
-15
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# sqlite-js
2+
3+
Universal SQLite APIs for JavaScript.
4+
5+
## @sqlite-js/driver
6+
7+
This is a universal driver API and utilities for implementing drivers.
8+
9+
The APIs here are low-level, and should not be used directly in most use cases.
10+
11+
### @sqlite-js/driver/node
12+
13+
This is a driver implementation for NodeJS based on the experimental `node:sqlite` package.
14+
15+
## @sqlite-js/better-sqlite3-driver
16+
17+
This is a driver implementation for NodeJS implementation based `better-sqlite3`.
18+
19+
## @sqlite-js/api
20+
21+
This contains a higher-level API, including transaction support.

packages/api/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @sqlite-js/api
2+
3+
This provides higher-level SQLite APIs, built on the lower-level driver APIs.
4+
5+
This supports:
6+
7+
1. Simple asynchronous queries.
8+
2. Transactions.
9+
3. Connection-level locking.
10+
4. Pipelining operations.
11+
5. Re-using prepared statements.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# @sqlite-js/better-sqlite3-driver
2+
3+
This contains a driver implementation based on better-sqlite3.
4+
5+
There are two main options for using the driver:
6+
7+
```ts
8+
const driver = BetterSqliteDriver.open(path);
9+
```
10+
11+
This opens a connection pool using worker_threads, giving asynchronous I/O.
12+
13+
```ts
14+
const driver = BetterSqliteDriver.openInProcess(path);
15+
```
16+
17+
This opens a single in-process connection, with blocking I/O. This can give lower latency and higher throughput, at the cost of blocking the process and not supporting concurrent operations.

packages/driver-tests/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @sqlite-js/driver-tests
2+
3+
This package contains a standard test suite to test any driver.
4+
5+
The tests can run under vitest or mocha.

packages/driver/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# @sqlite-js/driver
2+
3+
This contains a driver API, as well as driver utilities.
4+
5+
## @sqlite-js/driver
6+
7+
The main export contains the driver API. The API is centered around connection pooling and prepared statements.
8+
9+
## @sqlite-js/driver/node
10+
11+
This is a driver implementation for NodeJS based on the experimental `node:sqlite` package.
12+
13+
There are two main options for using the driver:
14+
15+
```ts
16+
const driver = NodeSqliteDriver.open(path);
17+
```
18+
19+
This opens a connection pool using worker_threads, giving asynchronous I/O.
20+
21+
```ts
22+
const driver = NodeSqliteDriver.openInProcess(path);
23+
```
24+
25+
This opens a single in-process connection, with blocking I/O. This can give lower latency and higher throughput, at the cost of blocking the process and not supporting concurrent operations.
26+
27+
## @sqlite-js/driver/util
28+
29+
This contains utilities for driver implementations, such as connection pooling.
30+
31+
## @sqlite-js/driver/worker_threads
32+
33+
This contains utilities for running a driver implementation in a NodeJS worker_thread, to get non-blocking I/O.
34+
35+
The APIs here are not stable, and expected to change.

packages/driver/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
"keywords": [],
1919
"author": "",
2020
"license": "MIT",
21-
"dependencies": {
22-
"vitest": "^2.0.5",
23-
"mocha": "^10.7.3",
24-
"@sqlite-js/driver": "workspace:^"
25-
},
21+
"dependencies": {},
2622
"devDependencies": {
2723
"@types/node": "^22.3.0",
2824
"typescript": "^5.5.4"

pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)