@ragestudio/scylla-odm 0.22.0 → 0.22.2
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 +19 -21
- package/batch/index.d.ts.map +1 -0
- package/batch/index.js +37 -1
- package/batch/index.js.map +1 -0
- package/client.d.ts +24 -27
- package/client.d.ts.map +1 -0
- package/client.js +190 -1
- package/client.js.map +1 -0
- package/cql_gen/create_keyspace.d.ts +8 -9
- package/cql_gen/create_keyspace.d.ts.map +1 -0
- package/cql_gen/create_keyspace.js +14 -1
- package/cql_gen/create_keyspace.js.map +1 -0
- package/cql_gen/create_table.d.ts +3 -6
- package/cql_gen/create_table.d.ts.map +1 -0
- package/cql_gen/create_table.js +51 -1
- package/cql_gen/create_table.js.map +1 -0
- package/document/index.d.ts +11 -14
- package/document/index.d.ts.map +1 -0
- package/document/index.js +76 -1
- package/document/index.js.map +1 -0
- package/global.d.ts +6 -0
- package/global.d.ts.map +1 -0
- package/global.js +2 -0
- package/global.js.map +1 -0
- package/index.d.ts +9 -7
- package/index.d.ts.map +1 -0
- package/index.js +9 -1
- package/index.js.map +1 -0
- package/logger/index.d.ts +7 -8
- package/logger/index.d.ts.map +1 -0
- package/logger/index.js +14 -1
- package/logger/index.js.map +1 -0
- package/migrate/index.d.ts +12 -14
- package/migrate/index.d.ts.map +1 -0
- package/migrate/index.js +254 -4
- package/migrate/index.js.map +1 -0
- package/model/index.d.ts +64 -67
- package/model/index.d.ts.map +1 -0
- package/model/index.js +71 -1
- package/model/index.js.map +1 -0
- package/operations/countAll.d.ts +3 -6
- package/operations/countAll.d.ts.map +1 -0
- package/operations/countAll.js +13 -1
- package/operations/countAll.js.map +1 -0
- package/operations/delete.d.ts +5 -8
- package/operations/delete.d.ts.map +1 -0
- package/operations/delete.js +23 -1
- package/operations/delete.js.map +1 -0
- package/operations/find.d.ts +4 -7
- package/operations/find.d.ts.map +1 -0
- package/operations/find.js +19 -1
- package/operations/find.js.map +1 -0
- package/operations/findOne.d.ts +4 -7
- package/operations/findOne.d.ts.map +1 -0
- package/operations/findOne.js +21 -1
- package/operations/findOne.js.map +1 -0
- package/operations/insert.d.ts +5 -8
- package/operations/insert.d.ts.map +1 -0
- package/operations/insert.js +24 -1
- package/operations/insert.js.map +1 -0
- package/operations/sync.d.ts +3 -6
- package/operations/sync.d.ts.map +1 -0
- package/operations/sync.js +16 -1
- package/operations/sync.js.map +1 -0
- package/operations/tableExists.d.ts +3 -6
- package/operations/tableExists.d.ts.map +1 -0
- package/operations/tableExists.js +15 -2
- package/operations/tableExists.js.map +1 -0
- package/operations/update.d.ts +5 -8
- package/operations/update.d.ts.map +1 -0
- package/operations/update.js +35 -1
- package/operations/update.js.map +1 -0
- package/package.json +13 -3
- package/schema/index.d.ts +13 -15
- package/schema/index.d.ts.map +1 -0
- package/schema/index.js +23 -1
- package/schema/index.js.map +1 -0
- package/types.d.ts +98 -84
- package/types.d.ts.map +1 -0
- package/types.js +33 -1
- package/types.js.map +1 -0
- package/utils/buildMapper.d.ts +12 -4
- package/utils/buildMapper.d.ts.map +1 -0
- package/utils/buildMapper.js +11 -1
- package/utils/buildMapper.js.map +1 -0
- package/utils/delay.d.ts +3 -4
- package/utils/delay.d.ts.map +1 -0
- package/utils/delay.js +5 -1
- package/utils/delay.js.map +1 -0
- package/utils/fillDefaults.d.ts +2 -4
- package/utils/fillDefaults.d.ts.map +1 -0
- package/utils/fillDefaults.js +24 -1
- package/utils/fillDefaults.js.map +1 -0
- package/utils/isPlainObject.d.ts +3 -4
- package/utils/isPlainObject.d.ts.map +1 -0
- package/utils/isPlainObject.js +11 -1
- package/utils/isPlainObject.js.map +1 -0
- package/utils/loadModels.d.ts +3 -4
- package/utils/loadModels.d.ts.map +1 -0
- package/utils/loadModels.js +29 -1
- package/utils/loadModels.js.map +1 -0
- package/utils/queryParser.d.ts +5 -8
- package/utils/queryParser.d.ts.map +1 -0
- package/utils/queryParser.js +102 -1
- package/utils/queryParser.js.map +1 -0
- package/utils/typeChecker.d.ts +3 -6
- package/utils/typeChecker.d.ts.map +1 -0
- package/utils/typeChecker.js +90 -1
- package/utils/typeChecker.js.map +1 -0
- package/driver/auth/index.d.ts +0 -34
- package/driver/auth/index.js +0 -1
- package/driver/auth/no-auth-provider.js +0 -1
- package/driver/auth/plain-text-auth-provider.js +0 -1
- package/driver/auth/provider.js +0 -1
- package/driver/client-options.js +0 -1
- package/driver/client.js +0 -1
- package/driver/concurrent/index.d.ts +0 -1
- package/driver/concurrent/index.js +0 -1
- package/driver/connection.js +0 -1
- package/driver/control-connection.js +0 -1
- package/driver/encoder.js +0 -1
- package/driver/errors.js +0 -1
- package/driver/execution-options.js +0 -1
- package/driver/execution-profile.js +0 -1
- package/driver/host-connection-pool.js +0 -1
- package/driver/host.js +0 -1
- package/driver/index.d.ts +0 -212
- package/driver/index.js +0 -1
- package/driver/mapping/cache.js +0 -1
- package/driver/mapping/doc-info-adapter.js +0 -1
- package/driver/mapping/index.d.ts +0 -142
- package/driver/mapping/index.js +0 -1
- package/driver/mapping/mapper.js +0 -1
- package/driver/mapping/mapping-handler.js +0 -1
- package/driver/mapping/model-batch-item.js +0 -1
- package/driver/mapping/model-batch-mapper.js +0 -1
- package/driver/mapping/model-mapper.js +0 -1
- package/driver/mapping/model-mapping-info.js +0 -1
- package/driver/mapping/object-selector.js +0 -1
- package/driver/mapping/q.js +0 -1
- package/driver/mapping/query-generator.js +0 -9
- package/driver/mapping/result-mapper.js +0 -4
- package/driver/mapping/result.js +0 -1
- package/driver/mapping/table-mappings.js +0 -1
- package/driver/mapping/tree.js +0 -1
- package/driver/metadata/aggregate.js +0 -1
- package/driver/metadata/client-state.js +0 -1
- package/driver/metadata/data-collection.js +0 -1
- package/driver/metadata/event-debouncer.js +0 -1
- package/driver/metadata/index.d.ts +0 -184
- package/driver/metadata/index.js +0 -1
- package/driver/metadata/materialized-view.js +0 -1
- package/driver/metadata/schema-function.js +0 -1
- package/driver/metadata/schema-index.js +0 -1
- package/driver/metadata/schema-parser.js +0 -1
- package/driver/metadata/table-metadata.js +0 -1
- package/driver/operation-state.js +0 -1
- package/driver/policies/address-resolution.js +0 -1
- package/driver/policies/index.d.ts +0 -135
- package/driver/policies/index.js +0 -1
- package/driver/policies/load-balancing.js +0 -1
- package/driver/policies/reconnection.js +0 -1
- package/driver/policies/retry.js +0 -1
- package/driver/policies/speculative-execution.js +0 -1
- package/driver/policies/timestamp-generation.js +0 -1
- package/driver/prepare-handler.js +0 -1
- package/driver/promise-utils.js +0 -1
- package/driver/readers.js +0 -1
- package/driver/request-execution.js +0 -1
- package/driver/request-handler.js +0 -1
- package/driver/requests.js +0 -1
- package/driver/stream-id-stack.js +0 -1
- package/driver/streams.js +0 -1
- package/driver/token.js +0 -1
- package/driver/tokenizer.js +0 -1
- package/driver/types/big-decimal.js +0 -1
- package/driver/types/duration.js +0 -1
- package/driver/types/index.d.ts +0 -320
- package/driver/types/index.js +0 -1
- package/driver/types/inet-address.js +0 -1
- package/driver/types/integer.js +0 -1
- package/driver/types/local-date.js +0 -1
- package/driver/types/local-time.js +0 -1
- package/driver/types/mutable-long.js +0 -1
- package/driver/types/protocol-version.js +0 -1
- package/driver/types/result-set.js +0 -1
- package/driver/types/result-stream.js +0 -1
- package/driver/types/row.js +0 -1
- package/driver/types/time-uuid.js +0 -1
- package/driver/types/tuple.js +0 -1
- package/driver/types/uuid.js +0 -1
- package/driver/types/vector.js +0 -1
- package/driver/types/version-number.js +0 -1
- package/driver/utils.js +0 -4
- package/driver/writers.js +0 -1
- package/package.js +0 -1
package/operations/countAll.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
async function
|
|
1
|
+
export default async function (timeoutMs = 60000) {
|
|
2
|
+
const cql = `SELECT COUNT(1) FROM ${this.client.config.keyspace}.${this.schema.table_name}`;
|
|
3
|
+
const queryOptions = {
|
|
4
|
+
prepare: true,
|
|
5
|
+
readTimeout: timeoutMs,
|
|
6
|
+
};
|
|
7
|
+
const operation = async () => {
|
|
8
|
+
const result = await this.client.driver.execute(cql, [], queryOptions);
|
|
9
|
+
return result.rows[0].count.toNumber();
|
|
10
|
+
};
|
|
11
|
+
return this.client.executeWithRetry(operation, `countAll on ${this.name}`);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=countAll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countAll.js","sourceRoot":"","sources":["../../src/operations/countAll.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,CAAC,KAAK,WAEnB,SAAS,GAAW,KAAK;IAEzB,MAAM,GAAG,GAAG,wBAAwB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;IAE3F,MAAM,YAAY,GAAG;QACpB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,SAAS;KACtB,CAAA;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,YAAY,CAAC,CAAA;QAEtE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;IACvC,CAAC,CAAA;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,eAAe,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AAC3E,CAAC"}
|
package/operations/delete.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { mapping } from "../driver
|
|
2
|
-
import
|
|
3
|
-
import { DeleteQueryOptions, Query } from "../types
|
|
4
|
-
|
|
5
|
-
//#
|
|
6
|
-
declare function deleteOP<T>(this: Model<any, T>, query: Query<T>, options?: DeleteQueryOptions<T>): mapping.ModelBatchItem;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { deleteOP as default };
|
|
1
|
+
import { mapping } from "../driver";
|
|
2
|
+
import type Model from "../model";
|
|
3
|
+
import { DeleteQueryOptions, Query } from "../types";
|
|
4
|
+
export default function deleteOP<T>(this: Model<any, T>, query: Query<T>, options?: DeleteQueryOptions<T>): mapping.ModelBatchItem;
|
|
5
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/operations/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGpD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,CAAC,EACjC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EACnB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,0BA2B/B"}
|
package/operations/delete.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import queryParser from "../utils/queryParser";
|
|
2
|
+
export default function deleteOP(query, options) {
|
|
3
|
+
query = queryParser(this, query);
|
|
4
|
+
const mapperOptions = {
|
|
5
|
+
fields: options?.fields,
|
|
6
|
+
ttl: options?.ttl,
|
|
7
|
+
ifExists: options?.ifExists,
|
|
8
|
+
when: options?.when,
|
|
9
|
+
deleteOnlyColumns: options?.deleteOnlyColumns,
|
|
10
|
+
};
|
|
11
|
+
if (options?.batch) {
|
|
12
|
+
return this.mapper.batching.remove(query, mapperOptions);
|
|
13
|
+
}
|
|
14
|
+
const operation = async () => {
|
|
15
|
+
const result = await this.mapper.remove(query, mapperOptions);
|
|
16
|
+
if (options?.raw === true) {
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
return this._wrap(result);
|
|
20
|
+
};
|
|
21
|
+
return this.client.executeWithRetry(operation, `delete on ${this.name}`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/operations/delete.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAE9C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAE/B,KAAe,EACf,OAA+B;IAE/B,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAEhC,MAAM,aAAa,GAA0B;QAC5C,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,GAAG,EAAE,OAAO,EAAE,GAAG;QACjB,QAAQ,EAAE,OAAO,EAAE,QAAQ;QAC3B,IAAI,EAAE,OAAO,EAAE,IAAI;QACnB,iBAAiB,EAAE,OAAO,EAAE,iBAAiB;KAC7C,CAAA;IAED,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;QAE7D,IAAI,OAAO,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,MAAM,CAAA;QACd,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,CAAC,CAAA;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AACzE,CAAC"}
|
package/operations/find.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
//#
|
|
5
|
-
declare function findOP<TDoc>(this: Model<any, TDoc>, query?: Query<TDoc>, options?: FindQueryOptions<TDoc>): Promise<any[]>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { findOP as default };
|
|
1
|
+
import type { Query, FindQueryOptions } from "../types";
|
|
2
|
+
import type Model from "../model";
|
|
3
|
+
export default function findOP<TDoc>(this: Model<any, TDoc>, query?: Query<TDoc>, options?: FindQueryOptions<TDoc>): Promise<any[]>;
|
|
4
|
+
//# sourceMappingURL=find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../src/operations/find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAIjC,wBAA8B,MAAM,CAAC,IAAI,EACxC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EACtB,KAAK,GAAE,KAAK,CAAC,IAAI,CAAM,EACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,kBAsBhC"}
|
package/operations/find.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import queryParser from "../utils/queryParser";
|
|
2
|
+
export default async function findOP(query = {}, options) {
|
|
3
|
+
query = queryParser(this, query);
|
|
4
|
+
const mapperOptions = {
|
|
5
|
+
fields: options?.fields,
|
|
6
|
+
orderBy: options?.orderBy,
|
|
7
|
+
limit: options?.limit,
|
|
8
|
+
};
|
|
9
|
+
const operation = async () => {
|
|
10
|
+
const result = await this.mapper.find(query, mapperOptions);
|
|
11
|
+
const rows = result.toArray();
|
|
12
|
+
if (options?.raw === true) {
|
|
13
|
+
return rows;
|
|
14
|
+
}
|
|
15
|
+
return rows.map((row) => this._wrap(row));
|
|
16
|
+
};
|
|
17
|
+
return this.client.executeWithRetry(operation, `find on ${this.name}`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../src/operations/find.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAG9C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM,CAEnC,KAAK,GAAgB,EAAE,EACvB,OAAgC;IAEhC,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAEhC,MAAM,aAAa,GAAwB;QAC1C,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,OAAO,EAAE,OAAO,EAAE,OAAO;QACzB,KAAK,EAAE,OAAO,EAAE,KAAK;KACrB,CAAA;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;QAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;QAE7B,IAAI,OAAO,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAA;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AACvE,CAAC"}
|
package/operations/findOne.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
//#
|
|
5
|
-
declare function findOneOP<TDoc>(this: Model<any, TDoc>, query?: Query<TDoc>, options?: FindQueryOptions<TDoc>): Promise<any>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { findOneOP as default };
|
|
1
|
+
import type { Query, FindQueryOptions } from "../types";
|
|
2
|
+
import type Model from "../model";
|
|
3
|
+
export default function findOneOP<TDoc>(this: Model<any, TDoc>, query?: Query<TDoc>, options?: FindQueryOptions<TDoc>): Promise<any>;
|
|
4
|
+
//# sourceMappingURL=findOne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../src/operations/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAIjC,wBAA8B,SAAS,CAAC,IAAI,EAC3C,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EACtB,KAAK,GAAE,KAAK,CAAC,IAAI,CAAM,EACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,gBAyBhC"}
|
package/operations/findOne.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import queryParser from "../utils/queryParser";
|
|
2
|
+
export default async function findOneOP(query = {}, options) {
|
|
3
|
+
query = queryParser(this, query);
|
|
4
|
+
const mapperOptions = {
|
|
5
|
+
fields: options?.fields,
|
|
6
|
+
orderBy: options?.orderBy,
|
|
7
|
+
limit: options?.limit,
|
|
8
|
+
};
|
|
9
|
+
const operation = async () => {
|
|
10
|
+
const result = await this.mapper.get(query, mapperOptions);
|
|
11
|
+
if (!result) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (options?.raw === true) {
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
return this._wrap(result);
|
|
18
|
+
};
|
|
19
|
+
return this.client.executeWithRetry(operation, `findOne on ${this.name}`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=findOne.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findOne.js","sourceRoot":"","sources":["../../src/operations/findOne.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAG9C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAEtC,KAAK,GAAgB,EAAE,EACvB,OAAgC;IAEhC,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAEhC,MAAM,aAAa,GAAwB;QAC1C,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,OAAO,EAAE,OAAO,EAAE,OAAO;QACzB,KAAK,EAAE,OAAO,EAAE,KAAK;KACrB,CAAA;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;QAE1D,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,IAAI,OAAO,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,MAAM,CAAA;QACd,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,CAAC,CAAA;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AAC1E,CAAC"}
|
package/operations/insert.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { mapping } from "../driver/mapping
|
|
2
|
-
import
|
|
3
|
-
import { InsertQueryOptions, Query } from "../types
|
|
4
|
-
|
|
5
|
-
//#
|
|
6
|
-
declare function insertOP<TDoc>(this: Model<any, TDoc>, query: Query<TDoc>, options?: InsertQueryOptions<TDoc>): mapping.ModelBatchItem;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { insertOP as default };
|
|
1
|
+
import { mapping } from "../driver/mapping";
|
|
2
|
+
import type Model from "../model";
|
|
3
|
+
import { InsertQueryOptions, Query } from "../types";
|
|
4
|
+
export default function insertOP<TDoc>(this: Model<any, TDoc>, query: Query<TDoc>, options?: InsertQueryOptions<TDoc>): mapping.ModelBatchItem;
|
|
5
|
+
//# sourceMappingURL=insert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../src/operations/insert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAIpD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,IAAI,EACpC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EACtB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAClB,OAAO,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,0BA2BlC"}
|
package/operations/insert.js
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fillDefaults from "../utils/fillDefaults";
|
|
2
|
+
import queryParser from "../utils/queryParser";
|
|
3
|
+
export default function insertOP(query, options) {
|
|
4
|
+
query = fillDefaults(this.schema, query);
|
|
5
|
+
query = queryParser(this, query);
|
|
6
|
+
const mapperOptions = {
|
|
7
|
+
fields: options?.fields,
|
|
8
|
+
ttl: options?.ttl,
|
|
9
|
+
ifNotExists: options?.ifNotExists,
|
|
10
|
+
};
|
|
11
|
+
if (options?.batch) {
|
|
12
|
+
return this.mapper.batching.insert(query, mapperOptions);
|
|
13
|
+
}
|
|
14
|
+
const operation = async () => {
|
|
15
|
+
const result = await this.mapper.insert(query, mapperOptions);
|
|
16
|
+
const rows = result.toArray();
|
|
17
|
+
if (options?.raw === true) {
|
|
18
|
+
return rows;
|
|
19
|
+
}
|
|
20
|
+
return rows.map((row) => this._wrap(row));
|
|
21
|
+
};
|
|
22
|
+
return this.client.executeWithRetry(operation, `insert on ${this.name}`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=insert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert.js","sourceRoot":"","sources":["../../src/operations/insert.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,uBAAuB,CAAA;AAChD,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAE9C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAE/B,KAAkB,EAClB,OAAkC;IAElC,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACxC,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAEhC,MAAM,aAAa,GAA0B;QAC5C,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,GAAG,EAAE,OAAO,EAAE,GAAG;QACjB,WAAW,EAAE,OAAO,EAAE,WAAW;KACjC,CAAA;IAED,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;QAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;QAE7B,IAAI,OAAO,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAA;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AACzE,CAAC"}
|
package/operations/sync.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#
|
|
4
|
-
declare function syncOP(this: Model<any, any>): Promise<void>;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { syncOP as default };
|
|
1
|
+
import type Model from "../model";
|
|
2
|
+
export default function syncOP(this: Model<any, any>): Promise<void>;
|
|
3
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/operations/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAGjC,wBAA8B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,iBAkBzD"}
|
package/operations/sync.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import generateCreateTableCQL from "../cql_gen/create_table";
|
|
2
|
+
export default async function syncOP() {
|
|
3
|
+
const tableExists = await this._tableExists();
|
|
4
|
+
if (tableExists) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
await this.client.driver.execute(generateCreateTableCQL(this));
|
|
9
|
+
console.log(`Table "${this.schema.table_name}" created successfully`);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
console.error(`Failed to create table "${this.schema.table_name}":`, error);
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/operations/sync.ts"],"names":[],"mappings":"AACA,OAAO,sBAAsB,MAAM,yBAAyB,CAAA;AAE5D,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM;IACnC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;IAE7C,IAAI,WAAW,EAAE,CAAC;QACjB,OAAM;IACP,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAA;QAE9D,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,UAAU,wBAAwB,CAAC,CAAA;IACtE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CACZ,2BAA2B,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EACrD,KAAK,CACL,CAAA;QACD,MAAM,KAAK,CAAA;IACZ,CAAC;AACF,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#
|
|
4
|
-
declare function export_default(this: Model<any, any>): Promise<boolean>;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { export_default as default };
|
|
1
|
+
import type Model from "../model";
|
|
2
|
+
export default function (this: Model<any, any>): Promise<boolean>;
|
|
3
|
+
//# sourceMappingURL=tableExists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableExists.d.ts","sourceRoot":"","sources":["../../src/operations/tableExists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,yBAA+B,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,oBA0BnD"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
async function
|
|
1
|
+
export default async function () {
|
|
2
|
+
const cql = `
|
|
2
3
|
SELECT table_name
|
|
3
4
|
FROM system_schema.tables
|
|
4
5
|
WHERE keyspace_name = ?
|
|
5
6
|
AND table_name = ?
|
|
6
|
-
|
|
7
|
+
`;
|
|
8
|
+
try {
|
|
9
|
+
const result = await this.client.driver.execute(cql, [this.client.config.keyspace, this.schema.table_name], {
|
|
10
|
+
prepare: true,
|
|
11
|
+
});
|
|
12
|
+
return result.rows.length > 0;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(`Failed to check if table "${this.schema.table_name}" exists:`, error);
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tableExists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableExists.js","sourceRoot":"","sources":["../../src/operations/tableExists.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,CAAC,KAAK;IACnB,MAAM,GAAG,GAAG;;;;;GAKV,CAAA;IAEF,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAC9C,GAAG,EACH,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EACrD;YACC,OAAO,EAAE,IAAI;SACb,CACD,CAAA;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CACZ,6BAA6B,IAAI,CAAC,MAAM,CAAC,UAAU,WAAW,EAC9D,KAAK,CACL,CAAA;QAED,OAAO,KAAK,CAAA;IACb,CAAC;AACF,CAAC"}
|
package/operations/update.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { mapping } from "../driver/mapping
|
|
2
|
-
import
|
|
3
|
-
import { Query, UpdateQueryOptions } from "../types
|
|
4
|
-
|
|
5
|
-
//#
|
|
6
|
-
declare function updateOP<TDoc>(this: Model<any, TDoc>, query: Query<TDoc>, options?: UpdateQueryOptions<TDoc>): mapping.ModelBatchItem;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { updateOP as default };
|
|
1
|
+
import { mapping } from "../driver/mapping";
|
|
2
|
+
import type Model from "../model";
|
|
3
|
+
import { Query, UpdateQueryOptions } from "../types";
|
|
4
|
+
export default function updateOP<TDoc>(this: Model<any, TDoc>, query: Query<TDoc>, options?: UpdateQueryOptions<TDoc>): mapping.ModelBatchItem;
|
|
5
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/operations/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAIpD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,IAAI,EACpC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EACtB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAClB,OAAO,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,0BAuClC"}
|
package/operations/update.js
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fillDefaults from "../utils/fillDefaults";
|
|
2
|
+
import queryParser from "../utils/queryParser";
|
|
3
|
+
export default function updateOP(query, options) {
|
|
4
|
+
query = fillDefaults(this.schema, query);
|
|
5
|
+
query = queryParser(this, query);
|
|
6
|
+
const mapperOptions = {
|
|
7
|
+
fields: options?.fields,
|
|
8
|
+
orderBy: options?.orderBy,
|
|
9
|
+
limit: options?.limit,
|
|
10
|
+
ttl: options?.ttl,
|
|
11
|
+
ifExists: options?.ifExists,
|
|
12
|
+
when: options?.when,
|
|
13
|
+
deleteOnlyColumns: options?.deleteOnlyColumns,
|
|
14
|
+
};
|
|
15
|
+
// if (typeof query.__v !== "undefined") {
|
|
16
|
+
// if (Number.isNaN(query.__v)) {
|
|
17
|
+
// query.__v = 0
|
|
18
|
+
// } else {
|
|
19
|
+
// query.__v = query.__v + 1
|
|
20
|
+
// }
|
|
21
|
+
// }
|
|
22
|
+
if (options?.batch) {
|
|
23
|
+
return this.mapper.batching.update(query, mapperOptions);
|
|
24
|
+
}
|
|
25
|
+
const operation = async () => {
|
|
26
|
+
const result = await this.mapper.update(query, mapperOptions);
|
|
27
|
+
const rows = result.toArray();
|
|
28
|
+
if (options?.raw === true) {
|
|
29
|
+
return rows;
|
|
30
|
+
}
|
|
31
|
+
return rows.map((row) => this._wrap(row));
|
|
32
|
+
};
|
|
33
|
+
return this.client.executeWithRetry(operation, `update on ${this.name}`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/operations/update.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,uBAAuB,CAAA;AAChD,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAE9C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAE/B,KAAkB,EAClB,OAAkC;IAElC,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACxC,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAEhC,MAAM,aAAa,GAA0B;QAC5C,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,OAAO,EAAE,OAAO,EAAE,OAAO;QACzB,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,GAAG,EAAE,OAAO,EAAE,GAAG;QACjB,QAAQ,EAAE,OAAO,EAAE,QAAQ;QAC3B,IAAI,EAAE,OAAO,EAAE,IAAI;QACnB,iBAAiB,EAAE,OAAO,EAAE,iBAAiB;KAC7C,CAAA;IAED,0CAA0C;IAC1C,kCAAkC;IAClC,kBAAkB;IAClB,YAAY;IACZ,8BAA8B;IAC9B,KAAK;IACL,IAAI;IAEJ,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;QAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;QAE7B,IAAI,OAAO,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAA;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AACzE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ragestudio/scylla-odm",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "An ODM for ScyllaDB/Cassandra",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RageStudio",
|
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
"types": "./index.d.ts",
|
|
24
24
|
"main": "./index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./index.d.ts",
|
|
29
|
+
"default": "./index.js"
|
|
30
|
+
},
|
|
31
|
+
"./types": {
|
|
32
|
+
"types": "./types.d.ts",
|
|
33
|
+
"default": "./types.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
26
36
|
"publishConfig": {
|
|
27
37
|
"access": "public"
|
|
28
38
|
},
|
|
@@ -30,12 +40,12 @@
|
|
|
30
40
|
"long": "^5.3.2"
|
|
31
41
|
},
|
|
32
42
|
"scripts": {
|
|
33
|
-
"build": "
|
|
43
|
+
"build": "tsgo && cp package.json dist && cp README.md dist",
|
|
34
44
|
"test": "vitest run"
|
|
35
45
|
},
|
|
36
46
|
"devDependencies": {
|
|
37
47
|
"@types/node": "^25.6.0",
|
|
38
|
-
"
|
|
48
|
+
"@typescript/native-preview": "^7.0.0-dev.20260619.1",
|
|
39
49
|
"typescript": "^6.0.3",
|
|
40
50
|
"vitest": "^4.1.5"
|
|
41
51
|
}
|
package/schema/index.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { TableClusteringOrder, TableKeys } from "../types
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
keys: TableKeys<T>;
|
|
7
|
-
clustering_order?: TableClusteringOrder<T>;
|
|
1
|
+
import { TableClusteringOrder, TableKeys } from "../types";
|
|
2
|
+
export interface SchemaParams<T> {
|
|
3
|
+
table_name: string;
|
|
4
|
+
keys: TableKeys<T>;
|
|
5
|
+
clustering_order?: TableClusteringOrder<T>;
|
|
8
6
|
}
|
|
9
|
-
declare class Schema<T> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export declare class Schema<T> {
|
|
8
|
+
readonly table_name: string;
|
|
9
|
+
readonly keys: TableKeys<T>;
|
|
10
|
+
readonly clustering_order: TableClusteringOrder<T> | undefined;
|
|
11
|
+
readonly fields: T;
|
|
12
|
+
constructor(params: SchemaParams<T>, fields: T);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export default Schema;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAE1D,MAAM,WAAW,YAAY,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAClB,gBAAgB,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAC1C;AAED,qBAAa,MAAM,CAAC,CAAC;IACpB,SAAgB,UAAU,EAAE,MAAM,CAAA;IAClC,SAAgB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAClC,SAAgB,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAErE,SAAgB,MAAM,EAAE,CAAC,CAAA;IAEzB,YAAY,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAgB7C;CACD;eAEc,MAAM"}
|
package/schema/index.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
export class Schema {
|
|
2
|
+
table_name;
|
|
3
|
+
keys;
|
|
4
|
+
clustering_order;
|
|
5
|
+
fields;
|
|
6
|
+
constructor(params, fields) {
|
|
7
|
+
if (typeof params !== "object") {
|
|
8
|
+
throw new Error("params must be an object");
|
|
9
|
+
}
|
|
10
|
+
if (typeof params.table_name !== "string") {
|
|
11
|
+
throw new Error("table_name is required");
|
|
12
|
+
}
|
|
13
|
+
if (!Array.isArray(params.keys)) {
|
|
14
|
+
throw new Error("keys is required to be an array");
|
|
15
|
+
}
|
|
16
|
+
this.table_name = params.table_name;
|
|
17
|
+
this.clustering_order = params.clustering_order;
|
|
18
|
+
this.keys = params.keys;
|
|
19
|
+
this.fields = fields;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export default Schema;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,MAAM;IACF,UAAU,CAAQ;IAClB,IAAI,CAAc;IAClB,gBAAgB,CAAqC;IAErD,MAAM,CAAG;IAEzB,YAAY,MAAuB,EAAE,MAAS;QAC7C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC5C,CAAC;QACD,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC1C,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;QACnD,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;QACnC,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAA;QAC/C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QAEvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACrB,CAAC;CACD;AAED,eAAe,MAAM,CAAA"}
|