@otwdesign/plugin-db 1.4.2 → 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
@@ -25,8 +25,22 @@ Measured on a site built from npm with OTW CMS 1.11, once without the plugin and
25
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
26
  | The server's memory, unused | 47.9 MB | 48.4 MB | 0.5 MB |
27
27
 
28
- The Database screen itself downloads 104 KB the first time (the app's script and stylesheet,
29
- compressed) and the SQL editor's 131 KB when the first editor opens; browsers keep both a year. The
30
- server loads the tool on the first request to it, and holds about 4 MB for it from then on.
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.
31
45
 
32
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.2",
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.2",
44
- "@otwdesign/db-ui": "1.4.2"
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.2',
92
+ version: '1.5.0',
93
93
  name: 'Database',
94
94
  icon: ICON,
95
95
  description: