@antelopejs/interface-database 0.1.4 → 0.1.5

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 (71) hide show
  1. package/dist/antelope.test.js +2 -2
  2. package/dist/antelope.test.js.map +1 -1
  3. package/dist/atomic.d.ts +41 -0
  4. package/dist/atomic.js +135 -0
  5. package/dist/atomic.js.map +1 -0
  6. package/dist/common.js.map +1 -1
  7. package/dist/datum.d.ts +2 -2
  8. package/dist/datum.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +15 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/query.js +1 -1
  13. package/dist/query.js.map +1 -1
  14. package/dist/schema.d.ts +1 -1
  15. package/dist/schema.js +1 -1
  16. package/dist/schema.js.map +1 -1
  17. package/dist/selection.d.ts +4 -1
  18. package/dist/selection.js +7 -0
  19. package/dist/selection.js.map +1 -1
  20. package/dist/stream.d.ts +1 -1
  21. package/dist/stream.js.map +1 -1
  22. package/dist/tests/aggregation_operations.test.js +1 -1
  23. package/dist/tests/aggregation_operations.test.js.map +1 -1
  24. package/dist/tests/atomic_mutation.test.d.ts +1 -0
  25. package/dist/tests/atomic_mutation.test.js +185 -0
  26. package/dist/tests/atomic_mutation.test.js.map +1 -0
  27. package/dist/tests/basic_operations.test.js +1 -1
  28. package/dist/tests/basic_operations.test.js.map +1 -1
  29. package/dist/tests/between_operations.test.js +1 -1
  30. package/dist/tests/between_operations.test.js.map +1 -1
  31. package/dist/tests/change_feeds.test.js +1 -1
  32. package/dist/tests/change_feeds.test.js.map +1 -1
  33. package/dist/tests/datasets/codec_fields.js.map +1 -1
  34. package/dist/tests/date_operations.test.js +1 -1
  35. package/dist/tests/date_operations.test.js.map +1 -1
  36. package/dist/tests/do_operations.test.js +1 -1
  37. package/dist/tests/do_operations.test.js.map +1 -1
  38. package/dist/tests/filters.test.js +1 -1
  39. package/dist/tests/filters.test.js.map +1 -1
  40. package/dist/tests/group_operations.test.js +1 -1
  41. package/dist/tests/group_operations.test.js.map +1 -1
  42. package/dist/tests/instance_modes.test.js +1 -1
  43. package/dist/tests/instance_modes.test.js.map +1 -1
  44. package/dist/tests/joins.test.js +2 -2
  45. package/dist/tests/joins.test.js.map +1 -1
  46. package/dist/tests/lookup_operations.test.js +2 -2
  47. package/dist/tests/lookup_operations.test.js.map +1 -1
  48. package/dist/tests/merge_operations.test.js +2 -2
  49. package/dist/tests/merge_operations.test.js.map +1 -1
  50. package/dist/tests/sorting.test.js +1 -1
  51. package/dist/tests/sorting.test.js.map +1 -1
  52. package/dist/tests/union_operations.test.js +2 -2
  53. package/dist/tests/union_operations.test.js.map +1 -1
  54. package/docs/1.query_types/2.table.md +10 -4
  55. package/docs/1.query_types/3.selection.md +15 -17
  56. package/docs/1.query_types/5.stream.md +2 -5
  57. package/docs/1.query_types/6.feed.md +1 -1
  58. package/docs/1.query_types/9.valueproxy.md +43 -41
  59. package/docs/2.operations/2.database_management.md +2 -2
  60. package/docs/2.operations/3.table_operations.md +1 -1
  61. package/docs/2.operations/4.crud.md +1 -2
  62. package/docs/2.operations/5.indexes.md +4 -4
  63. package/docs/2.operations/6.filtering.md +23 -27
  64. package/docs/2.operations/7.lookup.md +13 -15
  65. package/docs/2.operations/8.atomic_mutations.md +71 -0
  66. package/docs/3.results/3.index_changes.md +9 -5
  67. package/docs/3.results/4.table_changes.md +3 -3
  68. package/docs/3.results/6.value_changes.md +5 -5
  69. package/docs/index.md +1 -0
  70. package/package.json +55 -40
  71. package/skills/database-interface/SKILL.md +41 -7
