@antelopejs/postgres 0.3.0 → 0.4.1
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/README.md +5 -5
- package/dist/config.d.ts +1 -1
- package/dist/config.js +51 -0
- package/dist/config.js.map +1 -1
- package/dist/implementations/database/external-access.d.ts +22 -0
- package/dist/implementations/database/external-access.js +59 -0
- package/dist/implementations/database/external-access.js.map +1 -0
- package/dist/implementations/database/external-catalog.d.ts +0 -1
- package/dist/implementations/database/external-catalog.js +2 -3
- package/dist/implementations/database/external-catalog.js.map +1 -1
- package/dist/implementations/database/external-discovery.d.ts +1 -15
- package/dist/implementations/database/external-discovery.js +4 -44
- package/dist/implementations/database/external-discovery.js.map +1 -1
- package/dist/implementations/database/external-profile.d.ts +1 -1
- package/dist/implementations/database/external-profile.js.map +1 -1
- package/dist/implementations/database/external-reference.js.map +1 -1
- package/dist/implementations/database/external-sample.d.ts +1 -1
- package/dist/implementations/database/member.js.map +1 -1
- package/dist/implementations/database/result.js +2 -3
- package/dist/implementations/database/result.js.map +1 -1
- package/dist/implementations/database/schema.d.ts +1 -0
- package/dist/implementations/database/schema.js +4 -0
- package/dist/implementations/database/schema.js.map +1 -1
- package/dist/pg-connection-parameters.d.ts +17 -0
- package/dist/pg-connection-parameters.js +8 -0
- package/dist/pg-connection-parameters.js.map +1 -0
- package/dist/probe-parameters.d.ts +5 -0
- package/dist/probe-parameters.js +44 -0
- package/dist/probe-parameters.js.map +1 -0
- package/dist/probe-url.d.ts +9 -0
- package/dist/probe-url.js +54 -0
- package/dist/probe-url.js.map +1 -0
- package/dist/probe.d.ts +2 -0
- package/dist/probe.js +188 -0
- package/dist/probe.js.map +1 -0
- package/dist/test/atomic.test.js +49 -32
- package/dist/test/atomic.test.js.map +1 -1
- package/dist/test/contention.test.js +20 -16
- package/dist/test/contention.test.js.map +1 -1
- package/dist/test/convergence.test.d.ts +1 -0
- package/dist/test/convergence.test.js +9 -0
- package/dist/test/convergence.test.js.map +1 -0
- package/dist/test/duplicate-key.test.js +38 -18
- package/dist/test/duplicate-key.test.js.map +1 -1
- package/dist/test/indexes.test.js +14 -13
- package/dist/test/indexes.test.js.map +1 -1
- package/dist/test/nested-paths.test.js +27 -18
- package/dist/test/nested-paths.test.js.map +1 -1
- package/dist/test/typed-operations.test.js +55 -38
- package/dist/test/typed-operations.test.js.map +1 -1
- package/dist/test/unit/config-fixture.d.ts +2 -0
- package/dist/test/unit/config-fixture.js +11 -0
- package/dist/test/unit/config-fixture.js.map +1 -0
- package/dist/test/unit/config.spec.js +2 -32
- package/dist/test/unit/config.spec.js.map +1 -1
- package/dist/test/unit/config.untyped.spec.d.ts +1 -0
- package/dist/test/unit/config.untyped.spec.js +34 -0
- package/dist/test/unit/config.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression-array-walk.spec.js +0 -8
- package/dist/test/unit/expression-array-walk.spec.js.map +1 -1
- package/dist/test/unit/expression-array-walk.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression-array-walk.untyped.spec.js +17 -0
- package/dist/test/unit/expression-array-walk.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression-array.spec.js +0 -18
- package/dist/test/unit/expression-array.spec.js.map +1 -1
- package/dist/test/unit/expression-array.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression-array.untyped.spec.js +32 -0
- package/dist/test/unit/expression-array.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression-date.spec.js +0 -21
- package/dist/test/unit/expression-date.spec.js.map +1 -1
- package/dist/test/unit/expression-date.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression-date.untyped.spec.js +33 -0
- package/dist/test/unit/expression-date.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression-numeric.spec.js +0 -20
- package/dist/test/unit/expression-numeric.spec.js.map +1 -1
- package/dist/test/unit/expression-numeric.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression-numeric.untyped.spec.js +31 -0
- package/dist/test/unit/expression-numeric.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression-object.spec.js +0 -12
- package/dist/test/unit/expression-object.spec.js.map +1 -1
- package/dist/test/unit/expression-object.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression-object.untyped.spec.js +23 -0
- package/dist/test/unit/expression-object.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression-string.spec.js +0 -5
- package/dist/test/unit/expression-string.spec.js.map +1 -1
- package/dist/test/unit/expression-string.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression-string.untyped.spec.js +14 -0
- package/dist/test/unit/expression-string.untyped.spec.js.map +1 -0
- package/dist/test/unit/expression.spec.js +0 -16
- package/dist/test/unit/expression.spec.js.map +1 -1
- package/dist/test/unit/expression.untyped.spec.d.ts +1 -0
- package/dist/test/unit/expression.untyped.spec.js +29 -0
- package/dist/test/unit/expression.untyped.spec.js.map +1 -0
- package/dist/test/unit/feeds-fixture.d.ts +30 -0
- package/dist/test/unit/feeds-fixture.js +65 -0
- package/dist/test/unit/feeds-fixture.js.map +1 -0
- package/dist/test/unit/feeds.spec.js +80 -143
- package/dist/test/unit/feeds.spec.js.map +1 -1
- package/dist/test/unit/feeds.untyped.spec.d.ts +1 -0
- package/dist/test/unit/feeds.untyped.spec.js +22 -0
- package/dist/test/unit/feeds.untyped.spec.js.map +1 -0
- package/dist/test/unit/fields.spec.js +0 -5
- package/dist/test/unit/fields.spec.js.map +1 -1
- package/dist/test/unit/fields.untyped.spec.d.ts +1 -0
- package/dist/test/unit/fields.untyped.spec.js +12 -0
- package/dist/test/unit/fields.untyped.spec.js.map +1 -0
- package/dist/test/unit/pipeline-fold-fixture.d.ts +10 -0
- package/dist/test/unit/pipeline-fold-fixture.js +46 -0
- package/dist/test/unit/pipeline-fold-fixture.js.map +1 -0
- package/dist/test/unit/pipeline-group.spec.js +0 -3
- package/dist/test/unit/pipeline-group.spec.js.map +1 -1
- package/dist/test/unit/pipeline-group.untyped.spec.d.ts +1 -0
- package/dist/test/unit/pipeline-group.untyped.spec.js +11 -0
- package/dist/test/unit/pipeline-group.untyped.spec.js.map +1 -0
- package/dist/test/unit/pipeline-lambda-ids.untyped.spec.d.ts +1 -0
- package/dist/test/unit/{pipeline-lambda-ids.spec.js → pipeline-lambda-ids.untyped.spec.js} +7 -7
- package/dist/test/unit/pipeline-lambda-ids.untyped.spec.js.map +1 -0
- package/dist/test/unit/pipeline-projection.spec.js +0 -7
- package/dist/test/unit/pipeline-projection.spec.js.map +1 -1
- package/dist/test/unit/pipeline-projection.untyped.spec.d.ts +1 -0
- package/dist/test/unit/pipeline-projection.untyped.spec.js +16 -0
- package/dist/test/unit/pipeline-projection.untyped.spec.js.map +1 -0
- package/dist/test/unit/pipeline-selection.spec.js +0 -31
- package/dist/test/unit/pipeline-selection.spec.js.map +1 -1
- package/dist/test/unit/pipeline-selection.untyped.spec.d.ts +1 -0
- package/dist/test/unit/pipeline-selection.untyped.spec.js +44 -0
- package/dist/test/unit/pipeline-selection.untyped.spec.js.map +1 -0
- package/dist/test/unit/pipeline.spec.js +6 -54
- package/dist/test/unit/pipeline.spec.js.map +1 -1
- package/dist/test/unit/pipeline.untyped.spec.d.ts +1 -0
- package/dist/test/unit/pipeline.untyped.spec.js +21 -0
- package/dist/test/unit/pipeline.untyped.spec.js.map +1 -0
- package/dist/test/unit/probe-parameters.spec.d.ts +1 -0
- package/dist/test/unit/probe-parameters.spec.js +17 -0
- package/dist/test/unit/probe-parameters.spec.js.map +1 -0
- package/dist/test/unit/selection-fixture.d.ts +15 -0
- package/dist/test/unit/selection-fixture.js +41 -0
- package/dist/test/unit/selection-fixture.js.map +1 -0
- package/dist/test/unit/selection.spec.js +45 -83
- package/dist/test/unit/selection.spec.js.map +1 -1
- package/dist/test/unit/selection.untyped.spec.d.ts +1 -0
- package/dist/test/unit/selection.untyped.spec.js +19 -0
- package/dist/test/unit/selection.untyped.spec.js.map +1 -0
- package/dist/test/unit/ssl-url.spec.d.ts +1 -0
- package/dist/test/unit/ssl-url.spec.js +147 -0
- package/dist/test/unit/ssl-url.spec.js.map +1 -0
- package/dist/test/unit/utils.spec.js +0 -13
- package/dist/test/unit/utils.spec.js.map +1 -1
- package/dist/test/unit/utils.untyped.spec.d.ts +1 -0
- package/dist/test/unit/utils.untyped.spec.js +21 -0
- package/dist/test/unit/utils.untyped.spec.js.map +1 -0
- package/dist/test/unit/value.spec.js +0 -4
- package/dist/test/unit/value.spec.js.map +1 -1
- package/dist/test/unit/value.untyped.spec.d.ts +1 -0
- package/dist/test/unit/value.untyped.spec.js +12 -0
- package/dist/test/unit/value.untyped.spec.js.map +1 -0
- package/dist/test/unit/writes-insert.spec.js +0 -9
- package/dist/test/unit/writes-insert.spec.js.map +1 -1
- package/dist/test/unit/writes-insert.untyped.spec.d.ts +1 -0
- package/dist/test/unit/writes-insert.untyped.spec.js +18 -0
- package/dist/test/unit/writes-insert.untyped.spec.js.map +1 -0
- package/dist/test/unit/writes-replace.spec.js +0 -3
- package/dist/test/unit/writes-replace.spec.js.map +1 -1
- package/dist/test/unit/writes-replace.untyped.spec.d.ts +1 -0
- package/dist/test/unit/writes-replace.untyped.spec.js +12 -0
- package/dist/test/unit/writes-replace.untyped.spec.js.map +1 -0
- package/dist/test/unit/writes-update.spec.js +0 -6
- package/dist/test/unit/writes-update.spec.js.map +1 -1
- package/dist/test/unit/writes-update.untyped.spec.d.ts +1 -0
- package/dist/test/unit/writes-update.untyped.spec.js +13 -0
- package/dist/test/unit/writes-update.untyped.spec.js.map +1 -0
- package/dist/test-external/catalog.test.js +1 -4
- package/dist/test-external/catalog.test.js.map +1 -1
- package/dist/test-external/native.test.js +19 -10
- package/dist/test-external/native.test.js.map +1 -1
- package/dist/test-external/probe-access.test.js +90 -0
- package/dist/test-external/probe-access.test.js.map +1 -0
- package/dist/test-external/probe-closing.test.d.ts +1 -0
- package/dist/test-external/probe-closing.test.js +111 -0
- package/dist/test-external/probe-closing.test.js.map +1 -0
- package/dist/test-external/probe-fixture.d.ts +36 -0
- package/dist/test-external/probe-fixture.js +166 -0
- package/dist/test-external/probe-fixture.js.map +1 -0
- package/dist/test-external/probe-refusals.test.d.ts +1 -0
- package/dist/test-external/probe-refusals.test.js +110 -0
- package/dist/test-external/probe-refusals.test.js.map +1 -0
- package/dist/test-external/probe-url.test.d.ts +1 -0
- package/dist/test-external/probe-url.test.js +242 -0
- package/dist/test-external/probe-url.test.js.map +1 -0
- package/dist/test-external/reads.test.js +51 -26
- package/dist/test-external/reads.test.js.map +1 -1
- package/dist/test-external/refusals.test.js +12 -7
- package/dist/test-external/refusals.test.js.map +1 -1
- package/dist/test-external/registration.test.js +8 -0
- package/dist/test-external/registration.test.js.map +1 -1
- package/dist/test-external/relays.d.ts +27 -0
- package/dist/test-external/relays.js +176 -0
- package/dist/test-external/relays.js.map +1 -0
- package/dist/test-external/sales.d.ts +4 -1
- package/dist/test-external/sales.js +38 -1
- package/dist/test-external/sales.js.map +1 -1
- package/dist/test-external/writes.test.js +84 -48
- package/dist/test-external/writes.test.js.map +1 -1
- package/package.json +11 -9
- package/dist/test/unit/pipeline-lambda-ids.spec.js.map +0 -1
- /package/dist/{test/unit/pipeline-lambda-ids.spec.d.ts → test-external/probe-access.test.d.ts} +0 -0
|
@@ -2,71 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const chai_1 = require("chai");
|
|
4
4
|
const common_1 = require("@antelopejs/interface-database/common");
|
|
5
|
-
const spec_fixture_1 = require("./spec-fixture");
|
|
6
|
-
const types_1 = require("../../implementations/database/types");
|
|
7
|
-
const context_1 = require("../../implementations/database/context");
|
|
8
|
-
const relation_1 = require("../../implementations/database/relation");
|
|
9
5
|
const pipeline_1 = require("../../implementations/database/pipeline");
|
|
10
|
-
const
|
|
11
|
-
fields: {
|
|
12
|
-
car: { column: "car", type: types_1.TEXT },
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
const TABLE = '"shop"."vehicles"';
|
|
16
|
-
const ROOT_ALIAS = "t0";
|
|
17
|
-
const INHERITED_STAGE = "constructor";
|
|
18
|
-
const REJECTED_STAGE = "changes";
|
|
19
|
-
const DEFERRED_STAGE = "someStageThisBackendHasNotBuilt";
|
|
20
|
-
const DEFERRAL = "The PostgreSQL backend does not implement something yet";
|
|
21
|
-
function WithDeferral(name, read) {
|
|
22
|
-
pipeline_1.DEFERRED_STAGES[name] = DEFERRAL;
|
|
23
|
-
try {
|
|
24
|
-
return read();
|
|
25
|
-
}
|
|
26
|
-
finally {
|
|
27
|
-
delete pipeline_1.DEFERRED_STAGES[name];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function NewContext() {
|
|
31
|
-
return new context_1.DecodingContext((0, spec_fixture_1.RefusingCompilers)());
|
|
32
|
-
}
|
|
33
|
-
function NewTable() {
|
|
34
|
-
return (0, relation_1.TableRelation)(TABLE, ROOT_ALIAS, {
|
|
35
|
-
schemaId: "shop",
|
|
36
|
-
tableId: "vehicles",
|
|
37
|
-
model: VEHICLES,
|
|
38
|
-
index: (name) => [name],
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function Apply(...stages) {
|
|
42
|
-
return (0, pipeline_1.ApplyStages)(NewTable(), stages, NewContext());
|
|
43
|
-
}
|
|
6
|
+
const pipeline_fold_fixture_1 = require("./pipeline-fold-fixture");
|
|
44
7
|
describe("ApplyStages", () => {
|
|
45
8
|
it("folds nothing over an empty stage list", () => {
|
|
46
|
-
const relation = NewTable();
|
|
47
|
-
(0, chai_1.expect)((0, pipeline_1.ApplyStages)(relation, [], NewContext())).to.equal(relation);
|
|
48
|
-
});
|
|
49
|
-
it("declines a stage named after an inherited member", () => {
|
|
50
|
-
(0, chai_1.expect)(() => Apply((0, common_1.QueryStage)(INHERITED_STAGE))).to.throw(`Unsupported query stage '${INHERITED_STAGE}'`);
|
|
51
|
-
});
|
|
52
|
-
it("names the stage a deferred message belongs to", () => {
|
|
53
|
-
WithDeferral(DEFERRED_STAGE, () => {
|
|
54
|
-
(0, chai_1.expect)(() => Apply((0, common_1.QueryStage)(DEFERRED_STAGE))).to.throw(`${DEFERRAL} (stage '${DEFERRED_STAGE}')`);
|
|
55
|
-
});
|
|
9
|
+
const relation = (0, pipeline_fold_fixture_1.NewTable)();
|
|
10
|
+
(0, chai_1.expect)((0, pipeline_1.ApplyStages)(relation, [], (0, pipeline_fold_fixture_1.NewContext)())).to.equal(relation);
|
|
56
11
|
});
|
|
57
12
|
it("defers nothing, now that every stage is dispatched or declined", () => {
|
|
58
13
|
(0, chai_1.expect)(Object.keys(pipeline_1.DEFERRED_STAGES)).to.deep.equal([]);
|
|
59
14
|
});
|
|
60
15
|
it("declines a change feed that reached the fold, which is one not last or one awaited", () => {
|
|
61
|
-
(0, chai_1.expect)(() => Apply((0, common_1.QueryStage)(REJECTED_STAGE))).to.throw("must be the last stage of a query and must be iterated rather than awaited");
|
|
16
|
+
(0, chai_1.expect)(() => (0, pipeline_fold_fixture_1.Apply)((0, common_1.QueryStage)(pipeline_fold_fixture_1.REJECTED_STAGE))).to.throw("must be the last stage of a query and must be iterated rather than awaited");
|
|
62
17
|
});
|
|
63
18
|
it("prefers the permanent rejection to a deferral of the same name", () => {
|
|
64
|
-
WithDeferral(REJECTED_STAGE, () => {
|
|
65
|
-
(0, chai_1.expect)(() => Apply((0, common_1.QueryStage)(REJECTED_STAGE))).to.throw(pipeline_1.REJECTED_STAGES[REJECTED_STAGE]);
|
|
19
|
+
(0, pipeline_fold_fixture_1.WithDeferral)(pipeline_fold_fixture_1.REJECTED_STAGE, () => {
|
|
20
|
+
(0, chai_1.expect)(() => (0, pipeline_fold_fixture_1.Apply)((0, common_1.QueryStage)(pipeline_fold_fixture_1.REJECTED_STAGE))).to.throw(pipeline_1.REJECTED_STAGES[pipeline_fold_fixture_1.REJECTED_STAGE]);
|
|
66
21
|
});
|
|
67
22
|
});
|
|
68
|
-
it("fails on the first stage it cannot apply", () => {
|
|
69
|
-
(0, chai_1.expect)(() => Apply((0, common_1.QueryStage)(REJECTED_STAGE), (0, common_1.QueryStage)(DEFERRED_STAGE))).to.throw(pipeline_1.REJECTED_STAGES[REJECTED_STAGE]);
|
|
70
|
-
});
|
|
71
23
|
});
|
|
72
24
|
//# sourceMappingURL=pipeline.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.spec.js","sourceRoot":"","sources":["../../../src/test/unit/pipeline.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,kEAAmE;AAEnE,
|
|
1
|
+
{"version":3,"file":"pipeline.spec.js","sourceRoot":"","sources":["../../../src/test/unit/pipeline.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,kEAAmE;AAEnE,sEAIiD;AACjD,mEAMiC;AAEjC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,QAAQ,GAAG,IAAA,gCAAQ,GAAE,CAAC;QAC5B,IAAA,aAAM,EAAC,IAAA,sBAAW,EAAC,QAAQ,EAAE,EAAE,EAAE,IAAA,kCAAU,GAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,IAAA,aAAM,EAAC,MAAM,CAAC,IAAI,CAAC,0BAAe,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oFAAoF,EAAE,GAAG,EAAE;QAC5F,IAAA,aAAM,EAAC,GAAG,EAAE,CAAC,IAAA,6BAAK,EAAC,IAAA,mBAAU,EAAC,sCAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CACtD,4EAA4E,CAC7E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,IAAA,oCAAY,EAAC,sCAAc,EAAE,GAAG,EAAE;YAChC,IAAA,aAAM,EAAC,GAAG,EAAE,CAAC,IAAA,6BAAK,EAAC,IAAA,mBAAU,EAAC,sCAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CACtD,0BAAe,CAAC,sCAAc,CAAC,CAChC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chai_1 = require("chai");
|
|
4
|
+
const common_1 = require("@antelopejs/interface-database/common");
|
|
5
|
+
const pipeline_1 = require("../../implementations/database/pipeline");
|
|
6
|
+
const pipeline_fold_fixture_1 = require("./pipeline-fold-fixture");
|
|
7
|
+
const INHERITED_STAGE = "constructor";
|
|
8
|
+
describe("ApplyStages", () => {
|
|
9
|
+
it("declines a stage named after an inherited member", () => {
|
|
10
|
+
(0, chai_1.expect)(() => (0, pipeline_fold_fixture_1.Apply)((0, common_1.QueryStage)(INHERITED_STAGE))).to.throw(`Unsupported query stage '${INHERITED_STAGE}'`);
|
|
11
|
+
});
|
|
12
|
+
it("names the stage a deferred message belongs to", () => {
|
|
13
|
+
(0, pipeline_fold_fixture_1.WithDeferral)(pipeline_fold_fixture_1.DEFERRED_STAGE, () => {
|
|
14
|
+
(0, chai_1.expect)(() => (0, pipeline_fold_fixture_1.Apply)((0, common_1.QueryStage)(pipeline_fold_fixture_1.DEFERRED_STAGE))).to.throw(`${pipeline_fold_fixture_1.DEFERRAL} (stage '${pipeline_fold_fixture_1.DEFERRED_STAGE}')`);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
it("fails on the first stage it cannot apply", () => {
|
|
18
|
+
(0, chai_1.expect)(() => (0, pipeline_fold_fixture_1.Apply)((0, common_1.QueryStage)(pipeline_fold_fixture_1.REJECTED_STAGE), (0, common_1.QueryStage)(pipeline_fold_fixture_1.DEFERRED_STAGE))).to.throw(pipeline_1.REJECTED_STAGES[pipeline_fold_fixture_1.REJECTED_STAGE]);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=pipeline.untyped.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.untyped.spec.js","sourceRoot":"","sources":["../../../src/test/unit/pipeline.untyped.spec.js"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,kEAAmE;AAEnE,sEAA0E;AAC1E,mEAMiC;AAEjC,MAAM,eAAe,GAAG,aAAa,CAAC;AAEtC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,IAAA,aAAM,EAAC,GAAG,EAAE,CAAC,IAAA,6BAAK,EAAC,IAAA,mBAAU,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CACvD,4BAA4B,eAAe,GAAG,CAC/C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,IAAA,oCAAY,EAAC,sCAAc,EAAE,GAAG,EAAE;YAChC,IAAA,aAAM,EAAC,GAAG,EAAE,CAAC,IAAA,6BAAK,EAAC,IAAA,mBAAU,EAAC,sCAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CACtD,GAAG,gCAAQ,YAAY,sCAAc,IAAI,CAC1C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,IAAA,aAAM,EAAC,GAAG,EAAE,CACV,IAAA,6BAAK,EAAC,IAAA,mBAAU,EAAC,sCAAc,CAAC,EAAE,IAAA,mBAAU,EAAC,sCAAc,CAAC,CAAC,CAC9D,CAAC,EAAE,CAAC,KAAK,CAAC,0BAAe,CAAC,sCAAc,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chai_1 = require("chai");
|
|
4
|
+
const pg_1 = require("pg");
|
|
5
|
+
const probe_parameters_1 = require("../../probe-parameters");
|
|
6
|
+
describe("the probe's connection parameter table", () => {
|
|
7
|
+
it("names every parameter pg reads from a connection string, and nothing else", () => {
|
|
8
|
+
const client = new pg_1.Client({
|
|
9
|
+
connectionString: "postgres://reader:secret@client-db:6543/erp",
|
|
10
|
+
keepAlive: true,
|
|
11
|
+
keepAliveInitialDelayMillis: 1000,
|
|
12
|
+
});
|
|
13
|
+
const read = Object.getOwnPropertyNames(client.connectionParameters);
|
|
14
|
+
(0, chai_1.expect)([...read].sort()).to.deep.equal([...probe_parameters_1.CONNECTION_PARAMETERS.keys()].sort());
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=probe-parameters.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-parameters.spec.js","sourceRoot":"","sources":["../../../src/test/unit/probe-parameters.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,2BAA4B;AAE5B,6DAA+D;AAE/D,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACtD,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;QACnF,MAAM,MAAM,GAAG,IAAI,WAAM,CAAC;YACxB,gBAAgB,EAAE,6CAA6C;YAC/D,SAAS,EAAE,IAAI;YACf,2BAA2B,EAAE,IAAI;SAClC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACrE,IAAA,aAAM,EAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CACpC,CAAC,GAAG,wCAAqB,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CACzC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CROSS_INSTANCE } from "@antelopejs/interface-database/schema";
|
|
2
|
+
import { type StagedObject } from "@antelopejs/interface-database/common";
|
|
3
|
+
import { DecodingContext } from "../../implementations/database/context";
|
|
4
|
+
import { type RootSelection } from "../../implementations/database/selection";
|
|
5
|
+
interface Vehicle {
|
|
6
|
+
car: string;
|
|
7
|
+
price: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const SCHEMA_ID = "shop";
|
|
10
|
+
export declare const TABLE_ID = "vehicles";
|
|
11
|
+
type InstanceId = string | typeof CROSS_INSTANCE | undefined;
|
|
12
|
+
export declare function NewContext(): DecodingContext;
|
|
13
|
+
export declare function Root(schemaId?: string, instanceId?: InstanceId): import("@antelopejs/interface-database").Table<Vehicle>;
|
|
14
|
+
export declare function Build(query: StagedObject, context: DecodingContext): RootSelection;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TABLE_ID = exports.SCHEMA_ID = void 0;
|
|
4
|
+
exports.NewContext = NewContext;
|
|
5
|
+
exports.Root = Root;
|
|
6
|
+
exports.Build = Build;
|
|
7
|
+
const interface_database_1 = require("@antelopejs/interface-database");
|
|
8
|
+
const common_1 = require("@antelopejs/interface-database/common");
|
|
9
|
+
const spec_fixture_1 = require("./spec-fixture");
|
|
10
|
+
const types_1 = require("../../implementations/database/types");
|
|
11
|
+
const context_1 = require("../../implementations/database/context");
|
|
12
|
+
const selection_1 = require("../../implementations/database/selection");
|
|
13
|
+
exports.SCHEMA_ID = "shop";
|
|
14
|
+
exports.TABLE_ID = "vehicles";
|
|
15
|
+
const VEHICLES = {
|
|
16
|
+
fields: {
|
|
17
|
+
car: { column: "car", type: types_1.TEXT },
|
|
18
|
+
price: { column: "price", type: types_1.FLOAT },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const INDEXES = new Map([["byCar", ["car", "price"]]]);
|
|
22
|
+
function StubOrigin(schemaId, tableId) {
|
|
23
|
+
return {
|
|
24
|
+
schemaId,
|
|
25
|
+
tableId,
|
|
26
|
+
model: VEHICLES,
|
|
27
|
+
index: (name) => INDEXES.get(name) ?? [name],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function NewContext() {
|
|
31
|
+
return new context_1.DecodingContext((0, spec_fixture_1.RefusingCompilers)(), StubOrigin);
|
|
32
|
+
}
|
|
33
|
+
function Root(schemaId = exports.SCHEMA_ID, instanceId) {
|
|
34
|
+
const schema = new interface_database_1.SchemaInstance((0, common_1.QueryStage)("schema", { id: schemaId }));
|
|
35
|
+
const instance = new interface_database_1.SchemaInstance((0, common_1.QueryStage)("instance", { id: instanceId }), schema);
|
|
36
|
+
return instance.table(exports.TABLE_ID);
|
|
37
|
+
}
|
|
38
|
+
function Build(query, context) {
|
|
39
|
+
return (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(query.build(), context));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=selection-fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-fixture.js","sourceRoot":"","sources":["../../../src/test/unit/selection-fixture.ts"],"names":[],"mappings":";;;AAiDA,gCAEC;AAED,oBASC;AAED,sBAKC;AApED,uEAAgE;AAChE,kEAG+C;AAE/C,iDAAgE;AAChE,gEAAmE;AAEnE,oEAAyE;AAEzE,wEAGkD;AAWrC,QAAA,SAAS,GAAG,MAAM,CAAC;AAC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AK,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -5,178 +5,140 @@ const schema_1 = require("@antelopejs/interface-database/schema");
|
|
|
5
5
|
const interface_database_1 = require("@antelopejs/interface-database");
|
|
6
6
|
const common_1 = require("@antelopejs/interface-database/common");
|
|
7
7
|
const spec_fixture_1 = require("./spec-fixture");
|
|
8
|
-
const types_1 = require("../../implementations/database/types");
|
|
9
|
-
const context_1 = require("../../implementations/database/context");
|
|
10
8
|
const selection_1 = require("../../implementations/database/selection");
|
|
11
|
-
const
|
|
9
|
+
const selection_fixture_1 = require("./selection-fixture");
|
|
12
10
|
const OTHER_SCHEMA_ID = "warehouse";
|
|
13
|
-
const TABLE_ID = "vehicles";
|
|
14
11
|
const LAMBDA_ID_FLOOR = 0;
|
|
15
12
|
const ROW_ID = LAMBDA_ID_FLOOR - 1;
|
|
16
|
-
const VEHICLES = {
|
|
17
|
-
fields: {
|
|
18
|
-
car: { column: "car", type: types_1.TEXT },
|
|
19
|
-
price: { column: "price", type: types_1.FLOAT },
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
const INDEXES = new Map([["byCar", ["car", "price"]]]);
|
|
23
|
-
function StubOrigin(schemaId, tableId) {
|
|
24
|
-
return {
|
|
25
|
-
schemaId,
|
|
26
|
-
tableId,
|
|
27
|
-
model: VEHICLES,
|
|
28
|
-
index: (name) => INDEXES.get(name) ?? [name],
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function NewContext() {
|
|
32
|
-
return new context_1.DecodingContext((0, spec_fixture_1.RefusingCompilers)(), StubOrigin);
|
|
33
|
-
}
|
|
34
|
-
function Root(schemaId = SCHEMA_ID, instanceId) {
|
|
35
|
-
const schema = new interface_database_1.SchemaInstance((0, common_1.QueryStage)("schema", { id: schemaId }));
|
|
36
|
-
const instance = new interface_database_1.SchemaInstance((0, common_1.QueryStage)("instance", { id: instanceId }), schema);
|
|
37
|
-
return instance.table(TABLE_ID);
|
|
38
|
-
}
|
|
39
|
-
function Build(query, context) {
|
|
40
|
-
return (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(query.build(), context));
|
|
41
|
-
}
|
|
42
13
|
function Cyclic() {
|
|
43
|
-
const payload = { nested: Root(OTHER_SCHEMA_ID) };
|
|
14
|
+
const payload = { nested: (0, selection_fixture_1.Root)(OTHER_SCHEMA_ID) };
|
|
44
15
|
payload.self = payload;
|
|
45
16
|
return payload;
|
|
46
17
|
}
|
|
47
18
|
describe("BuildRoot", () => {
|
|
48
19
|
it("reads the table the prefix names", () => {
|
|
49
|
-
const { relation } = Build(Root(), NewContext());
|
|
20
|
+
const { relation } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(), (0, selection_fixture_1.NewContext)());
|
|
50
21
|
(0, chai_1.expect)(relation.from).to.equal('"shop"."vehicles"');
|
|
51
22
|
(0, chai_1.expect)(relation.alias).to.equal("t0");
|
|
52
23
|
});
|
|
53
24
|
it("takes its alias from the context rather than assuming one", () => {
|
|
54
|
-
const context = NewContext();
|
|
25
|
+
const context = (0, selection_fixture_1.NewContext)();
|
|
55
26
|
(0, chai_1.expect)(context.nextAlias()).to.equal("t0");
|
|
56
|
-
(0, chai_1.expect)(Build(Root(), context).relation.alias).to.equal("t1");
|
|
27
|
+
(0, chai_1.expect)((0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(), context).relation.alias).to.equal("t1");
|
|
57
28
|
});
|
|
58
29
|
it("returns the stages that follow the prefix", () => {
|
|
59
|
-
const { rest } = Build(Root().orderBy("price", "asc"), NewContext());
|
|
30
|
+
const { rest } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)().orderBy("price", "asc"), (0, selection_fixture_1.NewContext)());
|
|
60
31
|
(0, chai_1.expect)(rest.map((stage) => stage.stage)).to.deep.equal(["orderBy"]);
|
|
61
32
|
});
|
|
62
33
|
it("returns no stages for a bare table read", () => {
|
|
63
|
-
(0, chai_1.expect)(Build(Root(), NewContext()).rest).to.deep.equal([]);
|
|
34
|
+
(0, chai_1.expect)((0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(), (0, selection_fixture_1.NewContext)()).rest).to.deep.equal([]);
|
|
64
35
|
});
|
|
65
36
|
it("restricts an unnamed instance to the empty instance id", () => {
|
|
66
|
-
const context = NewContext();
|
|
67
|
-
const { relation } = Build(Root(), context);
|
|
37
|
+
const context = (0, selection_fixture_1.NewContext)();
|
|
38
|
+
const { relation } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(), context);
|
|
68
39
|
(0, chai_1.expect)(relation.where).to.deep.equal(['("t0"."_instance" = ($1::text))']);
|
|
69
40
|
(0, chai_1.expect)(context.params.all()).to.deep.equal([""]);
|
|
70
41
|
});
|
|
71
42
|
it("restricts a named instance to its id", () => {
|
|
72
|
-
const context = NewContext();
|
|
73
|
-
const { relation } = Build(Root(SCHEMA_ID, "tenant-a"), context);
|
|
43
|
+
const context = (0, selection_fixture_1.NewContext)();
|
|
44
|
+
const { relation } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(selection_fixture_1.SCHEMA_ID, "tenant-a"), context);
|
|
74
45
|
(0, chai_1.expect)(relation.where).to.deep.equal(['("t0"."_instance" = ($1::text))']);
|
|
75
46
|
(0, chai_1.expect)(context.params.all()).to.deep.equal(["tenant-a"]);
|
|
76
47
|
});
|
|
77
48
|
it("reads across instances under CROSS_INSTANCE, burning no parameter", () => {
|
|
78
|
-
const context = NewContext();
|
|
79
|
-
const { relation } = Build(Root(SCHEMA_ID, schema_1.CROSS_INSTANCE), context);
|
|
49
|
+
const context = (0, selection_fixture_1.NewContext)();
|
|
50
|
+
const { relation } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(selection_fixture_1.SCHEMA_ID, schema_1.CROSS_INSTANCE), context);
|
|
80
51
|
(0, chai_1.expect)(relation.where).to.deep.equal([]);
|
|
81
52
|
(0, chai_1.expect)(context.params.all()).to.deep.equal([]);
|
|
82
53
|
});
|
|
83
|
-
it("rejects an instance id that is neither a string nor the sentinel", () => {
|
|
84
|
-
const query = Root(SCHEMA_ID, 7);
|
|
85
|
-
(0, chai_1.expect)(() => Build(query, NewContext())).to.throw("An instance id must be a string or CROSS_INSTANCE, received number");
|
|
86
|
-
});
|
|
87
54
|
it("starts in row mode addressing the origin's own columns", () => {
|
|
88
|
-
const { relation } = Build(Root(), NewContext());
|
|
55
|
+
const { relation } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(), (0, selection_fixture_1.NewContext)());
|
|
89
56
|
(0, chai_1.expect)(relation.projection).to.equal(undefined);
|
|
90
|
-
(0, chai_1.expect)(relation.origin?.schemaId).to.equal(SCHEMA_ID);
|
|
91
|
-
(0, chai_1.expect)(relation.origin?.tableId).to.equal(TABLE_ID);
|
|
57
|
+
(0, chai_1.expect)(relation.origin?.schemaId).to.equal(selection_fixture_1.SCHEMA_ID);
|
|
58
|
+
(0, chai_1.expect)(relation.origin?.tableId).to.equal(selection_fixture_1.TABLE_ID);
|
|
92
59
|
(0, chai_1.expect)(relation.source.field("price").sql).to.equal('"t0"."price"');
|
|
93
60
|
});
|
|
94
61
|
it("carries the injected index resolver onto the origin", () => {
|
|
95
|
-
const { relation } = Build(Root(), NewContext());
|
|
62
|
+
const { relation } = (0, selection_fixture_1.Build)((0, selection_fixture_1.Root)(), (0, selection_fixture_1.NewContext)());
|
|
96
63
|
(0, chai_1.expect)(relation.origin?.index("byCar")).to.deep.equal(["car", "price"]);
|
|
97
64
|
(0, chai_1.expect)(relation.origin?.index("price")).to.deep.equal(["price"]);
|
|
98
65
|
});
|
|
99
66
|
it("names the stage that was expected when the prefix is short", () => {
|
|
100
|
-
const stages = Root().build().slice(0, 2);
|
|
101
|
-
(0, chai_1.expect)(() => (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(stages, NewContext()))).to.throw("stage 2 is 'missing'");
|
|
67
|
+
const stages = (0, selection_fixture_1.Root)().build().slice(0, 2);
|
|
68
|
+
(0, chai_1.expect)(() => (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(stages, (0, selection_fixture_1.NewContext)()))).to.throw("stage 2 is 'missing'");
|
|
102
69
|
});
|
|
103
70
|
it("names the stage that was expected when the prefix is wrong", () => {
|
|
104
|
-
const stages = Root().build().slice(1);
|
|
105
|
-
(0, chai_1.expect)(() => (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(stages, NewContext()))).to.throw("stage 0 is 'instance'");
|
|
106
|
-
});
|
|
107
|
-
it("rejects a prefix stage carrying no id", () => {
|
|
108
|
-
const stages = Root().build();
|
|
109
|
-
stages[0] = (0, common_1.QueryStage)("schema");
|
|
110
|
-
(0, chai_1.expect)(() => (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(stages, NewContext()))).to.throw("The 'schema' stage of a table query is missing its id");
|
|
71
|
+
const stages = (0, selection_fixture_1.Root)().build().slice(1);
|
|
72
|
+
(0, chai_1.expect)(() => (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(stages, (0, selection_fixture_1.NewContext)()))).to.throw("stage 0 is 'instance'");
|
|
111
73
|
});
|
|
112
74
|
});
|
|
113
75
|
describe("RegisteredOrigin", () => {
|
|
114
76
|
it("answers out of the live registry, not a stub", () => {
|
|
115
|
-
(0, chai_1.expect)(() => (0, selection_1.RegisteredOrigin)("no-such-schema", TABLE_ID)).to.throw("Unknown schema 'no-such-schema'");
|
|
77
|
+
(0, chai_1.expect)(() => (0, selection_1.RegisteredOrigin)("no-such-schema", selection_fixture_1.TABLE_ID)).to.throw("Unknown schema 'no-such-schema'");
|
|
116
78
|
});
|
|
117
79
|
});
|
|
118
80
|
describe("CollectSchemaIds", () => {
|
|
119
81
|
it("reads the schema a staged object reaches when it is neither a proxy nor a query", () => {
|
|
120
|
-
const staged = new common_1.StagedObject((0, common_1.QueryStage)("schema", { id: SCHEMA_ID }));
|
|
121
|
-
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)([(0, common_1.QueryStage)("key", undefined, staged)])).to.deep.equal([SCHEMA_ID]);
|
|
82
|
+
const staged = new common_1.StagedObject((0, common_1.QueryStage)("schema", { id: selection_fixture_1.SCHEMA_ID }));
|
|
83
|
+
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)([(0, common_1.QueryStage)("key", undefined, staged)])).to.deep.equal([selection_fixture_1.SCHEMA_ID]);
|
|
122
84
|
});
|
|
123
85
|
it("collects the schema a plain table query names", () => {
|
|
124
|
-
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(Root().build())).to.deep.equal([SCHEMA_ID]);
|
|
86
|
+
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)((0, selection_fixture_1.Root)().build())).to.deep.equal([selection_fixture_1.SCHEMA_ID]);
|
|
125
87
|
});
|
|
126
88
|
it("walks into a query passed as a stage argument", () => {
|
|
127
|
-
const query = Root().union(Root(OTHER_SCHEMA_ID));
|
|
89
|
+
const query = (0, selection_fixture_1.Root)().union((0, selection_fixture_1.Root)(OTHER_SCHEMA_ID));
|
|
128
90
|
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([
|
|
129
|
-
SCHEMA_ID,
|
|
91
|
+
selection_fixture_1.SCHEMA_ID,
|
|
130
92
|
OTHER_SCHEMA_ID,
|
|
131
93
|
]);
|
|
132
94
|
});
|
|
133
95
|
it("reaches a query nested two levels deep", () => {
|
|
134
|
-
const query = Root().union(Root(OTHER_SCHEMA_ID).union(Root("depot")));
|
|
96
|
+
const query = (0, selection_fixture_1.Root)().union((0, selection_fixture_1.Root)(OTHER_SCHEMA_ID).union((0, selection_fixture_1.Root)("depot")));
|
|
135
97
|
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([
|
|
136
|
-
SCHEMA_ID,
|
|
98
|
+
selection_fixture_1.SCHEMA_ID,
|
|
137
99
|
OTHER_SCHEMA_ID,
|
|
138
100
|
"depot",
|
|
139
101
|
]);
|
|
140
102
|
});
|
|
141
103
|
it("de-duplicates a schema read twice", () => {
|
|
142
|
-
const query = Root().union(Root());
|
|
143
|
-
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([SCHEMA_ID]);
|
|
104
|
+
const query = (0, selection_fixture_1.Root)().union((0, selection_fixture_1.Root)());
|
|
105
|
+
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([selection_fixture_1.SCHEMA_ID]);
|
|
144
106
|
});
|
|
145
107
|
it("ignores a stage argument that is not a query", () => {
|
|
146
|
-
const query = Root().pluck("car", "price");
|
|
147
|
-
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([SCHEMA_ID]);
|
|
108
|
+
const query = (0, selection_fixture_1.Root)().pluck("car", "price");
|
|
109
|
+
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([selection_fixture_1.SCHEMA_ID]);
|
|
148
110
|
});
|
|
149
111
|
it("reaches a query in the document a lambda returns", () => {
|
|
150
|
-
const query = Root().map(() => ({ other: Root(OTHER_SCHEMA_ID) }));
|
|
112
|
+
const query = (0, selection_fixture_1.Root)().map(() => ({ other: (0, selection_fixture_1.Root)(OTHER_SCHEMA_ID) }));
|
|
151
113
|
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([
|
|
152
|
-
SCHEMA_ID,
|
|
114
|
+
selection_fixture_1.SCHEMA_ID,
|
|
153
115
|
OTHER_SCHEMA_ID,
|
|
154
116
|
]);
|
|
155
117
|
});
|
|
156
118
|
it("reaches a query inside an array inside a lambda's document", () => {
|
|
157
|
-
const query = Root().map(() => ({ others: [Root(OTHER_SCHEMA_ID)] }));
|
|
119
|
+
const query = (0, selection_fixture_1.Root)().map(() => ({ others: [(0, selection_fixture_1.Root)(OTHER_SCHEMA_ID)] }));
|
|
158
120
|
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([
|
|
159
|
-
SCHEMA_ID,
|
|
121
|
+
selection_fixture_1.SCHEMA_ID,
|
|
160
122
|
OTHER_SCHEMA_ID,
|
|
161
123
|
]);
|
|
162
124
|
});
|
|
163
125
|
it("reaches a query carried by a recorded expression's own stage", () => {
|
|
164
|
-
const compared = interface_database_1.ValueProxy.arg(ROW_ID).eq(Root(OTHER_SCHEMA_ID));
|
|
165
|
-
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(Root().default(compared).build())).to.deep.equal([
|
|
166
|
-
SCHEMA_ID,
|
|
126
|
+
const compared = interface_database_1.ValueProxy.arg(ROW_ID).eq((0, selection_fixture_1.Root)(OTHER_SCHEMA_ID));
|
|
127
|
+
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)((0, selection_fixture_1.Root)().default(compared).build())).to.deep.equal([
|
|
128
|
+
selection_fixture_1.SCHEMA_ID,
|
|
167
129
|
OTHER_SCHEMA_ID,
|
|
168
130
|
]);
|
|
169
131
|
});
|
|
170
132
|
it("does not walk a date as a document of its own keys", () => {
|
|
171
|
-
const dated = Object.assign(new Date(), { hidden: Root(OTHER_SCHEMA_ID) });
|
|
172
|
-
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(Root().default(dated).build())).to.deep.equal([
|
|
173
|
-
SCHEMA_ID,
|
|
133
|
+
const dated = Object.assign(new Date(), { hidden: (0, selection_fixture_1.Root)(OTHER_SCHEMA_ID) });
|
|
134
|
+
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)((0, selection_fixture_1.Root)().default(dated).build())).to.deep.equal([
|
|
135
|
+
selection_fixture_1.SCHEMA_ID,
|
|
174
136
|
]);
|
|
175
137
|
});
|
|
176
138
|
it("terminates on a cyclic payload and still reads past the cycle", () => {
|
|
177
|
-
const query = Root().default(Cyclic());
|
|
139
|
+
const query = (0, selection_fixture_1.Root)().default(Cyclic());
|
|
178
140
|
(0, chai_1.expect)((0, selection_1.CollectSchemaIds)(query.build())).to.deep.equal([
|
|
179
|
-
SCHEMA_ID,
|
|
141
|
+
selection_fixture_1.SCHEMA_ID,
|
|
180
142
|
OTHER_SCHEMA_ID,
|
|
181
143
|
]);
|
|
182
144
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.spec.js","sourceRoot":"","sources":["../../../src/test/unit/selection.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,kEAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"selection.spec.js","sourceRoot":"","sources":["../../../src/test/unit/selection.spec.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,kEAAuE;AACvE,uEAA4D;AAC5D,kEAG+C;AAE/C,iDAA6C;AAC7C,wEAIkD;AAClD,2DAM6B;AAE7B,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,MAAM,GAAG,eAAe,GAAG,CAAC,CAAC;AASnC,SAAS,MAAM;IACb,MAAM,OAAO,GAAkB,EAAE,MAAM,EAAE,IAAA,wBAAI,EAAC,eAAe,CAAC,EAAE,CAAC;IACjE,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,yBAAK,EAAC,IAAA,wBAAI,GAAE,EAAE,IAAA,8BAAU,GAAE,CAAC,CAAC;QACjD,IAAA,aAAM,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,OAAO,GAAG,IAAA,8BAAU,GAA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|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chai_1 = require("chai");
|
|
4
|
+
const common_1 = require("@antelopejs/interface-database/common");
|
|
5
|
+
const spec_fixture_1 = require("./spec-fixture");
|
|
6
|
+
const selection_1 = require("../../implementations/database/selection");
|
|
7
|
+
const selection_fixture_1 = require("./selection-fixture");
|
|
8
|
+
describe("BuildRoot", () => {
|
|
9
|
+
it("rejects an instance id that is neither a string nor the sentinel", () => {
|
|
10
|
+
const query = (0, selection_fixture_1.Root)(selection_fixture_1.SCHEMA_ID, 7);
|
|
11
|
+
(0, chai_1.expect)(() => (0, selection_fixture_1.Build)(query, (0, selection_fixture_1.NewContext)())).to.throw("An instance id must be a string or CROSS_INSTANCE, received number");
|
|
12
|
+
});
|
|
13
|
+
it("rejects a prefix stage carrying no id", () => {
|
|
14
|
+
const stages = (0, selection_fixture_1.Root)().build();
|
|
15
|
+
stages[0] = (0, common_1.QueryStage)("schema");
|
|
16
|
+
(0, chai_1.expect)(() => (0, spec_fixture_1.WithOptions)({}, () => (0, selection_1.BuildRoot)(stages, (0, selection_fixture_1.NewContext)()))).to.throw("The 'schema' stage of a table query is missing its id");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=selection.untyped.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.untyped.spec.js","sourceRoot":"","sources":["../../../src/test/unit/selection.untyped.spec.js"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,kEAAmE;AAEnE,iDAA6C;AAC7C,wEAAqE;AACrE,2DAAyE;AAEzE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC1E,MAAM,KAAK,GAAG,IAAA,wBAAI,EAAC,6BAAS,EAAE,CAAC,CAAC,CAAC;QACjC,IAAA,aAAM,EAAC,GAAG,EAAE,CAAC,IAAA,yBAAK,EAAC,KAAK,EAAE,IAAA,8BAAU,GAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAC/C,oEAAoE,CACrE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,MAAM,GAAG,IAAA,wBAAI,GAAE,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,CAAC,CAAC,CAAC,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC;QACjC,IAAA,aAAM,EAAC,GAAG,EAAE,CACV,IAAA,0BAAW,EAAC,EAAE,EAAE,GAAG,EAAE,CAAC,IAAA,qBAAS,EAAC,MAAM,EAAE,IAAA,8BAAU,GAAE,CAAC,CAAC,CACvD,CAAC,EAAE,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|