@otwdesign/plugin-db 1.4.1 → 1.5.0

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 CHANGED
@@ -12,4 +12,35 @@ Add it to `cms.config.json`'s `plugins`. Administrators get Database in the admi
12
12
  other databases come from `DB_ADMIN_<NAME>_URL`. On an embedded database (PGlite), a heavy statement
13
13
  holds the whole site until it finishes, and the screen says so.
14
14
 
15
+ ## What it costs a site
16
+
17
+ Measured on a site built from npm with OTW CMS 1.11, once without the plugin and once with it:
18
+
19
+ | Where | Without the plugin | With it, active | The difference |
20
+ | --------------------------- | ------------------ | --------------- | ---------------------------------------- |
21
+ | Browser files of the build | 1,069,242 B | 1,069,242 B | None: the same files |
22
+ | A site page (HTML) | 11,579 B | 11,579 B | None |
23
+ | The sign-in pages (HTML) | 16,466 B | 16,466 B | None |
24
+ | Another admin screen (HTML) | 35,100 B | 35,682 B | The menu entry, 0.1 KB compressed |
25
+ | Time per request | 3.1 to 5.3 ms | 3.1 to 5.3 ms | Within 0.1 ms either way: not measurable |
26
+ | The server's memory, unused | 47.9 MB | 48.4 MB | 0.5 MB |
27
+
28
+ The Database screen itself downloads 104 KB the first time (the app's script, 99 KB compressed, and
29
+ its stylesheet, 4 KB), the SQL editor's 131 KB when the first editor opens, and the Import SQL
30
+ dialog's 29 KB when that first opens; browsers keep all three a year. The server loads the tool on
31
+ the first request to it, and holds about 4 MB for it from then on; the code that imports loads
32
+ with the first import.
33
+
34
+ ## Importing SQL
35
+
36
+ A MySQL or MariaDB connection (`DB_ADMIN_<NAME>_URL`, with `DB_ADMIN_<NAME>_ACCESS=write` and
37
+ `mysql2` installed in the site) has Import SQL in its toolbar, for `.sql` and `.sql.gz` files. The
38
+ site's own database is PostgreSQL, which has Back up and restore instead.
39
+
40
+ An import's connection is held by the site's server process, so the site must run as one: a
41
+ server or a container, not serverless functions. The CMS builds the plugin's handler again when
42
+ settings change, and an import that is open is still found afterwards. Each administrator's
43
+ import is their own, and they can end it from another window too. Behind nginx or another proxy,
44
+ see [Importing SQL](https://github.com/OTWSRL/otw-db#importing-sql) in the guide.
45
+
15
46
  The whole guide: [github.com/OTWSRL/otw-db](https://github.com/OTWSRL/otw-db#readme).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwdesign/plugin-db",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "OTW DB in the OTW CMS admin: browse, query and edit the site's database, and any other, the way TablePlus does.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "OTW SRL",
@@ -40,8 +40,8 @@
40
40
  "@types/pg-cursor": "^2.7.2",
41
41
  "pg": "^8.23.1",
42
42
  "pg-cursor": "^2.22.1",
43
- "@otwdesign/db-core": "1.4.1",
44
- "@otwdesign/db-ui": "1.4.1"
43
+ "@otwdesign/db-core": "1.5.0",
44
+ "@otwdesign/db-ui": "1.5.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@otwdesign/sdk": "^1.1.0",
package/src/index.ts CHANGED
@@ -89,7 +89,7 @@ export function setup(cms: PluginContext): void {
89
89
 
90
90
  export default definePlugin({
91
91
  id: 'db',
92
- version: '1.4.1',
92
+ version: '1.5.0',
93
93
  name: 'Database',
94
94
  icon: ICON,
95
95
  description: