@antelopejs/interface-database-decorators 0.1.10 → 0.1.12
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 +9 -7
- package/dist/common.js.map +1 -1
- package/dist/database.js +18 -2
- package/dist/database.js.map +1 -1
- package/dist/model.js +48 -29
- package/dist/model.js.map +1 -1
- package/dist/modifiers/common.d.ts +24 -4
- package/dist/modifiers/common.js +104 -130
- package/dist/modifiers/common.js.map +1 -1
- package/dist/modifiers/encryption.js +14 -9
- package/dist/modifiers/encryption.js.map +1 -1
- package/dist/modifiers/hash.d.ts +46 -4
- package/dist/modifiers/hash.js +172 -14
- package/dist/modifiers/hash.js.map +1 -1
- package/dist/modifiers/internal/kinds.d.ts +13 -0
- package/dist/modifiers/internal/kinds.js +33 -0
- package/dist/modifiers/internal/kinds.js.map +1 -0
- package/dist/modifiers/internal/records.d.ts +31 -0
- package/dist/modifiers/internal/records.js +56 -0
- package/dist/modifiers/internal/records.js.map +1 -0
- package/dist/modifiers/localization.js +4 -2
- package/dist/modifiers/localization.js.map +1 -1
- package/dist/schema.js +1 -2
- package/dist/schema.js.map +1 -1
- package/dist/table.js +21 -6
- package/dist/table.js.map +1 -1
- package/dist/tests/codec_helpers.d.ts +6 -2
- package/dist/tests/codec_helpers.js +18 -14
- package/dist/tests/codec_helpers.js.map +1 -1
- package/dist/tests/common.test.js +38 -46
- package/dist/tests/common.test.js.map +1 -1
- package/dist/tests/cross_instance.test.js +27 -2
- package/dist/tests/cross_instance.test.js.map +1 -1
- package/dist/tests/database.test.js +278 -256
- package/dist/tests/database.test.js.map +1 -1
- package/dist/tests/hash_upgrade.test.d.ts +1 -0
- package/dist/tests/hash_upgrade.test.js +132 -0
- package/dist/tests/hash_upgrade.test.js.map +1 -0
- package/dist/tests/helpers/hash-rows.d.ts +40 -0
- package/dist/tests/helpers/hash-rows.js +41 -0
- package/dist/tests/helpers/hash-rows.js.map +1 -0
- package/dist/tests/helpers/other-instance.d.ts +1 -1
- package/dist/tests/helpers/other-instance.js +41 -9
- package/dist/tests/helpers/other-instance.js.map +1 -1
- package/dist/tests/integration.test.js +485 -485
- package/dist/tests/integration.test.js.map +1 -1
- package/dist/tests/model.test.js +293 -308
- package/dist/tests/model.test.js.map +1 -1
- package/dist/tests/modifiers/autodate.test.js +80 -86
- package/dist/tests/modifiers/autodate.test.js.map +1 -1
- package/dist/tests/modifiers/common.test.js +181 -195
- package/dist/tests/modifiers/common.test.js.map +1 -1
- package/dist/tests/modifiers/encryption.test.js +149 -155
- package/dist/tests/modifiers/encryption.test.js.map +1 -1
- package/dist/tests/modifiers/hash.test.js +386 -99
- package/dist/tests/modifiers/hash.test.js.map +1 -1
- package/dist/tests/modifiers/localization.test.js +186 -196
- package/dist/tests/modifiers/localization.test.js.map +1 -1
- package/dist/tests/partial_update.test.d.ts +1 -0
- package/dist/tests/partial_update.test.js +55 -0
- package/dist/tests/partial_update.test.js.map +1 -0
- package/dist/tests/relation.test.js +92 -97
- package/dist/tests/relation.test.js.map +1 -1
- package/dist/tests/schema.test.js +101 -106
- package/dist/tests/schema.test.js.map +1 -1
- package/dist/tests/table.test.js +124 -132
- package/dist/tests/table.test.js.map +1 -1
- package/docs/3.table-modifiers.md +36 -15
- package/package.json +14 -3
- package/skills/database-decorators-interface/SKILL.md +4 -2
- package/skills/database-decorators-interface/cases.json +71 -0
|
@@ -11,273 +11,295 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const chai_1 = require("chai");
|
|
13
13
|
const interface_database_1 = require("@antelopejs/interface-database");
|
|
14
|
-
const schema_1 = require("
|
|
15
|
-
const database_1 = require("
|
|
16
|
-
const model_1 = require("
|
|
17
|
-
const table_1 = require("
|
|
14
|
+
const schema_1 = require("../schema");
|
|
15
|
+
const database_1 = require("../database");
|
|
16
|
+
const model_1 = require("../model");
|
|
17
|
+
const table_1 = require("../table");
|
|
18
18
|
const codec_helpers_1 = require("./codec_helpers");
|
|
19
19
|
describe("Database - initialization", () => {
|
|
20
|
-
it("creates a schema", async () =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
it("
|
|
31
|
-
|
|
20
|
+
it("creates a schema", async () => {
|
|
21
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
22
|
+
};
|
|
23
|
+
_TestTable = __decorate([
|
|
24
|
+
(0, schema_1.RegisterTable)("test_table", "test-new-schema")
|
|
25
|
+
], _TestTable);
|
|
26
|
+
await (0, database_1.RegisterSchema)("test-new-schema");
|
|
27
|
+
const schema = interface_database_1.Schema.get("test-new-schema");
|
|
28
|
+
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
29
|
+
});
|
|
30
|
+
it("creates tables with default primary key", async () => {
|
|
31
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
32
|
+
};
|
|
33
|
+
_TestTable = __decorate([
|
|
34
|
+
(0, schema_1.RegisterTable)("pk_table", "test-pk-schema")
|
|
35
|
+
], _TestTable);
|
|
36
|
+
await (0, database_1.RegisterSchema)("test-pk-schema");
|
|
37
|
+
const schema = interface_database_1.Schema.get("test-pk-schema");
|
|
38
|
+
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
39
|
+
});
|
|
40
|
+
it("creates tables with indexes", async () => {
|
|
41
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, table_1.Index)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], _TestTable.prototype, "name", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, table_1.Index)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], _TestTable.prototype, "email", void 0);
|
|
51
|
+
_TestTable = __decorate([
|
|
52
|
+
(0, schema_1.RegisterTable)("idx_table", "test-idx-schema")
|
|
53
|
+
], _TestTable);
|
|
54
|
+
await (0, database_1.RegisterSchema)("test-idx-schema");
|
|
55
|
+
const schema = interface_database_1.Schema.get("test-idx-schema");
|
|
56
|
+
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
57
|
+
});
|
|
58
|
+
it("creates tables with grouped indexes", async () => {
|
|
59
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
60
|
+
};
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, table_1.Index)({ group: "user_search" }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], _TestTable.prototype, "name", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, table_1.Index)({ group: "user_search" }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], _TestTable.prototype, "email", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, table_1.Index)({ group: "age_range" }),
|
|
71
|
+
__metadata("design:type", Number)
|
|
72
|
+
], _TestTable.prototype, "age", void 0);
|
|
73
|
+
_TestTable = __decorate([
|
|
74
|
+
(0, schema_1.RegisterTable)("grp_table", "test-grp-schema")
|
|
75
|
+
], _TestTable);
|
|
76
|
+
await (0, database_1.RegisterSchema)("test-grp-schema");
|
|
77
|
+
const schema = interface_database_1.Schema.get("test-grp-schema");
|
|
78
|
+
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
79
|
+
});
|
|
80
|
+
it("marks a single-field index as cross-instance", async () => {
|
|
81
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
82
|
+
};
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, table_1.Index)({ crossInstance: true }),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], _TestTable.prototype, "email", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, table_1.Index)(),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], _TestTable.prototype, "name", void 0);
|
|
91
|
+
_TestTable = __decorate([
|
|
92
|
+
(0, schema_1.RegisterTable)("cross_single", "test-cross-single-schema")
|
|
93
|
+
], _TestTable);
|
|
94
|
+
await (0, database_1.RegisterSchema)("test-cross-single-schema");
|
|
95
|
+
const indexes = getIndexDefinitions("test-cross-single-schema", "cross_single");
|
|
96
|
+
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
97
|
+
email: { fields: undefined, crossInstance: true },
|
|
98
|
+
name: { fields: undefined },
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
it("marks a group index as cross-instance when one member sets it", async () => {
|
|
102
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
103
|
+
};
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, table_1.Index)({ group: "user_search" }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], _TestTable.prototype, "name", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, table_1.Index)({ group: "user_search", crossInstance: true }),
|
|
110
|
+
__metadata("design:type", String)
|
|
111
|
+
], _TestTable.prototype, "email", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, table_1.Index)({ group: "age_range" }),
|
|
114
|
+
__metadata("design:type", Number)
|
|
115
|
+
], _TestTable.prototype, "age", void 0);
|
|
116
|
+
_TestTable = __decorate([
|
|
117
|
+
(0, schema_1.RegisterTable)("cross_group", "test-cross-group-schema")
|
|
118
|
+
], _TestTable);
|
|
119
|
+
await (0, database_1.RegisterSchema)("test-cross-group-schema");
|
|
120
|
+
const indexes = getIndexDefinitions("test-cross-group-schema", "cross_group");
|
|
121
|
+
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
122
|
+
user_search: { fields: ["name", "email"], crossInstance: true },
|
|
123
|
+
age_range: { fields: ["age"] },
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
it("marks a group index as unique when one member sets it", async () => {
|
|
127
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
128
|
+
};
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, table_1.Index)({ unique: true }),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], _TestTable.prototype, "slug", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, table_1.Index)({ group: "full_name" }),
|
|
135
|
+
__metadata("design:type", String)
|
|
136
|
+
], _TestTable.prototype, "lastName", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, table_1.Index)({ group: "full_name", unique: true }),
|
|
139
|
+
__metadata("design:type", String)
|
|
140
|
+
], _TestTable.prototype, "firstName", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, table_1.Index)(),
|
|
143
|
+
__metadata("design:type", Number)
|
|
144
|
+
], _TestTable.prototype, "age", void 0);
|
|
145
|
+
_TestTable = __decorate([
|
|
146
|
+
(0, schema_1.RegisterTable)("unique_group", "test-unique-group-schema")
|
|
147
|
+
], _TestTable);
|
|
148
|
+
await (0, database_1.RegisterSchema)("test-unique-group-schema");
|
|
149
|
+
const indexes = getIndexDefinitions("test-unique-group-schema", "unique_group");
|
|
150
|
+
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
151
|
+
slug: { fields: undefined, unique: true },
|
|
152
|
+
full_name: { fields: ["lastName", "firstName"], unique: true },
|
|
153
|
+
age: { fields: undefined },
|
|
154
|
+
});
|
|
155
|
+
});
|
|
32
156
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, table_1.Index)(),
|
|
58
|
-
__metadata("design:type", String)
|
|
59
|
-
], _TestTable.prototype, "name", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, table_1.Index)(),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], _TestTable.prototype, "email", void 0);
|
|
64
|
-
_TestTable = __decorate([
|
|
65
|
-
(0, schema_1.RegisterTable)("idx_table", "test-idx-schema")
|
|
66
|
-
], _TestTable);
|
|
67
|
-
await (0, database_1.RegisterSchema)("test-idx-schema");
|
|
68
|
-
const schema = interface_database_1.Schema.get("test-idx-schema");
|
|
69
|
-
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
70
|
-
}
|
|
71
|
-
async function CreateTablesWithGroupedIndexesTest() {
|
|
72
|
-
let _TestTable = class _TestTable extends table_1.Table {
|
|
73
|
-
};
|
|
74
|
-
__decorate([
|
|
75
|
-
(0, table_1.Index)({ group: "user_search" }),
|
|
76
|
-
__metadata("design:type", String)
|
|
77
|
-
], _TestTable.prototype, "name", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, table_1.Index)({ group: "user_search" }),
|
|
80
|
-
__metadata("design:type", String)
|
|
81
|
-
], _TestTable.prototype, "email", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, table_1.Index)({ group: "age_range" }),
|
|
84
|
-
__metadata("design:type", Number)
|
|
85
|
-
], _TestTable.prototype, "age", void 0);
|
|
86
|
-
_TestTable = __decorate([
|
|
87
|
-
(0, schema_1.RegisterTable)("grp_table", "test-grp-schema")
|
|
88
|
-
], _TestTable);
|
|
89
|
-
await (0, database_1.RegisterSchema)("test-grp-schema");
|
|
90
|
-
const schema = interface_database_1.Schema.get("test-grp-schema");
|
|
91
|
-
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
92
|
-
}
|
|
93
|
-
async function MarksSingleFieldIndexCrossInstanceTest() {
|
|
94
|
-
let _TestTable = class _TestTable extends table_1.Table {
|
|
95
|
-
};
|
|
96
|
-
__decorate([
|
|
97
|
-
(0, table_1.Index)({ crossInstance: true }),
|
|
98
|
-
__metadata("design:type", String)
|
|
99
|
-
], _TestTable.prototype, "email", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, table_1.Index)(),
|
|
102
|
-
__metadata("design:type", String)
|
|
103
|
-
], _TestTable.prototype, "name", void 0);
|
|
104
|
-
_TestTable = __decorate([
|
|
105
|
-
(0, schema_1.RegisterTable)("cross_single", "test-cross-single-schema")
|
|
106
|
-
], _TestTable);
|
|
107
|
-
await (0, database_1.RegisterSchema)("test-cross-single-schema");
|
|
108
|
-
const indexes = getIndexDefinitions("test-cross-single-schema", "cross_single");
|
|
109
|
-
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
110
|
-
email: { fields: undefined, crossInstance: true },
|
|
111
|
-
name: { fields: undefined },
|
|
157
|
+
describe("Database - initialization", () => {
|
|
158
|
+
it("leaves index definitions unchanged without crossInstance", async () => {
|
|
159
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
160
|
+
};
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, table_1.Index)(),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], _TestTable.prototype, "name", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, table_1.Index)({ group: "user_search" }),
|
|
167
|
+
__metadata("design:type", String)
|
|
168
|
+
], _TestTable.prototype, "email", void 0);
|
|
169
|
+
_TestTable = __decorate([
|
|
170
|
+
(0, schema_1.RegisterTable)("cross_none", "test-cross-none-schema")
|
|
171
|
+
], _TestTable);
|
|
172
|
+
await (0, database_1.RegisterSchema)("test-cross-none-schema");
|
|
173
|
+
const indexes = getIndexDefinitions("test-cross-none-schema", "cross_none");
|
|
174
|
+
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
175
|
+
name: { fields: undefined },
|
|
176
|
+
user_search: { fields: ["email"] },
|
|
177
|
+
});
|
|
178
|
+
const hasCrossInstanceKey = Object.values(indexes).some((index) => "crossInstance" in index);
|
|
179
|
+
(0, chai_1.expect)(hasCrossInstanceKey).to.equal(false);
|
|
112
180
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
user_search: { fields: ["name", "email"], crossInstance: true },
|
|
136
|
-
age_range: { fields: ["age"] },
|
|
181
|
+
it("creates tables with fixture data", async () => {
|
|
182
|
+
const testData = [
|
|
183
|
+
{ id: "1", name: "Test User 1" },
|
|
184
|
+
{ id: "2", name: "Test User 2" },
|
|
185
|
+
];
|
|
186
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
187
|
+
};
|
|
188
|
+
_TestTable = __decorate([
|
|
189
|
+
(0, table_1.Fixture)(() => testData),
|
|
190
|
+
(0, schema_1.RegisterTable)("fixture_table", "test-fixture-schema")
|
|
191
|
+
], _TestTable);
|
|
192
|
+
await (0, database_1.RegisterSchema)("test-fixture-schema");
|
|
193
|
+
const schema = interface_database_1.Schema.get("test-fixture-schema");
|
|
194
|
+
if (!schema)
|
|
195
|
+
throw new Error("Schema not found");
|
|
196
|
+
const result = await schema.instance().table("fixture_table");
|
|
197
|
+
for (const val of result) {
|
|
198
|
+
delete val._id;
|
|
199
|
+
delete val._instance;
|
|
200
|
+
}
|
|
201
|
+
const sortById = (a, b) => a.id.localeCompare(b.id);
|
|
202
|
+
(0, chai_1.expect)(result.sort(sortById)).to.deep.equal(testData.sort(sortById));
|
|
137
203
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
], _TestTable.prototype, "firstName", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
(0, table_1.Index)(),
|
|
156
|
-
__metadata("design:type", Number)
|
|
157
|
-
], _TestTable.prototype, "age", void 0);
|
|
158
|
-
_TestTable = __decorate([
|
|
159
|
-
(0, schema_1.RegisterTable)("unique_group", "test-unique-group-schema")
|
|
160
|
-
], _TestTable);
|
|
161
|
-
await (0, database_1.RegisterSchema)("test-unique-group-schema");
|
|
162
|
-
const indexes = getIndexDefinitions("test-unique-group-schema", "unique_group");
|
|
163
|
-
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
164
|
-
slug: { fields: undefined, unique: true },
|
|
165
|
-
full_name: { fields: ["lastName", "firstName"], unique: true },
|
|
166
|
-
age: { fields: undefined },
|
|
204
|
+
it("writes one row when two processes register an id-less fixture at once", async () => {
|
|
205
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
206
|
+
};
|
|
207
|
+
_TestTable = __decorate([
|
|
208
|
+
(0, table_1.Fixture)(() => [{ name: "Only row" }]),
|
|
209
|
+
(0, schema_1.RegisterTable)("fixture_race_no_id", "test-fixture-race-no-id")
|
|
210
|
+
], _TestTable);
|
|
211
|
+
await Promise.all([
|
|
212
|
+
(0, database_1.RegisterSchema)("test-fixture-race-no-id"),
|
|
213
|
+
(0, database_1.RegisterSchema)("test-fixture-race-no-id"),
|
|
214
|
+
]);
|
|
215
|
+
const schema = interface_database_1.Schema.get("test-fixture-race-no-id");
|
|
216
|
+
if (!schema)
|
|
217
|
+
throw new Error("Schema not found");
|
|
218
|
+
(0, chai_1.expect)(await schema.instance().table("fixture_race_no_id")).to.have.length(1);
|
|
167
219
|
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
await (0, database_1.RegisterSchema)("test-cross-none-schema");
|
|
184
|
-
const indexes = getIndexDefinitions("test-cross-none-schema", "cross_none");
|
|
185
|
-
(0, chai_1.expect)(indexes).to.deep.equal({
|
|
186
|
-
name: { fields: undefined },
|
|
187
|
-
user_search: { fields: ["email"] },
|
|
220
|
+
it("does not fail the process that loses a fixture insert", async () => {
|
|
221
|
+
let _TestTable = class _TestTable extends table_1.Table {
|
|
222
|
+
};
|
|
223
|
+
_TestTable = __decorate([
|
|
224
|
+
(0, table_1.Fixture)(() => [{ _id: "only-row", name: "Only row" }]),
|
|
225
|
+
(0, schema_1.RegisterTable)("fixture_race_id", "test-fixture-race-id")
|
|
226
|
+
], _TestTable);
|
|
227
|
+
await Promise.all([
|
|
228
|
+
(0, database_1.RegisterSchema)("test-fixture-race-id"),
|
|
229
|
+
(0, database_1.RegisterSchema)("test-fixture-race-id"),
|
|
230
|
+
]);
|
|
231
|
+
const schema = interface_database_1.Schema.get("test-fixture-race-id");
|
|
232
|
+
if (!schema)
|
|
233
|
+
throw new Error("Schema not found");
|
|
234
|
+
(0, chai_1.expect)(await schema.instance().table("fixture_race_id")).to.have.length(1);
|
|
188
235
|
});
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
236
|
+
it("handles multiple tables", async () => {
|
|
237
|
+
let _UserTable = class _UserTable extends table_1.Table {
|
|
238
|
+
};
|
|
239
|
+
__decorate([
|
|
240
|
+
(0, table_1.Index)(),
|
|
241
|
+
__metadata("design:type", String)
|
|
242
|
+
], _UserTable.prototype, "email", void 0);
|
|
243
|
+
_UserTable = __decorate([
|
|
244
|
+
(0, schema_1.RegisterTable)("users", "test-multi-table-schema")
|
|
245
|
+
], _UserTable);
|
|
246
|
+
let _ProductTable = class _ProductTable extends table_1.Table {
|
|
247
|
+
};
|
|
248
|
+
__decorate([
|
|
249
|
+
(0, table_1.Index)(),
|
|
250
|
+
__metadata("design:type", String)
|
|
251
|
+
], _ProductTable.prototype, "name", void 0);
|
|
252
|
+
_ProductTable = __decorate([
|
|
253
|
+
(0, schema_1.RegisterTable)("products", "test-multi-table-schema")
|
|
254
|
+
], _ProductTable);
|
|
255
|
+
await (0, database_1.RegisterSchema)("test-multi-table-schema");
|
|
256
|
+
const schema = interface_database_1.Schema.get("test-multi-table-schema");
|
|
257
|
+
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
258
|
+
});
|
|
259
|
+
it("binds a table class registered after RegisterSchema ran to that schema (module hot reload)", async () => {
|
|
260
|
+
let _Declared = class _Declared extends table_1.Table {
|
|
261
|
+
};
|
|
262
|
+
_Declared = __decorate([
|
|
263
|
+
(0, schema_1.RegisterTable)("late_items", "test-late-schema")
|
|
264
|
+
], _Declared);
|
|
265
|
+
await (0, database_1.RegisterSchema)("test-late-schema");
|
|
266
|
+
let Reloaded = class Reloaded extends table_1.Table {
|
|
267
|
+
};
|
|
268
|
+
Reloaded = __decorate([
|
|
269
|
+
(0, schema_1.RegisterTable)("late_items", "test-late-schema")
|
|
270
|
+
], Reloaded);
|
|
271
|
+
const model = (0, model_1.GetModel)((0, model_1.BasicDataModel)(Reloaded), "late-instance");
|
|
272
|
+
(0, chai_1.expect)(model.database.build()[0].options.id).to.equal("test-late-schema");
|
|
273
|
+
(0, chai_1.expect)(Reloaded.table().build()[0].options.id).to.equal("test-late-schema");
|
|
274
|
+
});
|
|
275
|
+
it("populates TableDefinition.fields from @Field declarations", async () => {
|
|
276
|
+
let _Order = class _Order extends table_1.Table {
|
|
277
|
+
};
|
|
278
|
+
__decorate([
|
|
279
|
+
(0, table_1.Field)("string"),
|
|
280
|
+
__metadata("design:type", String)
|
|
281
|
+
], _Order.prototype, "status", void 0);
|
|
282
|
+
__decorate([
|
|
283
|
+
(0, table_1.Field)((0, codec_helpers_1.asFieldType)(codec_helpers_1.numberCodec)),
|
|
284
|
+
__metadata("design:type", Number)
|
|
285
|
+
], _Order.prototype, "total", void 0);
|
|
286
|
+
_Order = __decorate([
|
|
287
|
+
(0, schema_1.RegisterTable)("orders", "test-fields-schema")
|
|
288
|
+
], _Order);
|
|
289
|
+
await (0, database_1.RegisterSchema)("test-fields-schema");
|
|
290
|
+
const schema = interface_database_1.Schema.get("test-fields-schema");
|
|
291
|
+
if (!schema)
|
|
292
|
+
throw new Error("Schema not found");
|
|
293
|
+
const fields = schema.definition.orders.fields;
|
|
294
|
+
(0, chai_1.expect)(fields.status).to.equal("string");
|
|
295
|
+
(0, chai_1.expect)(fields.total).to.equal(codec_helpers_1.numberCodec);
|
|
296
|
+
(0, chai_1.expect)("untyped" in fields).to.equal(false);
|
|
297
|
+
});
|
|
298
|
+
});
|
|
192
299
|
function getIndexDefinitions(schemaId, tableName) {
|
|
193
300
|
const schema = interface_database_1.Schema.get(schemaId);
|
|
194
301
|
if (!schema)
|
|
195
302
|
throw new Error("Schema not found");
|
|
196
303
|
return schema.definition[tableName].indexes;
|
|
197
304
|
}
|
|
198
|
-
async function CreateTablesWithFixtureDataTest() {
|
|
199
|
-
const testData = [
|
|
200
|
-
{ id: "1", name: "Test User 1" },
|
|
201
|
-
{ id: "2", name: "Test User 2" },
|
|
202
|
-
];
|
|
203
|
-
let _TestTable = class _TestTable extends table_1.Table {
|
|
204
|
-
};
|
|
205
|
-
_TestTable = __decorate([
|
|
206
|
-
(0, table_1.Fixture)(() => testData),
|
|
207
|
-
(0, schema_1.RegisterTable)("fixture_table", "test-fixture-schema")
|
|
208
|
-
], _TestTable);
|
|
209
|
-
await (0, database_1.RegisterSchema)("test-fixture-schema");
|
|
210
|
-
const schema = interface_database_1.Schema.get("test-fixture-schema");
|
|
211
|
-
if (!schema)
|
|
212
|
-
throw new Error("Schema not found");
|
|
213
|
-
const result = await schema.instance().table("fixture_table");
|
|
214
|
-
for (const val of result) {
|
|
215
|
-
delete val._id;
|
|
216
|
-
delete val._instance;
|
|
217
|
-
}
|
|
218
|
-
const sortById = (a, b) => a.id.localeCompare(b.id);
|
|
219
|
-
(0, chai_1.expect)(result.sort(sortById)).to.deep.equal(testData.sort(sortById));
|
|
220
|
-
}
|
|
221
|
-
async function PopulatesTableDefinitionFieldsTest() {
|
|
222
|
-
let _Order = class _Order extends table_1.Table {
|
|
223
|
-
};
|
|
224
|
-
__decorate([
|
|
225
|
-
(0, table_1.Field)("string"),
|
|
226
|
-
__metadata("design:type", String)
|
|
227
|
-
], _Order.prototype, "status", void 0);
|
|
228
|
-
__decorate([
|
|
229
|
-
(0, table_1.Field)((0, codec_helpers_1.asFieldType)(codec_helpers_1.numberCodec)),
|
|
230
|
-
__metadata("design:type", Number)
|
|
231
|
-
], _Order.prototype, "total", void 0);
|
|
232
|
-
_Order = __decorate([
|
|
233
|
-
(0, schema_1.RegisterTable)("orders", "test-fields-schema")
|
|
234
|
-
], _Order);
|
|
235
|
-
await (0, database_1.RegisterSchema)("test-fields-schema");
|
|
236
|
-
const schema = interface_database_1.Schema.get("test-fields-schema");
|
|
237
|
-
if (!schema)
|
|
238
|
-
throw new Error("Schema not found");
|
|
239
|
-
const fields = schema.definition.orders.fields;
|
|
240
|
-
(0, chai_1.expect)(fields.status).to.equal("string");
|
|
241
|
-
(0, chai_1.expect)(fields.total).to.equal(codec_helpers_1.numberCodec);
|
|
242
|
-
(0, chai_1.expect)("untyped" in fields).to.equal(false);
|
|
243
|
-
}
|
|
244
|
-
async function HandleMultipleTablesTest() {
|
|
245
|
-
let _UserTable = class _UserTable extends table_1.Table {
|
|
246
|
-
};
|
|
247
|
-
__decorate([
|
|
248
|
-
(0, table_1.Index)(),
|
|
249
|
-
__metadata("design:type", String)
|
|
250
|
-
], _UserTable.prototype, "email", void 0);
|
|
251
|
-
_UserTable = __decorate([
|
|
252
|
-
(0, schema_1.RegisterTable)("users", "test-multi-table-schema")
|
|
253
|
-
], _UserTable);
|
|
254
|
-
let _ProductTable = class _ProductTable extends table_1.Table {
|
|
255
|
-
};
|
|
256
|
-
__decorate([
|
|
257
|
-
(0, table_1.Index)(),
|
|
258
|
-
__metadata("design:type", String)
|
|
259
|
-
], _ProductTable.prototype, "name", void 0);
|
|
260
|
-
_ProductTable = __decorate([
|
|
261
|
-
(0, schema_1.RegisterTable)("products", "test-multi-table-schema")
|
|
262
|
-
], _ProductTable);
|
|
263
|
-
await (0, database_1.RegisterSchema)("test-multi-table-schema");
|
|
264
|
-
const schema = interface_database_1.Schema.get("test-multi-table-schema");
|
|
265
|
-
(0, chai_1.expect)(schema).to.not.equal(undefined);
|
|
266
|
-
}
|
|
267
|
-
async function BindsLateRegisteredTableTest() {
|
|
268
|
-
let _Declared = class _Declared extends table_1.Table {
|
|
269
|
-
};
|
|
270
|
-
_Declared = __decorate([
|
|
271
|
-
(0, schema_1.RegisterTable)("late_items", "test-late-schema")
|
|
272
|
-
], _Declared);
|
|
273
|
-
await (0, database_1.RegisterSchema)("test-late-schema");
|
|
274
|
-
let Reloaded = class Reloaded extends table_1.Table {
|
|
275
|
-
};
|
|
276
|
-
Reloaded = __decorate([
|
|
277
|
-
(0, schema_1.RegisterTable)("late_items", "test-late-schema")
|
|
278
|
-
], Reloaded);
|
|
279
|
-
const model = (0, model_1.GetModel)((0, model_1.BasicDataModel)(Reloaded), "late-instance");
|
|
280
|
-
(0, chai_1.expect)(model.database.build()[0].options.id).to.equal("test-late-schema");
|
|
281
|
-
(0, chai_1.expect)(Reloaded.table().build()[0].options.id).to.equal("test-late-schema");
|
|
282
|
-
}
|
|
283
305
|
//# sourceMappingURL=database.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.test.js","sourceRoot":"","sources":["../../src/tests/database.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA8B;AAC9B,uEAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"database.test.js","sourceRoot":"","sources":["../../src/tests/database.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA8B;AAC9B,uEAAwD;AACxD,sCAA0C;AAC1C,0CAA6C;AAC7C,oCAAoD;AACpD,oCAAwD;AAExD,mDAA2D;AAE3D,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,kBAAkB,EAAE,KAAK,IA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