@antelopejs/dms-database 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/db/models/query_history.model.js +5 -9
- package/dist/db/models/query_history.model.js.map +1 -1
- package/dist/db/tables/query_history.table.js +2 -2
- package/dist/db/tables/query_history.table.js.map +1 -1
- package/frontend-vue/app/components/QueryBuilderPanel.vue +1 -0
- package/frontend-vue/package.json +1 -1
- package/frontend-vue/pnpm-lock.yaml +2 -28
- package/package.json +1 -1
|
@@ -7,24 +7,20 @@ const query_history_table_1 = require("../tables/query_history.table");
|
|
|
7
7
|
class QueryHistoryModel extends (0, interface_database_decorators_1.BasicDataModel)(query_history_table_1.QueryHistoryRow, query_history_table_1.queryHistoryTableName) {
|
|
8
8
|
async addAndPrune(entry) {
|
|
9
9
|
await this.insert(entry);
|
|
10
|
-
const
|
|
10
|
+
const overflow = await this.table
|
|
11
11
|
.filter((d) => d.key("userId").eq(entry.userId))
|
|
12
12
|
.orderBy("executedAt", "desc")
|
|
13
|
+
.slice(constants_1.MAX_HISTORY_PER_USER)
|
|
13
14
|
.run();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
await this.delete(row._id);
|
|
17
|
-
}
|
|
15
|
+
for (const row of overflow) {
|
|
16
|
+
await this.delete(row._id);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
async listForUser(userId, limit, offset) {
|
|
21
20
|
const baseFilter = this.table.filter((d) => d.key("userId").eq(userId));
|
|
22
21
|
const [total, items] = await Promise.all([
|
|
23
22
|
baseFilter.count().run(),
|
|
24
|
-
baseFilter
|
|
25
|
-
.orderBy("executedAt", "desc")
|
|
26
|
-
.slice(offset, offset + limit)
|
|
27
|
-
.run(),
|
|
23
|
+
baseFilter.orderBy("executedAt", "desc").slice(offset, limit).run(),
|
|
28
24
|
]);
|
|
29
25
|
return { items, total };
|
|
30
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_history.model.js","sourceRoot":"","sources":["../../../src/db/models/query_history.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,qDAA6D;AAE7D,uEAGuC;AAEvC,MAAa,iBAAkB,SAAQ,IAAA,8CAAc,EACnD,qCAAe,EACf,2CAAqB,CACtB;IACC,KAAK,CAAC,WAAW,CAAC,KAAmC;QACnD,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,
|
|
1
|
+
{"version":3,"file":"query_history.model.js","sourceRoot":"","sources":["../../../src/db/models/query_history.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,qDAA6D;AAE7D,uEAGuC;AAEvC,MAAa,iBAAkB,SAAQ,IAAA,8CAAc,EACnD,qCAAe,EACf,2CAAqB,CACtB;IACC,KAAK,CAAC,WAAW,CAAC,KAAmC;QACnD,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK;aAC9B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aAC/C,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;aAC7B,KAAK,CAAC,gCAAoB,CAAC;aAC3B,GAAG,EAAE,CAAC;QAET,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CACf,MAAc,EACd,KAAa,EACb,MAAc;QAEd,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAExE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACvC,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE;YACxB,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE;SACpE,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;CACF;AAhCD,8CAgCC"}
|
|
@@ -18,13 +18,13 @@ let QueryHistoryRow = class QueryHistoryRow extends interface_database_decorator
|
|
|
18
18
|
};
|
|
19
19
|
exports.QueryHistoryRow = QueryHistoryRow;
|
|
20
20
|
__decorate([
|
|
21
|
-
(0, interface_database_decorators_1.Index)(),
|
|
21
|
+
(0, interface_database_decorators_1.Index)({ group: "userId_executedAt" }),
|
|
22
22
|
(0, interface_database_decorators_1.Field)("string"),
|
|
23
23
|
(0, interface_database_decorators_1.Relation)({ to: () => db_1.User }),
|
|
24
24
|
__metadata("design:type", String)
|
|
25
25
|
], QueryHistoryRow.prototype, "userId", void 0);
|
|
26
26
|
__decorate([
|
|
27
|
-
(0, interface_database_decorators_1.Index)(),
|
|
27
|
+
(0, interface_database_decorators_1.Index)({ group: "userId_executedAt" }),
|
|
28
28
|
(0, interface_database_decorators_1.Field)("date"),
|
|
29
29
|
__metadata("design:type", Date)
|
|
30
30
|
], QueryHistoryRow.prototype, "executedAt", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_history.table.js","sourceRoot":"","sources":["../../../src/db/tables/query_history.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAMmD;AACnD,0DAAyD;AACzD,qDAAoD;AAEvC,QAAA,qBAAqB,GAAG,eAAe,CAAC;AAG9C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,qCAAK;CAwBzC,CAAA;AAxBY,0CAAe;AAIlB;IAHP,IAAA,qCAAK,
|
|
1
|
+
{"version":3,"file":"query_history.table.js","sourceRoot":"","sources":["../../../src/db/tables/query_history.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAMmD;AACnD,0DAAyD;AACzD,qDAAoD;AAEvC,QAAA,qBAAqB,GAAG,eAAe,CAAC;AAG9C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,qCAAK;CAwBzC,CAAA;AAxBY,0CAAe;AAIlB;IAHP,IAAA,qCAAK,EAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACrC,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,SAAI,EAAE,CAAC;;+CACN;AAIf;IAFP,IAAA,qCAAK,EAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACrC,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACM,IAAI;mDAAC;AAGjB;IADP,IAAA,qCAAK,EAAC,KAAK,CAAC;;8CAC0B;AAG/B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;+CACO;AAGf;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDACQ;AAGhB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mDACW;AAGnB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDACS;0BAvBd,eAAe;IAD3B,IAAA,6CAAa,EAAC,6BAAqB,EAAE,uBAAW,CAAC;GACrC,eAAe,CAwB3B"}
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
lineNumbers,
|
|
28
28
|
placeholder as cmPlaceholder,
|
|
29
29
|
} from "@codemirror/view";
|
|
30
|
+
import { useColorMode } from "@vueuse/core";
|
|
30
31
|
import type { SchemaSummary } from "../composables/useDatabaseSchemas";
|
|
31
32
|
import type { QueryLanguage } from "../composables/useQueryStore";
|
|
32
33
|
|
|
@@ -42,8 +42,8 @@ importers:
|
|
|
42
42
|
specifier: ^1.48.2
|
|
43
43
|
version: 1.48.2(vue@3.5.34(typescript@5.9.3))
|
|
44
44
|
'@vueuse/core':
|
|
45
|
-
specifier: ^
|
|
46
|
-
version:
|
|
45
|
+
specifier: ^14.3.0
|
|
46
|
+
version: 14.3.0(vue@3.5.34(typescript@5.9.3))
|
|
47
47
|
vue:
|
|
48
48
|
specifier: ^3.5.18
|
|
49
49
|
version: 3.5.34(typescript@5.9.3)
|
|
@@ -1304,11 +1304,6 @@ packages:
|
|
|
1304
1304
|
'@vueuse/core@10.11.1':
|
|
1305
1305
|
resolution: {integrity: sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==}
|
|
1306
1306
|
|
|
1307
|
-
'@vueuse/core@13.9.0':
|
|
1308
|
-
resolution: {integrity: sha512-ts3regBQyURfCE2BcytLqzm8+MmLlo5Ln/KLoxDVcsZ2gzIwVNnQpQOL/UKV8alUqjSZOlpFZcRNsLRqj+OzyA==}
|
|
1309
|
-
peerDependencies:
|
|
1310
|
-
vue: ^3.5.0
|
|
1311
|
-
|
|
1312
1307
|
'@vueuse/core@14.3.0':
|
|
1313
1308
|
resolution: {integrity: sha512-aHfz47g0ZhMtTVHmIzMVpJy8ePhhOy68GY5bv110+5DVtZ+W7BsOx+m61UNQqfrWyPztIHIanWa3E2tib3NFIw==}
|
|
1314
1309
|
peerDependencies:
|
|
@@ -1359,20 +1354,12 @@ packages:
|
|
|
1359
1354
|
'@vueuse/metadata@10.11.1':
|
|
1360
1355
|
resolution: {integrity: sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==}
|
|
1361
1356
|
|
|
1362
|
-
'@vueuse/metadata@13.9.0':
|
|
1363
|
-
resolution: {integrity: sha512-1AFRvuiGphfF7yWixZa0KwjYH8ulyjDCC0aFgrGRz8+P4kvDFSdXLVfTk5xAN9wEuD1J6z4/myMoYbnHoX07zg==}
|
|
1364
|
-
|
|
1365
1357
|
'@vueuse/metadata@14.3.0':
|
|
1366
1358
|
resolution: {integrity: sha512-BwxmbAzwAVF50+MW57GXOUEV61nFBGnlBvrTqj49PqWJu3uw7hdu72ztXeZ33RdZtDY6kO+bfCAE1PCn88Tktw==}
|
|
1367
1359
|
|
|
1368
1360
|
'@vueuse/shared@10.11.1':
|
|
1369
1361
|
resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==}
|
|
1370
1362
|
|
|
1371
|
-
'@vueuse/shared@13.9.0':
|
|
1372
|
-
resolution: {integrity: sha512-e89uuTLMh0U5cZ9iDpEI2senqPGfbPRTHM/0AaQkcxnpqjkZqDYP8rpfm7edOz8s+pOCOROEy1PIveSW8+fL5g==}
|
|
1373
|
-
peerDependencies:
|
|
1374
|
-
vue: ^3.5.0
|
|
1375
|
-
|
|
1376
1363
|
'@vueuse/shared@14.3.0':
|
|
1377
1364
|
resolution: {integrity: sha512-bZpge9eSXwa4ToSiqJ7j6KRwhAsneMFoSz3LMWKQDkqimm3D/tbFlrklrs/IOqC8tEcYmXQZJ6N0UrjhBirVCg==}
|
|
1378
1365
|
peerDependencies:
|
|
@@ -4271,13 +4258,6 @@ snapshots:
|
|
|
4271
4258
|
- '@vue/composition-api'
|
|
4272
4259
|
- vue
|
|
4273
4260
|
|
|
4274
|
-
'@vueuse/core@13.9.0(vue@3.5.34(typescript@5.9.3))':
|
|
4275
|
-
dependencies:
|
|
4276
|
-
'@types/web-bluetooth': 0.0.21
|
|
4277
|
-
'@vueuse/metadata': 13.9.0
|
|
4278
|
-
'@vueuse/shared': 13.9.0(vue@3.5.34(typescript@5.9.3))
|
|
4279
|
-
vue: 3.5.34(typescript@5.9.3)
|
|
4280
|
-
|
|
4281
4261
|
'@vueuse/core@14.3.0(vue@3.5.34(typescript@5.9.3))':
|
|
4282
4262
|
dependencies:
|
|
4283
4263
|
'@types/web-bluetooth': 0.0.21
|
|
@@ -4295,8 +4275,6 @@ snapshots:
|
|
|
4295
4275
|
|
|
4296
4276
|
'@vueuse/metadata@10.11.1': {}
|
|
4297
4277
|
|
|
4298
|
-
'@vueuse/metadata@13.9.0': {}
|
|
4299
|
-
|
|
4300
4278
|
'@vueuse/metadata@14.3.0': {}
|
|
4301
4279
|
|
|
4302
4280
|
'@vueuse/shared@10.11.1(vue@3.5.34(typescript@5.9.3))':
|
|
@@ -4306,10 +4284,6 @@ snapshots:
|
|
|
4306
4284
|
- '@vue/composition-api'
|
|
4307
4285
|
- vue
|
|
4308
4286
|
|
|
4309
|
-
'@vueuse/shared@13.9.0(vue@3.5.34(typescript@5.9.3))':
|
|
4310
|
-
dependencies:
|
|
4311
|
-
vue: 3.5.34(typescript@5.9.3)
|
|
4312
|
-
|
|
4313
4287
|
'@vueuse/shared@14.3.0(vue@3.5.34(typescript@5.9.3))':
|
|
4314
4288
|
dependencies:
|
|
4315
4289
|
vue: 3.5.34(typescript@5.9.3)
|