@antelopejs/interface-database 0.1.8 → 0.1.10

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 (57) hide show
  1. package/README.md +89 -14
  2. package/dist/datum.d.ts +1 -1
  3. package/dist/datum.js +2 -1
  4. package/dist/datum.js.map +1 -1
  5. package/dist/index.d.ts +4 -4
  6. package/dist/index.js +5 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/query.d.ts +1 -0
  9. package/dist/query.js +3 -1
  10. package/dist/query.js.map +1 -1
  11. package/dist/staged-query/datum.d.ts +10 -0
  12. package/dist/staged-query/datum.js +16 -0
  13. package/dist/staged-query/datum.js.map +1 -1
  14. package/dist/staged-query/index.d.ts +4 -4
  15. package/dist/staged-query/index.js +5 -1
  16. package/dist/staged-query/index.js.map +1 -1
  17. package/dist/staged-query/kind.d.ts +2 -0
  18. package/dist/staged-query/kind.js +13 -0
  19. package/dist/staged-query/kind.js.map +1 -0
  20. package/dist/staged-query/query.d.ts +10 -0
  21. package/dist/staged-query/query.js +16 -0
  22. package/dist/staged-query/query.js.map +1 -1
  23. package/dist/staged-query/schema.js +1 -1
  24. package/dist/staged-query/schema.js.map +1 -1
  25. package/dist/staged-query/stream.d.ts +10 -0
  26. package/dist/staged-query/stream.js +16 -0
  27. package/dist/staged-query/stream.js.map +1 -1
  28. package/dist/staged-query/valueproxy.d.ts +10 -0
  29. package/dist/staged-query/valueproxy.js +16 -0
  30. package/dist/staged-query/valueproxy.js.map +1 -1
  31. package/dist/stream.d.ts +1 -1
  32. package/dist/stream.js +2 -1
  33. package/dist/stream.js.map +1 -1
  34. package/dist/tests/cross_instance.test.d.ts +1 -0
  35. package/dist/tests/cross_instance.test.js +80 -0
  36. package/dist/tests/cross_instance.test.js.map +1 -0
  37. package/dist/tests/helpers/other-instance.d.ts +13 -0
  38. package/dist/tests/helpers/other-instance.js +46 -0
  39. package/dist/tests/helpers/other-instance.js.map +1 -0
  40. package/docs/1.query_types/1.index.md +14 -0
  41. package/docs/1.query_types/2.table.md +8 -0
  42. package/docs/1.query_types/4.single_selection.md +3 -3
  43. package/docs/1.query_types/5.stream.md +5 -1
  44. package/docs/1.query_types/6.feed.md +29 -22
  45. package/docs/1.query_types/7.query.md +2 -0
  46. package/docs/1.query_types/8.datum.md +8 -5
  47. package/docs/1.query_types/9.valueproxy.md +2 -0
  48. package/docs/2.operations/1.index.md +1 -0
  49. package/docs/2.operations/2.database_management.md +7 -4
  50. package/docs/2.operations/3.table_operations.md +28 -5
  51. package/docs/2.operations/7.lookup.md +16 -9
  52. package/docs/3.results/4.table_changes.md +3 -2
  53. package/docs/3.results/6.value_changes.md +2 -6
  54. package/docs/index.md +8 -0
  55. package/docs/tsconfig.json +14 -0
  56. package/package.json +13 -7
  57. package/skills/database-interface/SKILL.md +5 -0
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "@antelopejs/interface-database",
3
- "version": "0.1.8",
4
- "description": "AntelopeJS interface for database-agnostic query operations",
3
+ "version": "0.1.10",
4
+ "description": "AQL, the AntelopeJS database-agnostic query builder: schemas, CRUD, joins, aggregations and change feeds",
5
5
  "keywords": [
6
6
  "antelopejs",
7
+ "aql",
7
8
  "database",
8
- "interface"
9
+ "interface",
10
+ "query-builder"
9
11
  ],
12
+ "homepage": "https://interfaces.antelopejs.com/docs/database",
13
+ "bugs": {
14
+ "url": "https://github.com/AntelopeJS/interface-database/issues"
15
+ },
10
16
  "license": "Apache-2.0",
11
17
  "repository": {
12
18
  "type": "git",
@@ -110,9 +116,9 @@
110
116
  "knip": "knip"
111
117
  },
112
118
  "devDependencies": {
113
- "@antelopejs/core": "^1.9.1",
114
- "@antelopejs/interface-core": ">=0.1.1 <1.0.0",
115
- "@antelopejs/tooling-configs": "^0.0.6",
119
+ "@antelopejs/core": "^1.16.0",
120
+ "@antelopejs/interface-core": ">=0.2.4 <1.0.0",
121
+ "@antelopejs/tooling-configs": "^0.0.9",
116
122
  "@types/chai": "^4.3.20",
117
123
  "@types/mocha": "^10.0.10",
118
124
  "@types/node": "^22.19.15",
@@ -132,7 +138,7 @@
132
138
  "typescript": "^5.9.3"
133
139
  },
134
140
  "peerDependencies": {
135
- "@antelopejs/interface-core": ">=0.1.1 <1.0.0"
141
+ "@antelopejs/interface-core": ">=0.2.4 <1.0.0"
136
142
  },
137
143
  "packageManager": "pnpm@10.6.5",
138
144
  "antelopeJs": {
@@ -27,6 +27,10 @@ import {
27
27
  ValueProxyOrValue,
28
28
  InstanceId,
29
29
  CROSS_INSTANCE,
30
+ IsQuery,
31
+ IsDatum,
32
+ IsStream,
33
+ IsValueProxy,
30
34
  } from "@antelopejs/interface-database";
31
35
  // Types only available via subpath (not re-exported at root):
32
36
  import {
@@ -91,6 +95,7 @@ for await (const change of novels.changes()) {
91
95
  - 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
96
  - `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
97
  - 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.
98
+ - **Recognize query kinds with `IsStream`/`IsDatum`/`IsQuery`/`IsValueProxy`, not `instanceof`,** when the object may come from another module. Each provider binding has its own copy of the classes, so `instanceof` is false for a query built by a module bound to another database; the predicates are not. `CROSS_INSTANCE` is the same value in every copy.
94
99
  - Range semantics: `Table.between(index, low, high)` and `ValueProxy.during(left, right)` exclude the upper bound.
95
100
  - `insert` accepts one document or an array, with `{ conflict: "update" | "replace" }` as options; it resolves to the inserted ids.
96
101
  - `cast<U>()` on `Datum`/`Stream`/`ValueProxy` only changes the TypeScript type — no runtime conversion.