@antelopejs/dms-database 0.1.2 → 0.2.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 +73 -49
- package/dist/db/models/diagram_layouts.model.d.ts +1 -0
- package/dist/db/models/diagram_notes.model.d.ts +1 -0
- package/dist/db/models/query_history.model.d.ts +1 -0
- package/dist/db/models/saved_queries.model.d.ts +1 -0
- package/dist/routes/data.d.ts +1 -3
- package/dist/routes/data.js +6 -1
- package/dist/routes/data.js.map +1 -1
- package/frontend-vue/app/build/composables/useDataBrowserGrid.ts +4 -38
- package/frontend-vue/app/build/composables/useDatabaseHealth.ts +7 -4
- package/frontend-vue/app/build/composables/useDatabaseSchemas.ts +1 -2
- package/frontend-vue/app/build/composables/useDiagramPersistence.ts +49 -16
- package/frontend-vue/app/build/composables/useQueryStore.ts +59 -27
- package/frontend-vue/app/build/composables/useTableCounts.ts +50 -0
- package/frontend-vue/app/build/data/stagedWrites.ts +46 -6
- package/frontend-vue/app/build/data/useStagedSave.ts +42 -12
- package/frontend-vue/app/build/query/runs.ts +7 -27
- package/frontend-vue/app/build/schemas/useSchemasListing.ts +10 -33
- package/frontend-vue/app/components/ConnectionStatus.vue +14 -11
- package/frontend-vue/app/components/DataBrowserSidebar.vue +20 -42
- package/frontend-vue/app/components/DataBrowserTabBar.vue +1 -1
- package/frontend-vue/app/components/DataGrid.vue +73 -91
- package/frontend-vue/app/components/InstancePicker.vue +63 -55
- package/frontend-vue/app/components/QueryConsole.vue +47 -37
- package/frontend-vue/app/components/QueryLibrary.vue +20 -17
- package/frontend-vue/app/components/RowDrawer.vue +15 -18
- package/frontend-vue/app/components/SchemaDiagram.vue +7 -7
- package/frontend-vue/app/components/TableInspector.vue +116 -84
- package/frontend-vue/package.json +4 -3
- package/frontend-vue/pnpm-lock.yaml +1388 -2803
- package/frontend-vue/tests/dataBrowser.test.ts +59 -1
- package/frontend-vue/tests/fixtures/inertia.ts +8 -0
- package/frontend-vue/tests/fixtures/serverRender.ts +219 -0
- package/frontend-vue/tests/fixtures/vueI18n.ts +4 -0
- package/frontend-vue/tests/helpers.test.ts +1 -0
- package/frontend-vue/tests/locales.test.ts +24 -0
- package/frontend-vue/tests/onDemandReads.test.ts +106 -0
- package/frontend-vue/tests/serverRender.test.ts +235 -0
- package/frontend-vue/vitest.config.ts +24 -0
- package/package.json +31 -14
- package/skills/dms-database/SKILL.md +35 -0
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
|
1
3
|
import { defineConfig } from 'vitest/config'
|
|
2
4
|
|
|
5
|
+
// The renderer and the DMS core layer the server-render tests run on: the
|
|
6
|
+
// ones the repository installs at its root (`@antelopejs/dms-frontend`,
|
|
7
|
+
// `@antelopejs/dms`), as `pnpm test:frontend` builds against them.
|
|
8
|
+
const root = resolve(__dirname, '..', 'node_modules', '@antelopejs')
|
|
9
|
+
|
|
3
10
|
export default defineConfig({
|
|
11
|
+
plugins: [vue()],
|
|
12
|
+
resolve: {
|
|
13
|
+
alias: {
|
|
14
|
+
'#dms/frontend-module': resolve(
|
|
15
|
+
root,
|
|
16
|
+
'dms-frontend/templates/vue/frontend-module.ts',
|
|
17
|
+
),
|
|
18
|
+
'#dms-core': resolve(root, 'dms/frontend-vue/layers/dms-core'),
|
|
19
|
+
// The renderer's own imports, from this package's dependencies: one
|
|
20
|
+
// Vue for the renderer and the components.
|
|
21
|
+
vue: resolve(__dirname, 'node_modules/vue'),
|
|
22
|
+
'@unhead/vue': resolve(__dirname, 'node_modules/@unhead/vue'),
|
|
23
|
+
// What the renderer reads of Inertia and vue-i18n in the browser only.
|
|
24
|
+
'@inertiajs/vue3': resolve(__dirname, 'tests/fixtures/inertia.ts'),
|
|
25
|
+
'vue-i18n': resolve(__dirname, 'tests/fixtures/vueI18n.ts'),
|
|
26
|
+
},
|
|
27
|
+
},
|
|
4
28
|
test: { environment: 'node', include: ['tests/**/*.test.ts'] },
|
|
5
29
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-database",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Database console for the AntelopeJS DMS: schemas, relation diagrams, a data browser and an AQL query console.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"admin",
|
|
7
|
+
"antelopejs",
|
|
8
|
+
"aql",
|
|
9
|
+
"database",
|
|
10
|
+
"dms",
|
|
11
|
+
"dms-module"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://dms.antelopejs.com/docs/modules/database",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/AntelopeJS/dms-database/issues"
|
|
16
|
+
},
|
|
4
17
|
"license": "Apache-2.0",
|
|
5
18
|
"repository": {
|
|
6
19
|
"type": "git",
|
|
@@ -10,7 +23,8 @@
|
|
|
10
23
|
"dist",
|
|
11
24
|
"!dist/test",
|
|
12
25
|
"!dist/.tsbuildinfo",
|
|
13
|
-
"frontend-vue"
|
|
26
|
+
"frontend-vue",
|
|
27
|
+
"skills"
|
|
14
28
|
],
|
|
15
29
|
"main": "dist/index.js",
|
|
16
30
|
"types": "dist/index.d.ts",
|
|
@@ -45,18 +59,18 @@
|
|
|
45
59
|
"test:frontend": "ajs dms verify-source --layer node_modules/@antelopejs/dms/frontend-vue --module frontend-vue"
|
|
46
60
|
},
|
|
47
61
|
"dependencies": {
|
|
48
|
-
"@antelopejs/interface-api": ">=0.0.
|
|
49
|
-
"@antelopejs/interface-api-util": ">=0.1.
|
|
50
|
-
"@antelopejs/interface-core": ">=0.
|
|
51
|
-
"@antelopejs/interface-database": ">=0.1.
|
|
52
|
-
"@antelopejs/interface-database-decorators": ">=0.1.
|
|
53
|
-
"@antelopejs/interface-dms": ">=0.
|
|
62
|
+
"@antelopejs/interface-api": ">=0.0.15 <1.0.0",
|
|
63
|
+
"@antelopejs/interface-api-util": ">=0.1.3 <1.0.0",
|
|
64
|
+
"@antelopejs/interface-core": ">=0.2.4 <1.0.0",
|
|
65
|
+
"@antelopejs/interface-database": ">=0.1.10 <1.0.0",
|
|
66
|
+
"@antelopejs/interface-database-decorators": ">=0.1.9 <1.0.0",
|
|
67
|
+
"@antelopejs/interface-dms": ">=0.7.2 <1.0.0"
|
|
54
68
|
},
|
|
55
69
|
"devDependencies": {
|
|
56
|
-
"@antelopejs/core": ">=1.
|
|
57
|
-
"@antelopejs/dms": ">=0.
|
|
58
|
-
"@antelopejs/dms-frontend": ">=0.
|
|
59
|
-
"@antelopejs/tooling-configs": ">=0.0.
|
|
70
|
+
"@antelopejs/core": ">=1.16.0 <2",
|
|
71
|
+
"@antelopejs/dms": ">=0.9.3 <1.0.0",
|
|
72
|
+
"@antelopejs/dms-frontend": ">=0.6.3 <0.7.0",
|
|
73
|
+
"@antelopejs/tooling-configs": ">=0.0.9 <1.0.0",
|
|
60
74
|
"@types/chai": "^5.2.3",
|
|
61
75
|
"@types/mocha": "^10.0.10",
|
|
62
76
|
"@types/node": "^24.0.0",
|
|
@@ -74,12 +88,15 @@
|
|
|
74
88
|
"typescript": "^6.0.3"
|
|
75
89
|
},
|
|
76
90
|
"optionalDependencies": {
|
|
77
|
-
"@antelopejs/interface-dms-automation": ">=0.
|
|
91
|
+
"@antelopejs/interface-dms-automation": ">=0.2.1 <1.0.0"
|
|
78
92
|
},
|
|
79
93
|
"packageManager": "pnpm@10.2.0",
|
|
80
94
|
"antelopeJs": {
|
|
81
95
|
"baseUrl": "dist",
|
|
82
96
|
"implements": [],
|
|
83
|
-
"test": "src/test/harness.ts"
|
|
97
|
+
"test": "src/test/harness.ts",
|
|
98
|
+
"skills": [
|
|
99
|
+
"./skills"
|
|
100
|
+
]
|
|
84
101
|
}
|
|
85
102
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dms-database
|
|
3
|
+
description: Uses the @antelopejs/dms-database console of the AntelopeJS DMS (owner-only pages under /modules/database to inspect schemas, draw diagrams, browse and edit rows, and run AQL). Use when installing or configuring dms-database (driverLabel, schemaLabels), deep-linking to its pages, wiring its "database.table-watch" automation trigger, or explaining why a table is missing from it.
|
|
4
|
+
icon: i-lucide-database
|
|
5
|
+
category: data
|
|
6
|
+
tags: [database, schemas, aql, data-browser, automation]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# dms-database
|
|
10
|
+
|
|
11
|
+
A read-mostly database console for the platform owner. It has no API for other modules: it introspects every schema registered through `@antelopejs/interface-database-decorators`, so a table appears once its module calls `RegisterSchema(<id>)` and declares `@RegisterTable(<table>, <id>)`. User docs: https://dms.antelopejs.com/docs/modules/database (source: `docs/` of this package).
|
|
12
|
+
|
|
13
|
+
## When to reach for it
|
|
14
|
+
|
|
15
|
+
- A user wants to look at, fix or query raw rows: point them to the console instead of writing a throwaway admin page.
|
|
16
|
+
- A procedure must react to row changes: use the `database.table-watch` trigger (`schema`, `table`, optional `eventTypes`), loaded only with `@antelopejs/dms-automation`.
|
|
17
|
+
- Never build a business screen on it: saved edits bypass every module's logic. Build a DMS page for that.
|
|
18
|
+
|
|
19
|
+
## Config (`antelope.config.ts`, all optional)
|
|
20
|
+
|
|
21
|
+
- Version 0.2+ needs `@antelopejs/dms` 0.9 (`interface-dms` 0.7) and `@antelopejs/dms-frontend` 0.6; 0.1 is the DMS 0.8 line.
|
|
22
|
+
|
|
23
|
+
- `driverLabel: "MongoDB 8.0"`: the database name on the Overview (the interface cannot discover it).
|
|
24
|
+
- `schemaLabels: { "<schemaId or glob*>": { label, color?: Tone } }`: badges; built-in patterns cover `app*`, `core*`, `global*`, `staging*`, `review*`, `prod*`.
|
|
25
|
+
|
|
26
|
+
## Deep links
|
|
27
|
+
|
|
28
|
+
`/modules/database/schemas?record=<schema>::<table>`, `/modules/database/{diagram,data,query}?schema=<schema>&table=<table>`, plus `instance=<name>` or `instance=all`.
|
|
29
|
+
|
|
30
|
+
## Gotchas
|
|
31
|
+
|
|
32
|
+
- Owner-only: pages and `/api/database/*` routes answer the platform owner alone.
|
|
33
|
+
- The data browser is read-only on **All instances**; a saved edit can be undone for 10 seconds only.
|
|
34
|
+
- Write queries in the console always run a dry run and need the table name typed to confirm.
|
|
35
|
+
- `table-watch` needs a change feed: MongoDB must run as a replica set.
|