@based/db 0.0.18 → 0.0.19

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 (98) hide show
  1. package/dist/lib/darwin_aarch64/include/selva/fields.h +0 -7
  2. package/dist/lib/darwin_aarch64/libnode-v20.11.1.node +0 -0
  3. package/dist/lib/darwin_aarch64/libnode-v20.18.1.node +0 -0
  4. package/dist/lib/darwin_aarch64/libnode-v22.13.0.node +0 -0
  5. package/dist/lib/darwin_aarch64/libselva.dylib +0 -0
  6. package/dist/lib/linux_aarch64/include/selva/fields.h +0 -7
  7. package/dist/lib/linux_aarch64/libjemalloc_selva.so.2 +0 -0
  8. package/dist/lib/linux_aarch64/libnode-v20.11.1.node +0 -0
  9. package/dist/lib/linux_aarch64/libnode-v20.18.1.node +0 -0
  10. package/dist/lib/linux_aarch64/libnode-v22.13.0.node +0 -0
  11. package/dist/lib/linux_aarch64/libselva.so +0 -0
  12. package/dist/lib/linux_x86_64/include/selva/fields.h +0 -7
  13. package/dist/lib/linux_x86_64/libjemalloc_selva.so.2 +0 -0
  14. package/dist/lib/linux_x86_64/libnode-v20.11.1.node +0 -0
  15. package/dist/lib/linux_x86_64/libnode-v20.18.1.node +0 -0
  16. package/dist/lib/linux_x86_64/libnode-v22.13.0.node +0 -0
  17. package/dist/lib/linux_x86_64/libselva.so +0 -0
  18. package/dist/src/client/index.d.ts +1 -1
  19. package/dist/src/client/index.js +8 -3
  20. package/dist/src/client/modify/ModifyRes.d.ts +1 -1
  21. package/dist/src/client/modify/ModifyRes.js +1 -1
  22. package/dist/src/client/modify/alias.d.ts +1 -1
  23. package/dist/src/client/modify/binary.d.ts +1 -1
  24. package/dist/src/client/modify/cardinality.d.ts +1 -1
  25. package/dist/src/client/modify/cardinality.js +1 -1
  26. package/dist/src/client/modify/create.js +2 -2
  27. package/dist/src/client/modify/delete.js +1 -1
  28. package/dist/src/client/modify/expire.js +1 -1
  29. package/dist/src/client/modify/fixed.d.ts +1 -1
  30. package/dist/src/client/modify/fixed.js +1 -1
  31. package/dist/src/client/modify/json.d.ts +1 -1
  32. package/dist/src/client/modify/modify.d.ts +1 -1
  33. package/dist/src/client/modify/modify.js +1 -1
  34. package/dist/src/client/modify/references/edge.d.ts +1 -1
  35. package/dist/src/client/modify/references/edge.js +1 -1
  36. package/dist/src/client/modify/references/reference.d.ts +1 -1
  37. package/dist/src/client/modify/references/references.d.ts +1 -1
  38. package/dist/src/client/modify/references/references.js +1 -1
  39. package/dist/src/client/modify/setCursor.d.ts +1 -1
  40. package/dist/src/client/modify/string.d.ts +1 -1
  41. package/dist/src/client/modify/text.d.ts +1 -1
  42. package/dist/src/client/modify/text.js +6 -0
  43. package/dist/src/client/modify/update.js +1 -1
  44. package/dist/src/client/modify/upsert.js +1 -1
  45. package/dist/src/client/modify/vector.d.ts +1 -1
  46. package/dist/src/client/operations.d.ts +2 -1
  47. package/dist/src/client/operations.js +1 -0
  48. package/dist/src/client/query/BasedDbQuery.js +1 -1
  49. package/dist/src/client/query/debug.js +1 -1
  50. package/dist/src/client/query/display.d.ts +1 -1
  51. package/dist/src/client/query/display.js +1 -1
  52. package/dist/src/client/query/filter/createFixedFilterBuffer.d.ts +1 -1
  53. package/dist/src/client/query/filter/createFixedFilterBuffer.js +1 -2
  54. package/dist/src/client/query/filter/createReferenceFilter.d.ts +1 -1
  55. package/dist/src/client/query/filter/createVariableFilterBuffer.d.ts +1 -1
  56. package/dist/src/client/query/filter/createVariableFilterBuffer.js +1 -1
  57. package/dist/src/client/query/filter/filter.d.ts +1 -1
  58. package/dist/src/client/query/filter/filter.js +1 -1
  59. package/dist/src/client/query/filter/parseFilterValue.d.ts +1 -1
  60. package/dist/src/client/query/filter/parseFilterValue.js +1 -1
  61. package/dist/src/client/query/filter/primitiveFilter.d.ts +1 -1
  62. package/dist/src/client/query/filter/primitiveFilter.js +4 -1
  63. package/dist/src/client/query/include/props.d.ts +1 -1
  64. package/dist/src/client/query/include/props.js +1 -1
  65. package/dist/src/client/query/include/utils.d.ts +1 -1
  66. package/dist/src/client/query/include/utils.js +1 -1
  67. package/dist/src/client/query/include/walk.js +1 -1
  68. package/dist/src/client/query/read/read.js +1 -1
  69. package/dist/src/client/query/search/index.js +1 -1
  70. package/dist/src/client/query/subscription/markers.d.ts +1 -1
  71. package/dist/src/client/query/types.d.ts +1 -1
  72. package/dist/src/client/query/validation.d.ts +1 -1
  73. package/dist/src/client/query/validation.js +9 -8
  74. package/dist/src/index.d.ts +0 -1
  75. package/dist/src/index.js +0 -1
  76. package/dist/src/server/index.d.ts +3 -5
  77. package/dist/src/server/index.js +11 -5
  78. package/dist/src/server/migrate/worker.js +1 -1
  79. package/dist/src/server/start.d.ts +0 -1
  80. package/dist/src/server/start.js +1 -1
  81. package/dist/src/server/tree.d.ts +1 -1
  82. package/package.json +2 -2
  83. package/dist/lib/darwin_aarch64/libxxhash.0.8.2.dylib +0 -0
  84. package/dist/lib/darwin_aarch64/libxxhash.0.dylib +0 -0
  85. package/dist/lib/linux_aarch64/libxxhash.so +0 -0
  86. package/dist/lib/linux_aarch64/libxxhash.so.0.8.2 +0 -0
  87. package/dist/lib/linux_x86_64/libxxhash.so +0 -0
  88. package/dist/lib/linux_x86_64/libxxhash.so.0.8.2 +0 -0
  89. package/dist/src/server/schema/schema.d.ts +0 -3
  90. package/dist/src/server/schema/schema.js +0 -4
  91. package/dist/src/server/schema/selvaBuffer.d.ts +0 -4
  92. package/dist/src/server/schema/selvaBuffer.js +0 -112
  93. package/dist/src/server/schema/typeDef.d.ts +0 -6
  94. package/dist/src/server/schema/typeDef.js +0 -337
  95. package/dist/src/server/schema/types.d.ts +0 -140
  96. package/dist/src/server/schema/types.js +0 -121
  97. package/dist/src/server/schema/utils.d.ts +0 -7
  98. package/dist/src/server/schema/utils.js +0 -34
@@ -1,140 +0,0 @@
1
- import { SchemaLocales } from '@based/schema';
2
- export declare const NULL = 0;
3
- export declare const TIMESTAMP = 1;
4
- export declare const CREATED = 2;
5
- export declare const UPDATED = 3;
6
- export declare const NUMBER = 4;
7
- export declare const CARDINALITY = 5;
8
- export declare const INT8 = 20;
9
- export declare const UINT8 = 6;
10
- export declare const INT16 = 21;
11
- export declare const UINT16 = 22;
12
- export declare const INT32 = 23;
13
- export declare const UINT32 = 7;
14
- export declare const INT64 = 24;
15
- export declare const BOOLEAN = 9;
16
- export declare const ENUM = 10;
17
- export declare const STRING = 11;
18
- export declare const TEXT = 12;
19
- export declare const REFERENCE = 13;
20
- export declare const REFERENCES = 14;
21
- export declare const WEAK_REFERENCE = 15;
22
- export declare const WEAK_REFERENCES = 16;
23
- export declare const MICRO_BUFFER = 17;
24
- export declare const ALIAS = 18;
25
- export declare const ALIASES = 19;
26
- export declare const BINARY = 25;
27
- export declare const ID = 26;
28
- export declare const VECTOR = 27;
29
- export declare const JSON = 28;
30
- export declare const TYPE_INDEX_MAP: {
31
- alias: number;
32
- aliases: number;
33
- microbuffer: number;
34
- references: number;
35
- reference: number;
36
- timestamp: number;
37
- boolean: number;
38
- created: number;
39
- updated: number;
40
- number: number;
41
- string: number;
42
- text: number;
43
- uint16: number;
44
- uint32: number;
45
- int16: number;
46
- int32: number;
47
- uint8: number;
48
- enum: number;
49
- int8: number;
50
- id: number;
51
- binary: number;
52
- vector: number;
53
- cardinality: number;
54
- json: number;
55
- };
56
- export type InternalSchemaProp = keyof typeof TYPE_INDEX_MAP;
57
- export type TypeIndex = (typeof TYPE_INDEX_MAP)[InternalSchemaProp];
58
- export type PropDef = {
59
- __isPropDef: true;
60
- prop: number;
61
- typeIndex: TypeIndex;
62
- separate: boolean;
63
- path: string[];
64
- start: number;
65
- len: number;
66
- inverseTypeName?: string;
67
- inversePropName?: string;
68
- compression?: 0 | 1;
69
- inverseTypeId?: number;
70
- inversePropNumber?: number;
71
- enum?: any[];
72
- reverseEnum?: {
73
- [key: string]: number;
74
- };
75
- edgesTotalLen?: number;
76
- edges?: {
77
- [key: string]: PropDefEdge;
78
- };
79
- reverseEdges?: {
80
- [prop: string]: PropDefEdge;
81
- };
82
- __isEdge?: boolean;
83
- dependent?: boolean;
84
- };
85
- export type PropDefEdge = Partial<PropDef> & {
86
- __isPropDef: true;
87
- typeIndex: TypeIndex;
88
- len: number;
89
- prop: number;
90
- name: string;
91
- edgesTotalLen?: number;
92
- __isEdge: true;
93
- };
94
- export type SchemaPropTree = {
95
- [key: string]: SchemaPropTree | PropDef;
96
- };
97
- export type SchemaSortUndefinedHandler = {
98
- size: number;
99
- buffer: Buffer;
100
- bufferTmp: Buffer;
101
- props: PropDef[];
102
- };
103
- export type SchemaTypeDef = {
104
- cnt: number;
105
- checksum: number;
106
- total: number;
107
- type: string;
108
- lastId: number;
109
- blockCapacity: number;
110
- mainLen: number;
111
- buf: Buffer;
112
- propNames: Buffer;
113
- props: {
114
- [path: string]: PropDef;
115
- };
116
- reverseProps: {
117
- [field: string]: PropDef;
118
- };
119
- id: number;
120
- idUint8: Uint8Array;
121
- separate: PropDef[];
122
- main: {
123
- [start: string]: PropDef;
124
- };
125
- tree: SchemaPropTree;
126
- hasSeperateSort: boolean;
127
- seperateSort: SchemaSortUndefinedHandler;
128
- hasSeperateTextSort: boolean;
129
- seperateTextSort: SchemaSortUndefinedHandler;
130
- createTs?: PropDef[];
131
- updateTs?: PropDef[];
132
- locales: Partial<SchemaLocales>;
133
- };
134
- export declare const SIZE_MAP: Record<InternalSchemaProp, number>;
135
- export declare let REVERSE_SIZE_MAP: Record<TypeIndex, number>;
136
- export declare const REVERSE_TYPE_INDEX_MAP: Record<TypeIndex, InternalSchemaProp>;
137
- export declare const ID_FIELD_DEF: PropDef;
138
- export declare const EMPTY_MICRO_BUFFER: PropDef;
139
- export declare const getPropTypeName: (propType: TypeIndex) => InternalSchemaProp;
140
- export declare const isPropDef: (prop: any) => prop is PropDef;
@@ -1,121 +0,0 @@
1
- // WARN: The following type codes are used in js and zig but selva has its own typing.
2
- export const NULL = 0;
3
- export const TIMESTAMP = 1;
4
- export const CREATED = 2;
5
- export const UPDATED = 3;
6
- export const NUMBER = 4;
7
- export const CARDINALITY = 5;
8
- export const INT8 = 20;
9
- export const UINT8 = 6;
10
- export const INT16 = 21;
11
- export const UINT16 = 22;
12
- export const INT32 = 23;
13
- export const UINT32 = 7;
14
- export const INT64 = 24;
15
- export const BOOLEAN = 9;
16
- export const ENUM = 10;
17
- export const STRING = 11;
18
- export const TEXT = 12;
19
- export const REFERENCE = 13;
20
- export const REFERENCES = 14;
21
- export const WEAK_REFERENCE = 15;
22
- export const WEAK_REFERENCES = 16;
23
- export const MICRO_BUFFER = 17;
24
- export const ALIAS = 18;
25
- export const ALIASES = 19;
26
- export const BINARY = 25;
27
- export const ID = 26;
28
- export const VECTOR = 27;
29
- export const JSON = 28;
30
- export const TYPE_INDEX_MAP = {
31
- alias: ALIAS,
32
- aliases: ALIASES,
33
- microbuffer: MICRO_BUFFER,
34
- references: REFERENCES,
35
- reference: REFERENCE,
36
- timestamp: TIMESTAMP,
37
- boolean: BOOLEAN,
38
- created: CREATED,
39
- updated: UPDATED,
40
- number: NUMBER,
41
- string: STRING,
42
- text: TEXT,
43
- uint16: UINT16,
44
- uint32: UINT32,
45
- int16: INT16,
46
- int32: INT32,
47
- uint8: UINT8,
48
- enum: ENUM,
49
- int8: INT8,
50
- id: NULL,
51
- binary: BINARY,
52
- vector: VECTOR,
53
- cardinality: CARDINALITY,
54
- json: JSON,
55
- };
56
- export const SIZE_MAP = {
57
- timestamp: 8, // 64bit
58
- created: 8,
59
- updated: 8,
60
- // double-precision 64-bit binary format IEEE 754 value
61
- number: 8, // 64bit
62
- int8: 1,
63
- uint8: 1,
64
- int16: 2,
65
- uint16: 2,
66
- int32: 4,
67
- uint32: 4,
68
- boolean: 1,
69
- reference: 0, // separate
70
- enum: 1, // enum
71
- string: 0, // separate
72
- text: 0, // separate
73
- cardinality: 0, // separate
74
- references: 0, // separate
75
- microbuffer: 0, // separate
76
- alias: 0,
77
- aliases: 0,
78
- id: 4,
79
- binary: 0,
80
- vector: 0, // separate
81
- json: 0,
82
- };
83
- const reverseMap = {};
84
- for (const k in TYPE_INDEX_MAP) {
85
- reverseMap[TYPE_INDEX_MAP[k]] = k;
86
- }
87
- export let REVERSE_SIZE_MAP;
88
- // @ts-ignore
89
- REVERSE_SIZE_MAP = {};
90
- for (const k in SIZE_MAP) {
91
- REVERSE_SIZE_MAP[TYPE_INDEX_MAP[k]] = SIZE_MAP[k];
92
- }
93
- export const REVERSE_TYPE_INDEX_MAP = reverseMap;
94
- export const ID_FIELD_DEF = {
95
- typeIndex: TYPE_INDEX_MAP['id'],
96
- separate: true,
97
- path: ['id'],
98
- start: 0,
99
- prop: 255,
100
- len: 4,
101
- __isPropDef: true,
102
- };
103
- export const EMPTY_MICRO_BUFFER = {
104
- typeIndex: TYPE_INDEX_MAP['microbuffer'],
105
- separate: true,
106
- path: [''],
107
- start: 0,
108
- prop: 0,
109
- len: 1,
110
- __isPropDef: true,
111
- };
112
- export const getPropTypeName = (propType) => {
113
- return REVERSE_TYPE_INDEX_MAP[propType];
114
- };
115
- export const isPropDef = (prop) => {
116
- if ('__isPropDef' in prop && prop.__isPropDef === true) {
117
- return true;
118
- }
119
- return false;
120
- };
121
- //# sourceMappingURL=types.js.map
@@ -1,7 +0,0 @@
1
- import { DbClient } from '../../client/index.js';
2
- import { DbServer } from '../index.js';
3
- import { PropDef, PropDefEdge } from './types.js';
4
- export declare const propIsSigned: (prop: PropDef | PropDefEdge) => boolean;
5
- export declare const propIsNumerical: (prop: PropDef | PropDefEdge) => boolean;
6
- export declare const genRootId: () => number;
7
- export declare const genId: (db: DbServer | DbClient) => number;
@@ -1,34 +0,0 @@
1
- import { INT16, INT32, INT64, INT8, UINT16, UINT32, UINT8, NUMBER, TIMESTAMP, } from './types.js';
2
- export const propIsSigned = (prop) => {
3
- const t = prop.typeIndex;
4
- if (t === INT16 || t === INT32 || t === INT64 || t === INT8) {
5
- return true;
6
- }
7
- return false;
8
- };
9
- export const propIsNumerical = (prop) => {
10
- const t = prop.typeIndex;
11
- if (t === INT16 ||
12
- t === INT32 ||
13
- t === INT64 ||
14
- t === INT8 ||
15
- t === UINT8 ||
16
- t === UINT16 ||
17
- t === UINT32 ||
18
- t === NUMBER ||
19
- t === TIMESTAMP) {
20
- return true;
21
- }
22
- return false;
23
- };
24
- const genIdFromInt = (n) => {
25
- return n;
26
- };
27
- export const genRootId = () => {
28
- return genIdFromInt(1);
29
- };
30
- export const genId = (db) => {
31
- db.schema.lastId++;
32
- return genIdFromInt(db.schema.lastId);
33
- };
34
- //# sourceMappingURL=utils.js.map