@ragestudio/scylla-odm 0.22.2 → 0.22.4
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/batch/index.d.ts +3 -3
- package/batch/index.d.ts.map +1 -1
- package/client.d.ts +6 -5
- package/client.d.ts.map +1 -1
- package/client.js +11 -12
- package/client.js.map +1 -1
- package/cql_gen/create_table.d.ts +1 -1
- package/cql_gen/create_table.d.ts.map +1 -1
- package/document/index.d.ts +3 -3
- package/document/index.d.ts.map +1 -1
- package/driver/LICENSE.txt +177 -0
- package/driver/NOTICE.txt +67 -0
- package/driver/auth/index.d.ts +37 -0
- package/driver/auth/index.js +37 -0
- package/driver/auth/no-auth-provider.js +73 -0
- package/driver/auth/plain-text-auth-provider.js +81 -0
- package/driver/auth/provider.js +77 -0
- package/driver/client-options.js +442 -0
- package/driver/client.js +1267 -0
- package/driver/concurrent/index.d.ts +49 -0
- package/driver/concurrent/index.js +366 -0
- package/driver/connection.js +1034 -0
- package/driver/control-connection.js +1282 -0
- package/driver/encoder.js +2316 -0
- package/driver/errors.js +223 -0
- package/driver/execution-options.js +612 -0
- package/driver/execution-profile.js +274 -0
- package/driver/host-connection-pool.js +587 -0
- package/driver/host.js +699 -0
- package/driver/index.d.ts +387 -0
- package/driver/index.js +81 -0
- package/driver/mapping/cache.js +214 -0
- package/driver/mapping/doc-info-adapter.js +171 -0
- package/driver/mapping/index.d.ts +219 -0
- package/driver/mapping/index.js +57 -0
- package/driver/mapping/mapper.js +225 -0
- package/driver/mapping/mapping-handler.js +641 -0
- package/driver/mapping/model-batch-item.js +215 -0
- package/driver/mapping/model-batch-mapper.js +141 -0
- package/driver/mapping/model-mapper.js +315 -0
- package/driver/mapping/model-mapping-info.js +225 -0
- package/driver/mapping/object-selector.js +417 -0
- package/driver/mapping/q.js +156 -0
- package/driver/mapping/query-generator.js +556 -0
- package/driver/mapping/result-mapper.js +123 -0
- package/driver/mapping/result.js +139 -0
- package/driver/mapping/table-mappings.js +133 -0
- package/driver/mapping/tree.js +160 -0
- package/driver/metadata/aggregate.js +79 -0
- package/driver/metadata/client-state.js +119 -0
- package/driver/metadata/data-collection.js +182 -0
- package/driver/metadata/event-debouncer.js +174 -0
- package/driver/metadata/index.d.ts +276 -0
- package/driver/metadata/index.js +1156 -0
- package/driver/metadata/materialized-view.js +49 -0
- package/driver/metadata/schema-function.js +98 -0
- package/driver/metadata/schema-index.js +166 -0
- package/driver/metadata/schema-parser.js +1399 -0
- package/driver/metadata/table-metadata.js +77 -0
- package/driver/operation-state.js +206 -0
- package/driver/policies/address-resolution.js +145 -0
- package/driver/policies/index.d.ts +241 -0
- package/driver/policies/index.js +110 -0
- package/driver/policies/load-balancing.js +970 -0
- package/driver/policies/reconnection.js +166 -0
- package/driver/policies/retry.js +326 -0
- package/driver/policies/speculative-execution.js +150 -0
- package/driver/policies/timestamp-generation.js +176 -0
- package/driver/prepare-handler.js +347 -0
- package/driver/promise-utils.js +191 -0
- package/driver/readers.js +624 -0
- package/driver/request-execution.js +644 -0
- package/driver/request-handler.js +332 -0
- package/driver/requests.js +618 -0
- package/driver/stream-id-stack.js +209 -0
- package/driver/streams.js +745 -0
- package/driver/token.js +325 -0
- package/driver/tokenizer.js +631 -0
- package/driver/types/big-decimal.js +282 -0
- package/driver/types/duration.js +576 -0
- package/driver/types/index.d.ts +486 -0
- package/driver/types/index.js +733 -0
- package/driver/types/inet-address.js +262 -0
- package/driver/types/integer.js +818 -0
- package/driver/types/local-date.js +280 -0
- package/driver/types/local-time.js +299 -0
- package/driver/types/mutable-long.js +385 -0
- package/driver/types/protocol-version.js +391 -0
- package/driver/types/result-set.js +287 -0
- package/driver/types/result-stream.js +164 -0
- package/driver/types/row.js +85 -0
- package/driver/types/time-uuid.js +414 -0
- package/driver/types/tuple.js +103 -0
- package/driver/types/uuid.js +160 -0
- package/driver/types/vector.js +130 -0
- package/driver/types/version-number.js +153 -0
- package/driver/utils.js +1485 -0
- package/driver/writers.js +350 -0
- package/global.d.ts +1 -1
- package/global.d.ts.map +1 -1
- package/index.d.ts +6 -6
- package/index.d.ts.map +1 -1
- package/index.js +6 -6
- package/index.js.map +1 -1
- package/migrate/index.d.ts +1 -1
- package/migrate/index.d.ts.map +1 -1
- package/migrate/index.js +1 -1
- package/migrate/index.js.map +1 -1
- package/model/index.d.ts +6 -6
- package/model/index.d.ts.map +1 -1
- package/model/index.js +10 -10
- package/model/index.js.map +1 -1
- package/operations/countAll.d.ts +1 -1
- package/operations/countAll.d.ts.map +1 -1
- package/operations/delete.d.ts +3 -4
- package/operations/delete.d.ts.map +1 -1
- package/operations/delete.js +1 -1
- package/operations/delete.js.map +1 -1
- package/operations/find.d.ts +2 -2
- package/operations/find.d.ts.map +1 -1
- package/operations/find.js +1 -1
- package/operations/find.js.map +1 -1
- package/operations/findOne.d.ts +2 -2
- package/operations/findOne.d.ts.map +1 -1
- package/operations/findOne.js +1 -1
- package/operations/findOne.js.map +1 -1
- package/operations/insert.d.ts +3 -3
- package/operations/insert.d.ts.map +1 -1
- package/operations/insert.js +2 -2
- package/operations/insert.js.map +1 -1
- package/operations/sync.d.ts +1 -1
- package/operations/sync.d.ts.map +1 -1
- package/operations/sync.js +1 -1
- package/operations/sync.js.map +1 -1
- package/operations/tableExists.d.ts +1 -1
- package/operations/tableExists.d.ts.map +1 -1
- package/operations/update.d.ts +3 -3
- package/operations/update.d.ts.map +1 -1
- package/operations/update.js +2 -2
- package/operations/update.js.map +1 -1
- package/package.json +4 -12
- package/schema/index.d.ts +1 -1
- package/schema/index.d.ts.map +1 -1
- package/types.d.ts +4 -4
- package/types.d.ts.map +1 -1
- package/utils/queryParser.d.ts +1 -1
- package/utils/queryParser.d.ts.map +1 -1
- package/utils/queryParser.js +1 -1
- package/utils/queryParser.js.map +1 -1
- package/utils/typeChecker.d.ts +1 -1
- package/utils/typeChecker.d.ts.map +1 -1
- package/utils/typeChecker.js +1 -1
- package/utils/typeChecker.js.map +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
import util from "util"
|
|
19
|
+
import DataCollection from "./data-collection.js"
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new MaterializedView.
|
|
22
|
+
* @param {String} name Name of the View.
|
|
23
|
+
* @classdesc Describes a CQL materialized view.
|
|
24
|
+
* @alias module:metadata~MaterializedView
|
|
25
|
+
* @augments {module:metadata~DataCollection}
|
|
26
|
+
* @constructor
|
|
27
|
+
*/
|
|
28
|
+
function MaterializedView(name) {
|
|
29
|
+
DataCollection.call(this, name)
|
|
30
|
+
/**
|
|
31
|
+
* Name of the table.
|
|
32
|
+
* @type {String}
|
|
33
|
+
*/
|
|
34
|
+
this.tableName = null
|
|
35
|
+
/**
|
|
36
|
+
* View where clause.
|
|
37
|
+
* @type {String}
|
|
38
|
+
*/
|
|
39
|
+
this.whereClause = null
|
|
40
|
+
/**
|
|
41
|
+
* Determines if all the table columns where are included in the view.
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
*/
|
|
44
|
+
this.includeAllColumns = false
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
util.inherits(MaterializedView, DataCollection)
|
|
48
|
+
|
|
49
|
+
export default MaterializedView
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new SchemaFunction.
|
|
21
|
+
* @classdesc Describes a CQL function.
|
|
22
|
+
* @alias module:metadata~SchemaFunction
|
|
23
|
+
* @constructor
|
|
24
|
+
*/
|
|
25
|
+
function SchemaFunction() {
|
|
26
|
+
/**
|
|
27
|
+
* Name of the cql function.
|
|
28
|
+
* @type {String}
|
|
29
|
+
*/
|
|
30
|
+
this.name = null
|
|
31
|
+
/**
|
|
32
|
+
* Name of the keyspace where the cql function is declared.
|
|
33
|
+
*/
|
|
34
|
+
this.keyspaceName = null
|
|
35
|
+
/**
|
|
36
|
+
* Signature of the function.
|
|
37
|
+
* @type {Array.<String>}
|
|
38
|
+
*/
|
|
39
|
+
this.signature = null
|
|
40
|
+
/**
|
|
41
|
+
* List of the function argument names.
|
|
42
|
+
* @type {Array.<String>}
|
|
43
|
+
*/
|
|
44
|
+
this.argumentNames = null
|
|
45
|
+
/**
|
|
46
|
+
* List of the function argument types.
|
|
47
|
+
* @type {Array.<{code, info}>}
|
|
48
|
+
*/
|
|
49
|
+
this.argumentTypes = null
|
|
50
|
+
/**
|
|
51
|
+
* Body of the function.
|
|
52
|
+
* @type {String}
|
|
53
|
+
*/
|
|
54
|
+
this.body = null
|
|
55
|
+
/**
|
|
56
|
+
* Determines if the function is called when the input is null.
|
|
57
|
+
* @type {Boolean}
|
|
58
|
+
*/
|
|
59
|
+
this.calledOnNullInput = null
|
|
60
|
+
/**
|
|
61
|
+
* Name of the programming language, for example: java, javascript, ...
|
|
62
|
+
* @type {String}
|
|
63
|
+
*/
|
|
64
|
+
this.language = null
|
|
65
|
+
/**
|
|
66
|
+
* Type of the return value.
|
|
67
|
+
* @type {{code: number, info: (Object|Array|null)}}
|
|
68
|
+
*/
|
|
69
|
+
this.returnType = null
|
|
70
|
+
/**
|
|
71
|
+
* Indicates whether or not this function is deterministic. This means that
|
|
72
|
+
* given a particular input, the function will always produce the same output.
|
|
73
|
+
* @type {Boolean}
|
|
74
|
+
*/
|
|
75
|
+
this.deterministic = null
|
|
76
|
+
/**
|
|
77
|
+
* Indicates whether or not this function is monotonic on all of its
|
|
78
|
+
* arguments. This means that it is either entirely non-increasing or
|
|
79
|
+
* non-decreasing. Even if the function is not monotonic on all of its
|
|
80
|
+
* arguments, it's possible to specify that it is monotonic on one of
|
|
81
|
+
* its arguments, meaning that partial applications of the function over
|
|
82
|
+
* that argument will be monotonic.
|
|
83
|
+
*
|
|
84
|
+
* Monotonicity is required to use the function in a GROUP BY clause.
|
|
85
|
+
* @type {Boolean}
|
|
86
|
+
*/
|
|
87
|
+
this.monotonic = null
|
|
88
|
+
/**
|
|
89
|
+
* The argument names that the function is monotonic on.
|
|
90
|
+
*
|
|
91
|
+
* If {@link monotonic} is true, this will return all argument names.
|
|
92
|
+
* Otherwise, this will return either one argument or an empty array.
|
|
93
|
+
* @type {Array.<String>}
|
|
94
|
+
*/
|
|
95
|
+
this.monotonicOn = null
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export default SchemaFunction
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
import util from "util"
|
|
19
|
+
import utils from "../utils.js"
|
|
20
|
+
import types from "../types/index.js"
|
|
21
|
+
|
|
22
|
+
/** @private */
|
|
23
|
+
const kind = {
|
|
24
|
+
custom: 0,
|
|
25
|
+
keys: 1,
|
|
26
|
+
composites: 2,
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new Index instance.
|
|
30
|
+
* @classdesc Describes a CQL index.
|
|
31
|
+
* @param {String} name
|
|
32
|
+
* @param {String} target
|
|
33
|
+
* @param {Number|String} kind
|
|
34
|
+
* @param {Object} options
|
|
35
|
+
* @alias module:metadata~Index
|
|
36
|
+
* @constructor
|
|
37
|
+
*/
|
|
38
|
+
function Index(name, target, kind, options) {
|
|
39
|
+
/**
|
|
40
|
+
* Name of the index.
|
|
41
|
+
* @type {String}
|
|
42
|
+
*/
|
|
43
|
+
this.name = name
|
|
44
|
+
/**
|
|
45
|
+
* Target of the index.
|
|
46
|
+
* @type {String}
|
|
47
|
+
*/
|
|
48
|
+
this.target = target
|
|
49
|
+
/**
|
|
50
|
+
* A numeric value representing index kind (0: custom, 1: keys, 2: composite);
|
|
51
|
+
* @type {Number}
|
|
52
|
+
*/
|
|
53
|
+
this.kind = typeof kind === "string" ? getKindByName(kind) : kind
|
|
54
|
+
/**
|
|
55
|
+
* An associative array containing the index options
|
|
56
|
+
* @type {Object}
|
|
57
|
+
*/
|
|
58
|
+
this.options = options
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Determines if the index is of composites kind
|
|
63
|
+
* @returns {Boolean}
|
|
64
|
+
*/
|
|
65
|
+
Index.prototype.isCompositesKind = function () {
|
|
66
|
+
return this.kind === kind.composites
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Determines if the index is of keys kind
|
|
71
|
+
* @returns {Boolean}
|
|
72
|
+
*/
|
|
73
|
+
Index.prototype.isKeysKind = function () {
|
|
74
|
+
return this.kind === kind.keys
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Determines if the index is of custom kind
|
|
79
|
+
* @returns {Boolean}
|
|
80
|
+
*/
|
|
81
|
+
Index.prototype.isCustomKind = function () {
|
|
82
|
+
return this.kind === kind.custom
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Parses Index information from rows in the 'system_schema.indexes' table
|
|
87
|
+
* @deprecated It will be removed in the next major version.
|
|
88
|
+
* @param {Array.<Row>} indexRows
|
|
89
|
+
* @returns {Array.<Index>}
|
|
90
|
+
*/
|
|
91
|
+
Index.fromRows = function (indexRows) {
|
|
92
|
+
if (!indexRows || indexRows.length === 0) {
|
|
93
|
+
return utils.emptyArray
|
|
94
|
+
}
|
|
95
|
+
return indexRows.map(function (row) {
|
|
96
|
+
const options = row["options"]
|
|
97
|
+
return new Index(
|
|
98
|
+
row["index_name"],
|
|
99
|
+
options["target"],
|
|
100
|
+
getKindByName(row["kind"]),
|
|
101
|
+
options,
|
|
102
|
+
)
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Parses Index information from rows in the legacy 'system.schema_columns' table.
|
|
108
|
+
* @deprecated It will be removed in the next major version.
|
|
109
|
+
* @param {Array.<Row>} columnRows
|
|
110
|
+
* @param {Object.<String, {name, type}>} columnsByName
|
|
111
|
+
* @returns {Array.<Index>}
|
|
112
|
+
*/
|
|
113
|
+
Index.fromColumnRows = function (columnRows, columnsByName) {
|
|
114
|
+
const result = []
|
|
115
|
+
for (let i = 0; i < columnRows.length; i++) {
|
|
116
|
+
const row = columnRows[i]
|
|
117
|
+
const indexName = row["index_name"]
|
|
118
|
+
if (!indexName) {
|
|
119
|
+
continue
|
|
120
|
+
}
|
|
121
|
+
const c = columnsByName[row["column_name"]]
|
|
122
|
+
let target
|
|
123
|
+
const options = JSON.parse(row["index_options"])
|
|
124
|
+
if (options !== null && options["index_keys"] !== undefined) {
|
|
125
|
+
target = util.format("keys(%s)", c.name)
|
|
126
|
+
} else if (
|
|
127
|
+
options !== null &&
|
|
128
|
+
options["index_keys_and_values"] !== undefined
|
|
129
|
+
) {
|
|
130
|
+
target = util.format("entries(%s)", c.name)
|
|
131
|
+
} else if (
|
|
132
|
+
c.type.options.frozen &&
|
|
133
|
+
(c.type.code === types.dataTypes.map ||
|
|
134
|
+
c.type.code === types.dataTypes.list ||
|
|
135
|
+
c.type.code === types.dataTypes.set)
|
|
136
|
+
) {
|
|
137
|
+
target = util.format("full(%s)", c.name)
|
|
138
|
+
} else {
|
|
139
|
+
target = c.name
|
|
140
|
+
}
|
|
141
|
+
result.push(
|
|
142
|
+
new Index(
|
|
143
|
+
indexName,
|
|
144
|
+
target,
|
|
145
|
+
getKindByName(row["index_type"]),
|
|
146
|
+
options,
|
|
147
|
+
),
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
return result
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Gets the number representing the kind based on the name
|
|
155
|
+
* @param {String} name
|
|
156
|
+
* @returns {Number}
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
function getKindByName(name) {
|
|
160
|
+
if (!name) {
|
|
161
|
+
return kind.custom
|
|
162
|
+
}
|
|
163
|
+
return kind[name.toLowerCase()]
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export default Index
|