@quatrain/backend-sqlite 1.0.11 → 1.0.13

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.
Files changed (2) hide show
  1. package/README.md +20 -10
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,26 +1,36 @@
1
1
  # @quatrain/backend-sqlite
2
2
 
3
- A backend adapter for SQLite. This package is perfect for local development, testing, and small-scale applications that require a simple, file-based database.
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
- ## Features
5
+ ## Introduction
6
6
 
7
- - Implements the `@quatrain/backend` abstract adapter.
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 better-sqlite3
12
+ npm install @quatrain/backend-sqlite sqlite3
13
+ # or
14
+ yarn add @quatrain/backend-sqlite sqlite3
16
15
  ```
17
16
 
18
- ## Usage
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 adapter = new SqliteAdapter({ config: { filename: './dev.db' } })
25
- Backend.addAdapter(adapter, 'default', true)
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
+ ## License
35
+
36
+ AGPL-3.0-only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/backend-sqlite",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
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.33",
18
- "@quatrain/core": "^1.1.47",
17
+ "@quatrain/backend": "^1.1.34",
18
+ "@quatrain/core": "^1.1.48",
19
19
  "sqlite": "^5.1.1",
20
20
  "sqlite3": "^5.1.7"
21
21
  },