@quatrain/backend-sqlite 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
# @quatrain/backend-sqlite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The SQLite adapter for `@quatrain/backend`. This package allows Quatrain business objects to be persisted locally in a lightweight, file-based SQL database.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Introduction
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Zero-configuration setup for rapid development.
|
|
9
|
-
- Stores the entire database in a single file.
|
|
10
|
-
- Uses the `better-sqlite3` library for performance.
|
|
7
|
+
SQLite is perfect for local development, testing, CLI tools, or mobile/desktop applications built with Node.js/Electron. This adapter translates Quatrain models into local SQLite tables and queries.
|
|
11
8
|
|
|
12
9
|
## Installation
|
|
13
10
|
|
|
14
11
|
```bash
|
|
15
|
-
npm install @quatrain/backend-sqlite
|
|
12
|
+
npm install @quatrain/backend-sqlite sqlite3
|
|
13
|
+
# or
|
|
14
|
+
yarn add @quatrain/backend-sqlite sqlite3
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
##
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Register the adapter with the path to your `.sqlite` file. If the file does not exist, it will be created automatically.
|
|
19
20
|
|
|
20
21
|
```typescript
|
|
21
22
|
import { Backend } from '@quatrain/backend'
|
|
22
23
|
import { SqliteAdapter } from '@quatrain/backend-sqlite'
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
-
|
|
25
|
+
const sqliteAdapter = new SqliteAdapter({
|
|
26
|
+
config: {
|
|
27
|
+
filename: './data/database.sqlite'
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
Backend.addAdapter('sqlite', sqliteAdapter, true)
|
|
26
32
|
```
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
For concrete examples and usage guides, please refer to the [How-To Guide](HOWTO.md).
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
AGPL-3.0-only
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/backend-sqlite",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"description": "Backend adapter for SQLite",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"author": "Quatrain Développement SAS <developers@quatrain.com>",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@quatrain/backend": "^1.1.
|
|
18
|
-
"@quatrain/core": "^1.1.
|
|
17
|
+
"@quatrain/backend": "^1.1.35",
|
|
18
|
+
"@quatrain/core": "^1.1.49",
|
|
19
19
|
"sqlite": "^5.1.1",
|
|
20
20
|
"sqlite3": "^5.1.7"
|
|
21
21
|
},
|