@plurnk/plurnk-execs-sqlite 1.19.3 → 1.21.0
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 +6 -6
- package/docs/sqlite.md +2 -2
- package/package.json +78 -79
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@ A `@plurnk/plurnk-execs-*` sibling built on the [plurnk-execs](https://github.co
|
|
|
14
14
|
|
|
15
15
|
The execution's target slot is the database file; with no target it defaults to an ephemeral in-memory db:
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```sqlite
|
|
18
18
|
SELECT 1 AS value;
|
|
19
|
-
|
|
19
|
+
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
```sqlite (./app.db)
|
|
22
22
|
SELECT name FROM sqlite_master WHERE type = 'table';
|
|
23
|
-
|
|
23
|
+
```
|
|
24
24
|
|
|
25
25
|
With no target, a fresh `:memory:` database exists for that operation only.
|
|
26
26
|
State does not persist across EXECs. Pass a file path for persistence.
|
|
@@ -29,9 +29,9 @@ State does not persist across EXECs. Pass a file path for persistence.
|
|
|
29
29
|
|
|
30
30
|
With no target, `:memory:` is a scratch calculator over ad-hoc tables — build one inline with `VALUES` and aggregate, no schema or file needed:
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
```sqlite
|
|
33
33
|
WITH t(item,qty,price) AS (VALUES ('a',3,2),('b',1,5)) SELECT sum(qty*price) AS total, sum(qty*price)*1.0/sum(qty) AS avg_price FROM t;
|
|
34
|
-
|
|
34
|
+
```
|
|
35
35
|
|
|
36
36
|
**Use floats to avoid integer truncation.** SQLite integer division truncates — `11/4` → `2`. Multiply by `1.0` (or `CAST(x AS REAL)`) to force real division: `11*1.0/4` → `2.75`. Any division over integer columns needs this, or the result is silently floored.
|
|
37
37
|
|
package/docs/sqlite.md
CHANGED
|
@@ -11,9 +11,9 @@ than SQL. Use their SQL equivalents, such as querying `sqlite_master`.
|
|
|
11
11
|
## Database target
|
|
12
12
|
|
|
13
13
|
`sqlite (./app.db)` with a SQL body runs against the file `./app.db` (created if absent),
|
|
14
|
-
a persistent host-mutating database
|
|
14
|
+
a persistent host-mutating database: a host effect, admitted under the loop's policy. With no
|
|
15
15
|
target, it runs against a fresh `:memory:` database that is gone when the
|
|
16
|
-
operation finishes and
|
|
16
|
+
operation finishes and is not a host effect. A directory is not a database.
|
|
17
17
|
Use `[{"cwd": "./data"}]` on the heading to set the base for a relative database path;
|
|
18
18
|
it does not change whether the operation uses a file or memory.
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,82 +1,81 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
"name": "@plurnk/plurnk-execs-sqlite",
|
|
3
|
+
"version": "1.21.0",
|
|
4
|
+
"description": "SQLite runtime executor for plurnk-service's exec scheme — runs the sqlite runtime tag in-process via node:sqlite, results as application/json.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"plurnk",
|
|
7
|
+
"exec",
|
|
8
|
+
"runtime",
|
|
9
|
+
"executor",
|
|
10
|
+
"sqlite",
|
|
11
|
+
"sql"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/plurnk/plurnk-service/tree/main/plurnk-execs-sqlite#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://repo.possumtech.com/plurnk/plurnk-service/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/plurnk/plurnk-service.git",
|
|
20
|
+
"directory": "plurnk-execs-sqlite"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=26"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "@wikitopian",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"plurnk": {
|
|
32
|
+
"kind": "exec",
|
|
33
|
+
"runtimes": [
|
|
34
|
+
{
|
|
35
|
+
"name": "sqlite",
|
|
36
|
+
"glyph": "🗃",
|
|
37
|
+
"summary": "Run one SQL statement against SQLite.",
|
|
38
|
+
"invocation": {
|
|
39
|
+
"body": {
|
|
40
|
+
"role": "SQL statement",
|
|
41
|
+
"required": true
|
|
42
|
+
},
|
|
43
|
+
"target": {
|
|
44
|
+
"role": "SQLite database",
|
|
45
|
+
"required": false,
|
|
46
|
+
"kind": "path"
|
|
47
|
+
},
|
|
48
|
+
"example": {
|
|
49
|
+
"target": "app.db",
|
|
50
|
+
"body": "SELECT 1;"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"exports": {
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"default": "./dist/index.js"
|
|
16
60
|
},
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"summary": "Run one SQL statement against SQLite.",
|
|
38
|
-
"invocation": {
|
|
39
|
-
"body": {
|
|
40
|
-
"role": "SQL statement",
|
|
41
|
-
"required": true
|
|
42
|
-
},
|
|
43
|
-
"target": {
|
|
44
|
-
"role": "SQLite database",
|
|
45
|
-
"required": false,
|
|
46
|
-
"kind": "path"
|
|
47
|
-
},
|
|
48
|
-
"example": {
|
|
49
|
-
"target": "app.db",
|
|
50
|
-
"body": "SELECT 1;"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
"exports": {
|
|
57
|
-
".": {
|
|
58
|
-
"plurnk-dev": "./src/index.ts",
|
|
59
|
-
"types": "./dist/index.d.ts",
|
|
60
|
-
"default": "./dist/index.js"
|
|
61
|
-
},
|
|
62
|
-
"./package.json": "./package.json"
|
|
63
|
-
},
|
|
64
|
-
"files": [
|
|
65
|
-
"dist/**/*",
|
|
66
|
-
"README.md",
|
|
67
|
-
"docs/**/*"
|
|
68
|
-
],
|
|
69
|
-
"scripts": {
|
|
70
|
-
"test:lint": "tsc --noEmit",
|
|
71
|
-
"test:unit": "node --conditions=plurnk-dev --env-file-if-exists=../plurnk-execs/.env.defaults --test \"src/**/*.test.ts\"",
|
|
72
|
-
"test": "npm run test:lint && npm run test:unit",
|
|
73
|
-
"build:clean": "rm -rf dist",
|
|
74
|
-
"build:dist": "tsc -p tsconfig.build.json",
|
|
75
|
-
"build": "npm run build:clean && npm run build:dist",
|
|
76
|
-
"prepack": "npm run build",
|
|
77
|
-
"prepublishOnly": "npm audit --audit-level=moderate && npm test"
|
|
78
|
-
},
|
|
79
|
-
"peerDependencies": {
|
|
80
|
-
"@plurnk/plurnk-execs": "^1.19.3"
|
|
81
|
-
}
|
|
61
|
+
"./package.json": "./package.json"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist/**/*",
|
|
65
|
+
"README.md",
|
|
66
|
+
"docs/**/*"
|
|
67
|
+
],
|
|
68
|
+
"scripts": {
|
|
69
|
+
"test:lint": "tsc --noEmit",
|
|
70
|
+
"test:unit": "node --conditions=plurnk-dev --env-file-if-exists=../plurnk-execs/.env.defaults --test \"src/**/*.test.ts\"",
|
|
71
|
+
"test": "npm run test:lint && npm run test:unit",
|
|
72
|
+
"build:clean": "rm -rf dist",
|
|
73
|
+
"build:dist": "tsc -p tsconfig.build.json",
|
|
74
|
+
"build": "npm run build:clean && npm run build:dist",
|
|
75
|
+
"prepack": "npm run build",
|
|
76
|
+
"prepublishOnly": "npm audit --audit-level=moderate && npm test"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@plurnk/plurnk-execs": "^1.21.0"
|
|
80
|
+
}
|
|
82
81
|
}
|