@antelopejs/interface-database 0.1.6 → 0.1.8
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 +0 -2
- package/dist/antelope.test.js +1 -1
- package/dist/atomic.d.ts +3 -37
- package/dist/atomic.js +39 -121
- package/dist/atomic.js.map +1 -1
- package/dist/common.d.ts +1 -58
- package/dist/common.js +15 -41
- package/dist/common.js.map +1 -1
- package/dist/datum.d.ts +1 -55
- package/dist/datum.js +2 -66
- package/dist/datum.js.map +1 -1
- package/dist/query.d.ts +11 -12
- package/dist/query.js +24 -22
- package/dist/query.js.map +1 -1
- package/dist/schema.d.ts +3 -120
- package/dist/schema.js +7 -88
- package/dist/schema.js.map +1 -1
- package/dist/selection.d.ts +1 -104
- package/dist/selection.js +5 -123
- package/dist/selection.js.map +1 -1
- package/dist/staged-query/atomic.d.ts +34 -0
- package/dist/staged-query/atomic.js +108 -0
- package/dist/staged-query/atomic.js.map +1 -0
- package/dist/staged-query/common.d.ts +58 -0
- package/dist/staged-query/common.js +45 -0
- package/dist/staged-query/common.js.map +1 -0
- package/dist/staged-query/datum.d.ts +55 -0
- package/dist/staged-query/datum.js +70 -0
- package/dist/staged-query/datum.js.map +1 -0
- package/dist/staged-query/index.d.ts +8 -0
- package/dist/staged-query/index.js +36 -0
- package/dist/staged-query/index.js.map +1 -0
- package/dist/staged-query/query.d.ts +3 -0
- package/dist/staged-query/query.js +9 -0
- package/dist/staged-query/query.js.map +1 -0
- package/dist/staged-query/schema.d.ts +137 -0
- package/dist/staged-query/schema.js +99 -0
- package/dist/staged-query/schema.js.map +1 -0
- package/dist/staged-query/selection.d.ts +104 -0
- package/dist/staged-query/selection.js +126 -0
- package/dist/staged-query/selection.js.map +1 -0
- package/dist/staged-query/stream.d.ts +185 -0
- package/dist/staged-query/stream.js +221 -0
- package/dist/staged-query/stream.js.map +1 -0
- package/dist/staged-query/valueproxy.d.ts +415 -0
- package/dist/staged-query/valueproxy.js +562 -0
- package/dist/staged-query/valueproxy.js.map +1 -0
- package/dist/stream.d.ts +1 -185
- package/dist/stream.js +2 -217
- package/dist/stream.js.map +1 -1
- package/dist/valueproxy.d.ts +1 -415
- package/dist/valueproxy.js +15 -559
- package/dist/valueproxy.js.map +1 -1
- package/docs/2.operations/5.indexes.md +24 -0
- package/docs/3.results/3.index_changes.md +11 -0
- package/docs/3.results/5.database_changes.md +2 -0
- package/package.json +13 -4
- package/skills/database-interface/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/interface-database",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "AntelopeJS interface for database-agnostic query operations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
"stream": [
|
|
43
43
|
"dist/stream.d.ts"
|
|
44
44
|
],
|
|
45
|
+
"staged-query": [
|
|
46
|
+
"dist/staged-query/index.d.ts"
|
|
47
|
+
],
|
|
45
48
|
"valueproxy": [
|
|
46
49
|
"dist/valueproxy.d.ts"
|
|
47
50
|
]
|
|
@@ -80,6 +83,10 @@
|
|
|
80
83
|
"types": "./dist/stream.d.ts",
|
|
81
84
|
"default": "./dist/stream.js"
|
|
82
85
|
},
|
|
86
|
+
"./staged-query": {
|
|
87
|
+
"types": "./dist/staged-query/index.d.ts",
|
|
88
|
+
"default": "./dist/staged-query/index.js"
|
|
89
|
+
},
|
|
83
90
|
"./valueproxy": {
|
|
84
91
|
"types": "./dist/valueproxy.d.ts",
|
|
85
92
|
"default": "./dist/valueproxy.js"
|
|
@@ -98,12 +105,14 @@
|
|
|
98
105
|
"prepack": "pnpm run build",
|
|
99
106
|
"release": "pnpm run lint && pnpm run prepack && release-it",
|
|
100
107
|
"test": "pnpm run build && ajs module test .",
|
|
108
|
+
"test:staged-query": "pnpm run build && node scripts/test-staged-query.cjs",
|
|
101
109
|
"format:check": "oxfmt --check .",
|
|
102
110
|
"knip": "knip"
|
|
103
111
|
},
|
|
104
112
|
"devDependencies": {
|
|
105
|
-
"@antelopejs/
|
|
106
|
-
"@antelopejs/
|
|
113
|
+
"@antelopejs/core": "^1.9.1",
|
|
114
|
+
"@antelopejs/interface-core": ">=0.1.1 <1.0.0",
|
|
115
|
+
"@antelopejs/tooling-configs": "^0.0.6",
|
|
107
116
|
"@types/chai": "^4.3.20",
|
|
108
117
|
"@types/mocha": "^10.0.10",
|
|
109
118
|
"@types/node": "^22.19.15",
|
|
@@ -123,7 +132,7 @@
|
|
|
123
132
|
"typescript": "^5.9.3"
|
|
124
133
|
},
|
|
125
134
|
"peerDependencies": {
|
|
126
|
-
"@antelopejs/interface-core": ">=0.
|
|
135
|
+
"@antelopejs/interface-core": ">=0.1.1 <1.0.0"
|
|
127
136
|
},
|
|
128
137
|
"packageManager": "pnpm@10.6.5",
|
|
129
138
|
"antelopeJs": {
|
|
@@ -89,7 +89,7 @@ for await (const change of novels.changes()) {
|
|
|
89
89
|
- **Callbacks receive `ValueProxy`, not values.** Functions passed to `filter`, `map`, `do`, `update(fn)`, `join`, `group` are recorded, then replayed by the backend. Only `ValueProxy` methods (`key`, `eq`, `ne`, `gt/ge/lt/le`, `and/or/not`, `add/sub/mul/div`, string/date/array/object helpers, `ValueProxy.constant`) become part of the query — plain JS (`if`, `===`, `Math.*`, template strings) does not travel. Exception: `group`'s mapper receives a staged `Stream` (the group's documents) as its first parameter and a `ValueProxy` (the index value) second — staged `Stream` methods also travel.
|
|
90
90
|
- **Staged objects are immutable.** Each chained call returns a new object; a prefix like `novels.getAll(true, "available")` can be safely reused for several derived queries.
|
|
91
91
|
- A provider module must be loaded in the project or startup fails with unresolved interface dependencies; queries themselves need no defensive "is the DB ready" checks (calls queue until the provider attaches).
|
|
92
|
-
- `Schema` ids are persistent: changing an id leaves previous data inaccessible. `Schema.get(id)` retrieves a previously constructed schema. `instance()` with no argument is the default instance; pass `CROSS_INSTANCE` to query across all instances.
|
|
92
|
+
- `Schema` ids are persistent: changing an id leaves previous data inaccessible. `Schema.get(id)` retrieves a previously constructed schema. `instance()` with no argument is the default instance; pass `CROSS_INSTANCE` to query across all instances. Indexes are optimized for per-instance queries; set `crossInstance: true` on the indexes that `CROSS_INSTANCE` queries use (performance only, results are unchanged).
|
|
93
93
|
- Field types are string tokens (`"string"`, `"number"`, `"boolean"`, `"date"`, `"string[]"`, nested object literals) or a single io-ts codec at the field root — codecs are not mixed inside string-tree records.
|
|
94
94
|
- Range semantics: `Table.between(index, low, high)` and `ValueProxy.during(left, right)` exclude the upper bound.
|
|
95
95
|
- `insert` accepts one document or an array, with `{ conflict: "update" | "replace" }` as options; it resolves to the inserted ids.
|