@based/db 0.0.16 → 0.0.17
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/dist/lib/darwin_aarch64/include/selva/db.h +3 -0
- package/dist/lib/darwin_aarch64/include/selva/fields.h +1 -2
- package/dist/lib/darwin_aarch64/include/selva/history.h +16 -1
- package/dist/lib/darwin_aarch64/include/selva/types.h +4 -0
- package/dist/lib/darwin_aarch64/libnode-v20.11.1.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v20.18.1.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v22.13.0.node +0 -0
- package/dist/lib/darwin_aarch64/libselva.dylib +0 -0
- package/dist/lib/linux_aarch64/include/selva/db.h +3 -0
- package/dist/lib/linux_aarch64/include/selva/fields.h +1 -2
- package/dist/lib/linux_aarch64/include/selva/history.h +16 -1
- package/dist/lib/linux_aarch64/include/selva/types.h +4 -0
- package/dist/lib/linux_aarch64/libnode-v20.11.1.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v20.18.1.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v22.13.0.node +0 -0
- package/dist/lib/linux_aarch64/libselva.so +0 -0
- package/dist/lib/linux_x86_64/include/selva/db.h +3 -0
- package/dist/lib/linux_x86_64/include/selva/fields.h +1 -2
- package/dist/lib/linux_x86_64/include/selva/history.h +16 -1
- package/dist/lib/linux_x86_64/include/selva/types.h +4 -0
- package/dist/lib/linux_x86_64/libnode-v20.11.1.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v20.18.1.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v22.13.0.node +0 -0
- package/dist/lib/linux_x86_64/libselva.so +0 -0
- package/dist/src/client/crc32.js +0 -276
- package/dist/src/client/modify/ModifyRes.d.ts +4 -2
- package/dist/src/client/modify/ModifyRes.js +11 -6
- package/dist/src/client/modify/alias.js +2 -2
- package/dist/src/client/modify/cardinality.js +6 -1
- package/dist/src/client/modify/create.js +8 -9
- package/dist/src/client/modify/references/reference.js +14 -7
- package/dist/src/client/modify/references/references.js +10 -4
- package/dist/src/client/modify/string.js +2 -2
- package/dist/src/client/modify/text.js +1 -1
- package/dist/src/client/modify/types.d.ts +3 -1
- package/dist/src/client/modify/types.js +2 -0
- package/dist/src/client/modify/update.js +1 -1
- package/dist/src/client/operations.d.ts +2 -2
- package/dist/src/client/operations.js +19 -3
- package/dist/src/client/query/BasedDbQuery.d.ts +4 -3
- package/dist/src/client/query/BasedDbQuery.js +14 -6
- package/dist/src/client/query/BasedIterable.js +3 -10
- package/dist/src/client/query/display.d.ts +6 -0
- package/dist/src/client/query/display.js +52 -1
- package/dist/src/client/query/filter/createFixedFilterBuffer.js +9 -8
- package/dist/src/client/query/filter/createReferenceFilter.js +5 -4
- package/dist/src/client/query/filter/createVariableFilterBuffer.js +6 -10
- package/dist/src/client/query/filter/toBuffer.js +1 -6
- package/dist/src/client/query/include/props.js +14 -6
- package/dist/src/client/query/include/utils.js +2 -2
- package/dist/src/client/query/include/walk.js +1 -7
- package/dist/src/client/query/queryDef.d.ts +1 -1
- package/dist/src/client/query/queryDef.js +4 -3
- package/dist/src/client/query/registerQuery.js +1 -0
- package/dist/src/client/query/search/index.js +12 -6
- package/dist/src/client/query/sort.js +7 -6
- package/dist/src/client/query/thresholds.d.ts +0 -1
- package/dist/src/client/query/thresholds.js +0 -8
- package/dist/src/client/query/toBuffer.js +0 -3
- package/dist/src/client/query/types.d.ts +2 -0
- package/dist/src/client/query/validation.d.ts +32 -0
- package/dist/src/client/query/validation.js +237 -114
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +17 -2
- package/dist/src/native.d.ts +2 -0
- package/dist/src/native.js +6 -0
- package/dist/src/server/index.d.ts +8 -6
- package/dist/src/server/index.js +56 -30
- package/dist/src/server/migrate/index.js +10 -2
- package/dist/src/server/migrate/worker.js +1 -1
- package/dist/src/server/schema/typeDef.js +35 -25
- package/dist/src/server/schema/types.d.ts +10 -5
- package/dist/src/server/schema/types.js +1 -1
- package/package.json +5 -3
|
@@ -113,6 +113,9 @@ const struct SelvaFieldsSchema *selva_get_edge_field_fields_schema(struct SelvaD
|
|
|
113
113
|
SELVA_EXPORT
|
|
114
114
|
void selva_expire_node(struct SelvaDb *db, node_type_t type, node_id_t node_id, int64_t ts);
|
|
115
115
|
|
|
116
|
+
SELVA_EXPORT
|
|
117
|
+
void selva_expire_node_cancel(struct SelvaDb *db, node_type_t type, node_id_t node_id);
|
|
118
|
+
|
|
116
119
|
SELVA_EXPORT
|
|
117
120
|
void selva_db_expire_tick(struct SelvaDb *db, int64_t now);
|
|
118
121
|
|
|
@@ -132,8 +132,7 @@ int selva_fields_get_mutable_string(
|
|
|
132
132
|
* TODO Document diff to get_mutable_string
|
|
133
133
|
*/
|
|
134
134
|
SELVA_EXPORT
|
|
135
|
-
struct selva_string *
|
|
136
|
-
struct SelvaDb *db,
|
|
135
|
+
struct selva_string *selva_fields_ensure_string(
|
|
137
136
|
struct SelvaNode *node,
|
|
138
137
|
const struct SelvaFieldSchema *fs,
|
|
139
138
|
size_t initial_len);
|
|
@@ -19,15 +19,27 @@ struct selva_history_event {
|
|
|
19
19
|
|
|
20
20
|
static_assert(alignof(struct selva_history_event) == alignof(uint32_t));
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Create a new history object.
|
|
24
|
+
*/
|
|
22
25
|
SELVA_EXPORT
|
|
23
|
-
int
|
|
26
|
+
int selva_history_create(const char *pathname, size_t bsize, struct selva_history **hist_out);
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Destroy a history object.
|
|
30
|
+
*/
|
|
25
31
|
SELVA_EXPORT
|
|
26
32
|
void selva_history_destroy(struct selva_history *hist);
|
|
27
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Append a block of size `bsize` to a history object.
|
|
36
|
+
*/
|
|
28
37
|
SELVA_EXPORT
|
|
29
38
|
void selva_history_append(struct selva_history *hist, int64_t ts, node_id_t node_id, void *buf);
|
|
30
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Ensure that the history file is fully written to the disk.
|
|
42
|
+
*/
|
|
31
43
|
SELVA_EXPORT
|
|
32
44
|
void selva_history_fsync(struct selva_history *hist);
|
|
33
45
|
|
|
@@ -45,5 +57,8 @@ uint32_t *selva_history_find_range(struct selva_history *hist, int64_t from, int
|
|
|
45
57
|
SELVA_EXPORT
|
|
46
58
|
uint32_t *selva_history_find_range_node(struct selva_history *hist, int64_t from, int64_t to, node_id_t node_id, size_t *size_out);
|
|
47
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Free a range returned by selva_history_find_range() or selva_history_find_range_node().
|
|
62
|
+
*/
|
|
48
63
|
SELVA_EXPORT
|
|
49
64
|
void selva_history_free_range(uint32_t *range);
|
|
@@ -56,6 +56,10 @@ enum SelvaFieldType {
|
|
|
56
56
|
struct EdgeFieldConstraint {
|
|
57
57
|
enum EdgeFieldConstraintFlag {
|
|
58
58
|
EDGE_FIELD_CONSTRAINT_FLAG_DEPENDENT = 0x01,
|
|
59
|
+
/**
|
|
60
|
+
* _fields_schema is referenced from the opposite efc and shouldn't be freed.
|
|
61
|
+
*/
|
|
62
|
+
EDGE_FIELD_CONSTRAINT_FLAG_SCHEMA_REF_CACHED = 0x40,
|
|
59
63
|
/**
|
|
60
64
|
* Skip saving this field while dumping.
|
|
61
65
|
*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -113,6 +113,9 @@ const struct SelvaFieldsSchema *selva_get_edge_field_fields_schema(struct SelvaD
|
|
|
113
113
|
SELVA_EXPORT
|
|
114
114
|
void selva_expire_node(struct SelvaDb *db, node_type_t type, node_id_t node_id, int64_t ts);
|
|
115
115
|
|
|
116
|
+
SELVA_EXPORT
|
|
117
|
+
void selva_expire_node_cancel(struct SelvaDb *db, node_type_t type, node_id_t node_id);
|
|
118
|
+
|
|
116
119
|
SELVA_EXPORT
|
|
117
120
|
void selva_db_expire_tick(struct SelvaDb *db, int64_t now);
|
|
118
121
|
|
|
@@ -132,8 +132,7 @@ int selva_fields_get_mutable_string(
|
|
|
132
132
|
* TODO Document diff to get_mutable_string
|
|
133
133
|
*/
|
|
134
134
|
SELVA_EXPORT
|
|
135
|
-
struct selva_string *
|
|
136
|
-
struct SelvaDb *db,
|
|
135
|
+
struct selva_string *selva_fields_ensure_string(
|
|
137
136
|
struct SelvaNode *node,
|
|
138
137
|
const struct SelvaFieldSchema *fs,
|
|
139
138
|
size_t initial_len);
|
|
@@ -19,15 +19,27 @@ struct selva_history_event {
|
|
|
19
19
|
|
|
20
20
|
static_assert(alignof(struct selva_history_event) == alignof(uint32_t));
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Create a new history object.
|
|
24
|
+
*/
|
|
22
25
|
SELVA_EXPORT
|
|
23
|
-
int
|
|
26
|
+
int selva_history_create(const char *pathname, size_t bsize, struct selva_history **hist_out);
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Destroy a history object.
|
|
30
|
+
*/
|
|
25
31
|
SELVA_EXPORT
|
|
26
32
|
void selva_history_destroy(struct selva_history *hist);
|
|
27
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Append a block of size `bsize` to a history object.
|
|
36
|
+
*/
|
|
28
37
|
SELVA_EXPORT
|
|
29
38
|
void selva_history_append(struct selva_history *hist, int64_t ts, node_id_t node_id, void *buf);
|
|
30
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Ensure that the history file is fully written to the disk.
|
|
42
|
+
*/
|
|
31
43
|
SELVA_EXPORT
|
|
32
44
|
void selva_history_fsync(struct selva_history *hist);
|
|
33
45
|
|
|
@@ -45,5 +57,8 @@ uint32_t *selva_history_find_range(struct selva_history *hist, int64_t from, int
|
|
|
45
57
|
SELVA_EXPORT
|
|
46
58
|
uint32_t *selva_history_find_range_node(struct selva_history *hist, int64_t from, int64_t to, node_id_t node_id, size_t *size_out);
|
|
47
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Free a range returned by selva_history_find_range() or selva_history_find_range_node().
|
|
62
|
+
*/
|
|
48
63
|
SELVA_EXPORT
|
|
49
64
|
void selva_history_free_range(uint32_t *range);
|
|
@@ -56,6 +56,10 @@ enum SelvaFieldType {
|
|
|
56
56
|
struct EdgeFieldConstraint {
|
|
57
57
|
enum EdgeFieldConstraintFlag {
|
|
58
58
|
EDGE_FIELD_CONSTRAINT_FLAG_DEPENDENT = 0x01,
|
|
59
|
+
/**
|
|
60
|
+
* _fields_schema is referenced from the opposite efc and shouldn't be freed.
|
|
61
|
+
*/
|
|
62
|
+
EDGE_FIELD_CONSTRAINT_FLAG_SCHEMA_REF_CACHED = 0x40,
|
|
59
63
|
/**
|
|
60
64
|
* Skip saving this field while dumping.
|
|
61
65
|
*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -113,6 +113,9 @@ const struct SelvaFieldsSchema *selva_get_edge_field_fields_schema(struct SelvaD
|
|
|
113
113
|
SELVA_EXPORT
|
|
114
114
|
void selva_expire_node(struct SelvaDb *db, node_type_t type, node_id_t node_id, int64_t ts);
|
|
115
115
|
|
|
116
|
+
SELVA_EXPORT
|
|
117
|
+
void selva_expire_node_cancel(struct SelvaDb *db, node_type_t type, node_id_t node_id);
|
|
118
|
+
|
|
116
119
|
SELVA_EXPORT
|
|
117
120
|
void selva_db_expire_tick(struct SelvaDb *db, int64_t now);
|
|
118
121
|
|
|
@@ -132,8 +132,7 @@ int selva_fields_get_mutable_string(
|
|
|
132
132
|
* TODO Document diff to get_mutable_string
|
|
133
133
|
*/
|
|
134
134
|
SELVA_EXPORT
|
|
135
|
-
struct selva_string *
|
|
136
|
-
struct SelvaDb *db,
|
|
135
|
+
struct selva_string *selva_fields_ensure_string(
|
|
137
136
|
struct SelvaNode *node,
|
|
138
137
|
const struct SelvaFieldSchema *fs,
|
|
139
138
|
size_t initial_len);
|
|
@@ -19,15 +19,27 @@ struct selva_history_event {
|
|
|
19
19
|
|
|
20
20
|
static_assert(alignof(struct selva_history_event) == alignof(uint32_t));
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Create a new history object.
|
|
24
|
+
*/
|
|
22
25
|
SELVA_EXPORT
|
|
23
|
-
int
|
|
26
|
+
int selva_history_create(const char *pathname, size_t bsize, struct selva_history **hist_out);
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Destroy a history object.
|
|
30
|
+
*/
|
|
25
31
|
SELVA_EXPORT
|
|
26
32
|
void selva_history_destroy(struct selva_history *hist);
|
|
27
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Append a block of size `bsize` to a history object.
|
|
36
|
+
*/
|
|
28
37
|
SELVA_EXPORT
|
|
29
38
|
void selva_history_append(struct selva_history *hist, int64_t ts, node_id_t node_id, void *buf);
|
|
30
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Ensure that the history file is fully written to the disk.
|
|
42
|
+
*/
|
|
31
43
|
SELVA_EXPORT
|
|
32
44
|
void selva_history_fsync(struct selva_history *hist);
|
|
33
45
|
|
|
@@ -45,5 +57,8 @@ uint32_t *selva_history_find_range(struct selva_history *hist, int64_t from, int
|
|
|
45
57
|
SELVA_EXPORT
|
|
46
58
|
uint32_t *selva_history_find_range_node(struct selva_history *hist, int64_t from, int64_t to, node_id_t node_id, size_t *size_out);
|
|
47
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Free a range returned by selva_history_find_range() or selva_history_find_range_node().
|
|
62
|
+
*/
|
|
48
63
|
SELVA_EXPORT
|
|
49
64
|
void selva_history_free_range(uint32_t *range);
|
|
@@ -56,6 +56,10 @@ enum SelvaFieldType {
|
|
|
56
56
|
struct EdgeFieldConstraint {
|
|
57
57
|
enum EdgeFieldConstraintFlag {
|
|
58
58
|
EDGE_FIELD_CONSTRAINT_FLAG_DEPENDENT = 0x01,
|
|
59
|
+
/**
|
|
60
|
+
* _fields_schema is referenced from the opposite efc and shouldn't be freed.
|
|
61
|
+
*/
|
|
62
|
+
EDGE_FIELD_CONSTRAINT_FLAG_SCHEMA_REF_CACHED = 0x40,
|
|
59
63
|
/**
|
|
60
64
|
* Skip saving this field while dumping.
|
|
61
65
|
*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/src/client/crc32.js
CHANGED
|
@@ -2,280 +2,4 @@ import native from '../native.js';
|
|
|
2
2
|
export const crc32 = (buf) => {
|
|
3
3
|
return native.crc32(buf);
|
|
4
4
|
};
|
|
5
|
-
// Pure js version:
|
|
6
|
-
// /**
|
|
7
|
-
// * This code is a manual javascript translation of c code generated by
|
|
8
|
-
// * pycrc 0.7.1 (http://www.tty1.net/pycrc/). Command line used:
|
|
9
|
-
// * './pycrc.py --model=crc-32c --generate c --algorithm=table-driven'
|
|
10
|
-
// */
|
|
11
|
-
//
|
|
12
|
-
// const kCRCTable = Int32Array.of(
|
|
13
|
-
// 0x00000000,
|
|
14
|
-
// 0xf26b8303,
|
|
15
|
-
// 0xe13b70f7,
|
|
16
|
-
// 0x1350f3f4,
|
|
17
|
-
// 0xc79a971f,
|
|
18
|
-
// 0x35f1141c,
|
|
19
|
-
// 0x26a1e7e8,
|
|
20
|
-
// 0xd4ca64eb,
|
|
21
|
-
// 0x8ad958cf,
|
|
22
|
-
// 0x78b2dbcc,
|
|
23
|
-
// 0x6be22838,
|
|
24
|
-
// 0x9989ab3b,
|
|
25
|
-
// 0x4d43cfd0,
|
|
26
|
-
// 0xbf284cd3,
|
|
27
|
-
// 0xac78bf27,
|
|
28
|
-
// 0x5e133c24,
|
|
29
|
-
// 0x105ec76f,
|
|
30
|
-
// 0xe235446c,
|
|
31
|
-
// 0xf165b798,
|
|
32
|
-
// 0x030e349b,
|
|
33
|
-
// 0xd7c45070,
|
|
34
|
-
// 0x25afd373,
|
|
35
|
-
// 0x36ff2087,
|
|
36
|
-
// 0xc494a384,
|
|
37
|
-
// 0x9a879fa0,
|
|
38
|
-
// 0x68ec1ca3,
|
|
39
|
-
// 0x7bbcef57,
|
|
40
|
-
// 0x89d76c54,
|
|
41
|
-
// 0x5d1d08bf,
|
|
42
|
-
// 0xaf768bbc,
|
|
43
|
-
// 0xbc267848,
|
|
44
|
-
// 0x4e4dfb4b,
|
|
45
|
-
// 0x20bd8ede,
|
|
46
|
-
// 0xd2d60ddd,
|
|
47
|
-
// 0xc186fe29,
|
|
48
|
-
// 0x33ed7d2a,
|
|
49
|
-
// 0xe72719c1,
|
|
50
|
-
// 0x154c9ac2,
|
|
51
|
-
// 0x061c6936,
|
|
52
|
-
// 0xf477ea35,
|
|
53
|
-
// 0xaa64d611,
|
|
54
|
-
// 0x580f5512,
|
|
55
|
-
// 0x4b5fa6e6,
|
|
56
|
-
// 0xb93425e5,
|
|
57
|
-
// 0x6dfe410e,
|
|
58
|
-
// 0x9f95c20d,
|
|
59
|
-
// 0x8cc531f9,
|
|
60
|
-
// 0x7eaeb2fa,
|
|
61
|
-
// 0x30e349b1,
|
|
62
|
-
// 0xc288cab2,
|
|
63
|
-
// 0xd1d83946,
|
|
64
|
-
// 0x23b3ba45,
|
|
65
|
-
// 0xf779deae,
|
|
66
|
-
// 0x05125dad,
|
|
67
|
-
// 0x1642ae59,
|
|
68
|
-
// 0xe4292d5a,
|
|
69
|
-
// 0xba3a117e,
|
|
70
|
-
// 0x4851927d,
|
|
71
|
-
// 0x5b016189,
|
|
72
|
-
// 0xa96ae28a,
|
|
73
|
-
// 0x7da08661,
|
|
74
|
-
// 0x8fcb0562,
|
|
75
|
-
// 0x9c9bf696,
|
|
76
|
-
// 0x6ef07595,
|
|
77
|
-
// 0x417b1dbc,
|
|
78
|
-
// 0xb3109ebf,
|
|
79
|
-
// 0xa0406d4b,
|
|
80
|
-
// 0x522bee48,
|
|
81
|
-
// 0x86e18aa3,
|
|
82
|
-
// 0x748a09a0,
|
|
83
|
-
// 0x67dafa54,
|
|
84
|
-
// 0x95b17957,
|
|
85
|
-
// 0xcba24573,
|
|
86
|
-
// 0x39c9c670,
|
|
87
|
-
// 0x2a993584,
|
|
88
|
-
// 0xd8f2b687,
|
|
89
|
-
// 0x0c38d26c,
|
|
90
|
-
// 0xfe53516f,
|
|
91
|
-
// 0xed03a29b,
|
|
92
|
-
// 0x1f682198,
|
|
93
|
-
// 0x5125dad3,
|
|
94
|
-
// 0xa34e59d0,
|
|
95
|
-
// 0xb01eaa24,
|
|
96
|
-
// 0x42752927,
|
|
97
|
-
// 0x96bf4dcc,
|
|
98
|
-
// 0x64d4cecf,
|
|
99
|
-
// 0x77843d3b,
|
|
100
|
-
// 0x85efbe38,
|
|
101
|
-
// 0xdbfc821c,
|
|
102
|
-
// 0x2997011f,
|
|
103
|
-
// 0x3ac7f2eb,
|
|
104
|
-
// 0xc8ac71e8,
|
|
105
|
-
// 0x1c661503,
|
|
106
|
-
// 0xee0d9600,
|
|
107
|
-
// 0xfd5d65f4,
|
|
108
|
-
// 0x0f36e6f7,
|
|
109
|
-
// 0x61c69362,
|
|
110
|
-
// 0x93ad1061,
|
|
111
|
-
// 0x80fde395,
|
|
112
|
-
// 0x72966096,
|
|
113
|
-
// 0xa65c047d,
|
|
114
|
-
// 0x5437877e,
|
|
115
|
-
// 0x4767748a,
|
|
116
|
-
// 0xb50cf789,
|
|
117
|
-
// 0xeb1fcbad,
|
|
118
|
-
// 0x197448ae,
|
|
119
|
-
// 0x0a24bb5a,
|
|
120
|
-
// 0xf84f3859,
|
|
121
|
-
// 0x2c855cb2,
|
|
122
|
-
// 0xdeeedfb1,
|
|
123
|
-
// 0xcdbe2c45,
|
|
124
|
-
// 0x3fd5af46,
|
|
125
|
-
// 0x7198540d,
|
|
126
|
-
// 0x83f3d70e,
|
|
127
|
-
// 0x90a324fa,
|
|
128
|
-
// 0x62c8a7f9,
|
|
129
|
-
// 0xb602c312,
|
|
130
|
-
// 0x44694011,
|
|
131
|
-
// 0x5739b3e5,
|
|
132
|
-
// 0xa55230e6,
|
|
133
|
-
// 0xfb410cc2,
|
|
134
|
-
// 0x092a8fc1,
|
|
135
|
-
// 0x1a7a7c35,
|
|
136
|
-
// 0xe811ff36,
|
|
137
|
-
// 0x3cdb9bdd,
|
|
138
|
-
// 0xceb018de,
|
|
139
|
-
// 0xdde0eb2a,
|
|
140
|
-
// 0x2f8b6829,
|
|
141
|
-
// 0x82f63b78,
|
|
142
|
-
// 0x709db87b,
|
|
143
|
-
// 0x63cd4b8f,
|
|
144
|
-
// 0x91a6c88c,
|
|
145
|
-
// 0x456cac67,
|
|
146
|
-
// 0xb7072f64,
|
|
147
|
-
// 0xa457dc90,
|
|
148
|
-
// 0x563c5f93,
|
|
149
|
-
// 0x082f63b7,
|
|
150
|
-
// 0xfa44e0b4,
|
|
151
|
-
// 0xe9141340,
|
|
152
|
-
// 0x1b7f9043,
|
|
153
|
-
// 0xcfb5f4a8,
|
|
154
|
-
// 0x3dde77ab,
|
|
155
|
-
// 0x2e8e845f,
|
|
156
|
-
// 0xdce5075c,
|
|
157
|
-
// 0x92a8fc17,
|
|
158
|
-
// 0x60c37f14,
|
|
159
|
-
// 0x73938ce0,
|
|
160
|
-
// 0x81f80fe3,
|
|
161
|
-
// 0x55326b08,
|
|
162
|
-
// 0xa759e80b,
|
|
163
|
-
// 0xb4091bff,
|
|
164
|
-
// 0x466298fc,
|
|
165
|
-
// 0x1871a4d8,
|
|
166
|
-
// 0xea1a27db,
|
|
167
|
-
// 0xf94ad42f,
|
|
168
|
-
// 0x0b21572c,
|
|
169
|
-
// 0xdfeb33c7,
|
|
170
|
-
// 0x2d80b0c4,
|
|
171
|
-
// 0x3ed04330,
|
|
172
|
-
// 0xccbbc033,
|
|
173
|
-
// 0xa24bb5a6,
|
|
174
|
-
// 0x502036a5,
|
|
175
|
-
// 0x4370c551,
|
|
176
|
-
// 0xb11b4652,
|
|
177
|
-
// 0x65d122b9,
|
|
178
|
-
// 0x97baa1ba,
|
|
179
|
-
// 0x84ea524e,
|
|
180
|
-
// 0x7681d14d,
|
|
181
|
-
// 0x2892ed69,
|
|
182
|
-
// 0xdaf96e6a,
|
|
183
|
-
// 0xc9a99d9e,
|
|
184
|
-
// 0x3bc21e9d,
|
|
185
|
-
// 0xef087a76,
|
|
186
|
-
// 0x1d63f975,
|
|
187
|
-
// 0x0e330a81,
|
|
188
|
-
// 0xfc588982,
|
|
189
|
-
// 0xb21572c9,
|
|
190
|
-
// 0x407ef1ca,
|
|
191
|
-
// 0x532e023e,
|
|
192
|
-
// 0xa145813d,
|
|
193
|
-
// 0x758fe5d6,
|
|
194
|
-
// 0x87e466d5,
|
|
195
|
-
// 0x94b49521,
|
|
196
|
-
// 0x66df1622,
|
|
197
|
-
// 0x38cc2a06,
|
|
198
|
-
// 0xcaa7a905,
|
|
199
|
-
// 0xd9f75af1,
|
|
200
|
-
// 0x2b9cd9f2,
|
|
201
|
-
// 0xff56bd19,
|
|
202
|
-
// 0x0d3d3e1a,
|
|
203
|
-
// 0x1e6dcdee,
|
|
204
|
-
// 0xec064eed,
|
|
205
|
-
// 0xc38d26c4,
|
|
206
|
-
// 0x31e6a5c7,
|
|
207
|
-
// 0x22b65633,
|
|
208
|
-
// 0xd0ddd530,
|
|
209
|
-
// 0x0417b1db,
|
|
210
|
-
// 0xf67c32d8,
|
|
211
|
-
// 0xe52cc12c,
|
|
212
|
-
// 0x1747422f,
|
|
213
|
-
// 0x49547e0b,
|
|
214
|
-
// 0xbb3ffd08,
|
|
215
|
-
// 0xa86f0efc,
|
|
216
|
-
// 0x5a048dff,
|
|
217
|
-
// 0x8ecee914,
|
|
218
|
-
// 0x7ca56a17,
|
|
219
|
-
// 0x6ff599e3,
|
|
220
|
-
// 0x9d9e1ae0,
|
|
221
|
-
// 0xd3d3e1ab,
|
|
222
|
-
// 0x21b862a8,
|
|
223
|
-
// 0x32e8915c,
|
|
224
|
-
// 0xc083125f,
|
|
225
|
-
// 0x144976b4,
|
|
226
|
-
// 0xe622f5b7,
|
|
227
|
-
// 0xf5720643,
|
|
228
|
-
// 0x07198540,
|
|
229
|
-
// 0x590ab964,
|
|
230
|
-
// 0xab613a67,
|
|
231
|
-
// 0xb831c993,
|
|
232
|
-
// 0x4a5a4a90,
|
|
233
|
-
// 0x9e902e7b,
|
|
234
|
-
// 0x6cfbad78,
|
|
235
|
-
// 0x7fab5e8c,
|
|
236
|
-
// 0x8dc0dd8f,
|
|
237
|
-
// 0xe330a81a,
|
|
238
|
-
// 0x115b2b19,
|
|
239
|
-
// 0x020bd8ed,
|
|
240
|
-
// 0xf0605bee,
|
|
241
|
-
// 0x24aa3f05,
|
|
242
|
-
// 0xd6c1bc06,
|
|
243
|
-
// 0xc5914ff2,
|
|
244
|
-
// 0x37faccf1,
|
|
245
|
-
// 0x69e9f0d5,
|
|
246
|
-
// 0x9b8273d6,
|
|
247
|
-
// 0x88d28022,
|
|
248
|
-
// 0x7ab90321,
|
|
249
|
-
// 0xae7367ca,
|
|
250
|
-
// 0x5c18e4c9,
|
|
251
|
-
// 0x4f48173d,
|
|
252
|
-
// 0xbd23943e,
|
|
253
|
-
// 0xf36e6f75,
|
|
254
|
-
// 0x0105ec76,
|
|
255
|
-
// 0x12551f82,
|
|
256
|
-
// 0xe03e9c81,
|
|
257
|
-
// 0x34f4f86a,
|
|
258
|
-
// 0xc69f7b69,
|
|
259
|
-
// 0xd5cf889d,
|
|
260
|
-
// 0x27a40b9e,
|
|
261
|
-
// 0x79b737ba,
|
|
262
|
-
// 0x8bdcb4b9,
|
|
263
|
-
// 0x988c474d,
|
|
264
|
-
// 0x6ae7c44e,
|
|
265
|
-
// 0xbe2da0a5,
|
|
266
|
-
// 0x4c4623a6,
|
|
267
|
-
// 0x5f16d052,
|
|
268
|
-
// 0xad7d5351
|
|
269
|
-
// )
|
|
270
|
-
//
|
|
271
|
-
// export function crc32(buf: Buffer, initial: number): number {
|
|
272
|
-
// if (!Buffer.isBuffer(buf)) {
|
|
273
|
-
// buf = Buffer.from(buf)
|
|
274
|
-
// }
|
|
275
|
-
// let crc = (initial | 0) ^ -1
|
|
276
|
-
// for (let i = 0; i < buf.length; i++) {
|
|
277
|
-
// crc = kCRCTable[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8)
|
|
278
|
-
// }
|
|
279
|
-
// return (crc ^ -1) >>> 0
|
|
280
|
-
// }
|
|
281
5
|
//# sourceMappingURL=crc32.js.map
|
|
@@ -16,12 +16,14 @@ export declare class ModifyError {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class ModifyState {
|
|
18
18
|
#private;
|
|
19
|
-
constructor(typeId: number, tmpId: number, db: DbClient, subMarkers: SubscriptionMarkersCheck | false, opts?:
|
|
19
|
+
constructor(typeId: number, tmpId: number, db: DbClient, subMarkers: SubscriptionMarkersCheck | false, opts: ModifyOpts, update?: boolean);
|
|
20
20
|
subMarkers: SubscriptionMarkersCheck | false;
|
|
21
|
-
|
|
21
|
+
update: boolean;
|
|
22
|
+
locale: LangCode;
|
|
22
23
|
tmpId: number;
|
|
23
24
|
error?: ModifyError;
|
|
24
25
|
promises?: Promise<any>[];
|
|
26
|
+
resolved?: boolean;
|
|
25
27
|
[Symbol.toPrimitive](): number;
|
|
26
28
|
getId(offsets: Record<number, number>): number;
|
|
27
29
|
then(resolve: any, reject: any): Promise<unknown>;
|
|
@@ -45,30 +45,35 @@ export class ModifyError {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
export class ModifyState {
|
|
48
|
-
constructor(typeId, tmpId, db, subMarkers, opts) {
|
|
48
|
+
constructor(typeId, tmpId, db, subMarkers, opts, update = false) {
|
|
49
49
|
this.tmpId = tmpId;
|
|
50
50
|
this.#typeId = typeId;
|
|
51
51
|
this.#buf = db.modifyCtx;
|
|
52
52
|
this.#ctx = db.modifyCtx.ctx;
|
|
53
53
|
this.subMarkers = subMarkers;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
54
|
+
this.update = update;
|
|
55
|
+
if (opts?.locale) {
|
|
56
|
+
this.locale = langCodesMap.get(opts.locale);
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
subMarkers;
|
|
61
|
-
|
|
60
|
+
update;
|
|
61
|
+
locale;
|
|
62
62
|
#buf;
|
|
63
63
|
#ctx;
|
|
64
64
|
#typeId;
|
|
65
65
|
tmpId;
|
|
66
66
|
error;
|
|
67
67
|
promises;
|
|
68
|
+
resolved;
|
|
68
69
|
[Symbol.toPrimitive]() {
|
|
69
70
|
return this.tmpId;
|
|
70
71
|
}
|
|
71
72
|
getId(offsets) {
|
|
73
|
+
this.resolved = true;
|
|
74
|
+
if (this.update) {
|
|
75
|
+
return this.tmpId;
|
|
76
|
+
}
|
|
72
77
|
const offset = offsets[this.#typeId] || 0;
|
|
73
78
|
return this.tmpId + offset;
|
|
74
79
|
}
|
|
@@ -19,8 +19,8 @@ export function writeAlias(value, ctx, def, t, parentId, modifyOp) {
|
|
|
19
19
|
return RANGE_ERR;
|
|
20
20
|
}
|
|
21
21
|
if (modifyOp === CREATE) {
|
|
22
|
-
def.
|
|
23
|
-
ctx.
|
|
22
|
+
def.seperateSort.bufferTmp[t.prop] = 2;
|
|
23
|
+
ctx.hasSortField++;
|
|
24
24
|
}
|
|
25
25
|
setCursor(ctx, def, t.prop, t.typeIndex, parentId, modifyOp);
|
|
26
26
|
ctx.buf[ctx.len++] = modifyOp;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RANGE_ERR } from './types.js';
|
|
1
|
+
import { RANGE_ERR, CREATE, } from './types.js';
|
|
2
2
|
import { ModifyError } from './ModifyRes.js';
|
|
3
3
|
import { setCursor } from './setCursor.js';
|
|
4
4
|
import { xxHash64 } from '../xxHash64.js';
|
|
@@ -14,6 +14,11 @@ export function writeHll(value, ctx, def, t, parentId, modifyOp) {
|
|
|
14
14
|
value = [value];
|
|
15
15
|
}
|
|
16
16
|
const err = addHll(value, ctx, def, t, parentId, modifyOp);
|
|
17
|
+
if (!err && modifyOp === CREATE) {
|
|
18
|
+
def.seperateSort.bufferTmp[t.prop] = 2;
|
|
19
|
+
ctx.hasSortField++;
|
|
20
|
+
}
|
|
21
|
+
return err;
|
|
17
22
|
}
|
|
18
23
|
function addHll(value, ctx, def, t, parentId, modifyOp) {
|
|
19
24
|
const len = value.length;
|
|
@@ -3,7 +3,7 @@ import { startDrain, flushBuffer } from '../operations.js';
|
|
|
3
3
|
import { setCursor } from './setCursor.js';
|
|
4
4
|
import { modify } from './modify.js';
|
|
5
5
|
import { ModifyState } from './ModifyRes.js';
|
|
6
|
-
import { CREATE, RANGE_ERR } from './types.js';
|
|
6
|
+
import { CREATE, RANGE_ERR, ADD_EMPTY_SORT, } from './types.js';
|
|
7
7
|
import { writeFixedValue } from './fixed.js';
|
|
8
8
|
import { getSubscriptionMarkers } from '../query/subscription/index.js';
|
|
9
9
|
const appendCreate = (ctx, def, obj, res, unsafe) => {
|
|
@@ -38,17 +38,16 @@ const appendCreate = (ctx, def, obj, res, unsafe) => {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (ctx.hasStringField !== def.stringPropsSize - 1) {
|
|
41
|
+
if (def.hasSeperateSort) {
|
|
42
|
+
if (ctx.hasSortField !== def.seperateSort.size - 1) {
|
|
44
43
|
if (ctx.len + 3 > ctx.max) {
|
|
45
44
|
return RANGE_ERR;
|
|
46
45
|
}
|
|
47
|
-
ctx.buf[ctx.len++] =
|
|
46
|
+
ctx.buf[ctx.len++] = ADD_EMPTY_SORT;
|
|
48
47
|
let sizepos = ctx.len;
|
|
49
48
|
ctx.len += 2;
|
|
50
|
-
for (const { prop } of def.
|
|
51
|
-
if (def.
|
|
49
|
+
for (const { prop } of def.seperateSort.props) {
|
|
50
|
+
if (def.seperateSort.bufferTmp[prop] === 1) {
|
|
52
51
|
if (ctx.len + 1 > ctx.max) {
|
|
53
52
|
return RANGE_ERR;
|
|
54
53
|
}
|
|
@@ -59,8 +58,8 @@ const appendCreate = (ctx, def, obj, res, unsafe) => {
|
|
|
59
58
|
ctx.buf[sizepos++] = size;
|
|
60
59
|
ctx.buf[sizepos] = size >>>= 8;
|
|
61
60
|
}
|
|
62
|
-
if (ctx.
|
|
63
|
-
def.
|
|
61
|
+
if (ctx.hasSortField !== -1) {
|
|
62
|
+
def.seperateSort.buffer.copy(def.seperateSort.bufferTmp);
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
};
|