@@ -13,10 +13,34 @@ AQL is a lazy, chainable query builder. Every class here (`Schema`, `Table`, `Se
13
13
 
14
14
  ```ts
15
15
  // Root re-exports everything most consumers need:
16
- import { Schema, SchemaInstance, SchemaDefinition, Table, Selection, SingleSelection, Stream, Datum, Query, ValueProxy, ValueProxyOrValue, InstanceId, CROSS_INSTANCE } from "@antelopejs/interface-database";
16
+ import {
17
+ Schema,
18
+ SchemaInstance,
19
+ SchemaDefinition,
20
+ Table,
21
+ Selection,
22
+ SingleSelection,
23
+ Stream,
24
+ Datum,
25
+ Query,
26
+ ValueProxy,
27
+ ValueProxyOrValue,
28
+ InstanceId,
29
+ CROSS_INSTANCE,
30
+ } from "@antelopejs/interface-database";
17
31
  // Types only available via subpath (not re-exported at root):
18
- import { TableDefinition, IndexDefinition, FieldType } from "@antelopejs/interface-database/schema";
19
- import { Changes, DeepPartial, InsertOptions, Value, ExtractType } from "@antelopejs/interface-database/common";
32
+ import {
33
+ TableDefinition,
34
+ IndexDefinition,
35
+ FieldType,
36
+ } from "@antelopejs/interface-database/schema";
37
+ import {
38
+ Changes,
39
+ DeepPartial,
40
+ InsertOptions,
41
+ Value,
42
+ ExtractType,
43
+ } from "@antelopejs/interface-database/common";
20
44
  // Each root symbol is also importable from its own subpath (/schema, /selection, /stream, /datum, /query, /valueproxy) — equivalent alternatives, do not combine with the root import for the same symbol.
21
45
  ```
22
46
 
@@ -27,7 +51,12 @@ Add `@antelopejs/interface-database` to the module's `dependencies`; `@antelopej
27
51
  ```ts
28
52
  import { Schema } from "@antelopejs/interface-database";
29
53
 
30
- interface Novel { _id?: string; title: string; pageCount: number; available: boolean; }
54
+ interface Novel {
55
+ _id?: string;
56
+ title: string;
57
+ pageCount: number;
58
+ available: boolean;
59
+ }
31
60
 
32
61
  // Registers the schema with the provider. The generic maps table names to row types.
33
62
  const schema = new Schema<{ novels: Novel }>("library", {
@@ -39,12 +68,17 @@ const schema = new Schema<{ novels: Novel }>("library", {
39
68
 
40
69
  const novels = schema.instance().table("novels"); // default instance
41
70
 
42
- const ids = await novels.insert({ title: "The Glass Meridian", pageCount: 412, available: true }); // string[] of inserted ids
71
+ const ids = await novels.insert({
72
+ title: "The Glass Meridian",
73
+ pageCount: 412,
74
+ available: true,
75
+ }); // string[] of inserted ids
43
76
  const longNovels = await novels
44
77
  .filter((n) => n.key("pageCount").ge(300).and(n.key("available")))
45
- .orderBy("pageCount", "desc"); // await executes: Novel[]
78
+ .orderBy("pageCount", "desc"); // await executes: Novel[]
46
79
  await novels.get(ids[0]).update({ available: false }); // number of modified docs
47
- for await (const change of novels.changes()) { // change feed via async iteration
80
+ for await (const change of novels.changes()) {
81
+ // change feed via async iteration
48
82
  console.log(change.changeType, change.newValue); // "added" | "removed" | "modified"
49
83
  }
50
84
  ```