@otwdesign/db-next 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 +17 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -84,6 +84,22 @@ This package brings `pg` and `pg-cursor` and imports them where Next's file trac
|
|
|
84
84
|
they're in the deployed function. MySQL and MariaDB work where the whole of `node_modules` is
|
|
85
85
|
deployed (`next start` on a server), not yet in a Vercel function.
|
|
86
86
|
|
|
87
|
+
## Importing SQL
|
|
88
|
+
|
|
89
|
+
Import SQL, in the toolbar of a MySQL or MariaDB connection, runs `.sql` and `.sql.gz` files. It
|
|
90
|
+
needs:
|
|
91
|
+
|
|
92
|
+
- `mysql2` installed in the app, and `DB_ADMIN_<NAME>_ACCESS=write` on the connection;
|
|
93
|
+
- one server process that stays up: `next start` on a server or in a container. An import's
|
|
94
|
+
connection is in that process's memory, so it doesn't work on Vercel or any host that runs the
|
|
95
|
+
route on several instances: a request that reaches another one finds no such import;
|
|
96
|
+
- behind nginx or another proxy, room for a request of 4 MB, or the browser sends smaller ones.
|
|
97
|
+
The [guide](https://github.com/OTWSRL/otw-db#importing-sql) has the rest.
|
|
98
|
+
|
|
99
|
+
Everyone who signs in with the password is one viewer, `password`: they share the one import a
|
|
100
|
+
viewer has open on a connection, and any of them can end it, but only the window that started it
|
|
101
|
+
can go on with it. Users listed in `DB_ADMIN_USERS` each have their own.
|
|
102
|
+
|
|
87
103
|
`createDbRoute(options)` also takes `basePath` (with next.config's `basePath` in front, as the
|
|
88
104
|
browser has it), `connections`, and what `createDbAdmin` takes: `audit`, `limits`, `origins`,
|
|
89
|
-
`backups`.
|
|
105
|
+
`backups`, `imports`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otwdesign/db-next",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "OTW DB in a Next.js app: one route file, a password sign-in or your app's own users, and the drivers Vercel needs. npx @otwdesign/db-next init sets it up.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "OTW SRL",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"pg": "^8.23.1",
|
|
54
54
|
"pg-cursor": "^2.22.1",
|
|
55
|
-
"@otwdesign/db-core": "1.
|
|
55
|
+
"@otwdesign/db-core": "1.5.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@supabase/ssr": "^0.12.7",
|