@otwdesign/db-core 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 +38 -0
- package/dist/backup/api.js +2 -33
- package/dist/backup/api.js.map +1 -1
- package/dist/body.d.ts +17 -0
- package/dist/body.js +88 -0
- package/dist/body.js.map +1 -0
- package/dist/browser.d.ts +1 -0
- package/dist/drivers/mysql-connection.d.ts +101 -0
- package/dist/drivers/mysql-connection.js +204 -0
- package/dist/drivers/mysql-connection.js.map +1 -0
- package/dist/drivers/mysql-import.d.ts +22 -0
- package/dist/drivers/mysql-import.js +688 -0
- package/dist/drivers/mysql-import.js.map +1 -0
- package/dist/drivers/mysql.d.ts +11 -1
- package/dist/drivers/mysql.js +87 -97
- package/dist/drivers/mysql.js.map +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js.map +1 -1
- package/dist/handler.d.ts +31 -0
- package/dist/handler.js +93 -9
- package/dist/handler.js.map +1 -1
- package/dist/import/api.d.ts +65 -0
- package/dist/import/api.js +1282 -0
- package/dist/import/api.js.map +1 -0
- package/dist/import/audit.d.ts +47 -0
- package/dist/import/audit.js +434 -0
- package/dist/import/audit.js.map +1 -0
- package/dist/import/charsets.d.ts +25 -0
- package/dist/import/charsets.js +39 -0
- package/dist/import/charsets.js.map +1 -0
- package/dist/import/frames.d.ts +26 -0
- package/dist/import/frames.js +158 -0
- package/dist/import/frames.js.map +1 -0
- package/dist/import/grants.d.ts +26 -0
- package/dist/import/grants.js +122 -0
- package/dist/import/grants.js.map +1 -0
- package/dist/import/protocol.d.ts +462 -0
- package/dist/import/protocol.js +72 -0
- package/dist/import/protocol.js.map +1 -0
- package/dist/import/shared.d.ts +3 -0
- package/dist/import/shared.js +9 -0
- package/dist/import/shared.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +308 -2
- package/package.json +7 -2
- package/src/backup/api.ts +2 -33
- package/src/body.ts +94 -0
- package/src/browser.ts +24 -0
- package/src/drivers/mysql-connection.ts +282 -0
- package/src/drivers/mysql-import.ts +769 -0
- package/src/drivers/mysql.ts +96 -107
- package/src/errors.ts +2 -0
- package/src/handler.ts +126 -8
- package/src/import/api.ts +1530 -0
- package/src/import/audit.ts +467 -0
- package/src/import/charsets.ts +46 -0
- package/src/import/frames.ts +191 -0
- package/src/import/grants.ts +117 -0
- package/src/import/protocol.ts +540 -0
- package/src/import/shared.ts +8 -0
- package/src/index.ts +24 -0
- package/src/types.ts +319 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ConnectionOptions } from 'mysql2/promise';
|
|
2
|
+
import type { Importer } from '../types.ts';
|
|
3
|
+
import { type MySql } from './mysql-connection.ts';
|
|
4
|
+
/**
|
|
5
|
+
* One connection's settings for an import of the server at `url`. Not the driver's own (see
|
|
6
|
+
* `connectionOptions`): a file must run as it would in the `mysql` client, so nothing of the URL
|
|
7
|
+
* that changes how statements are read or sent gets through, its character set, flags and time
|
|
8
|
+
* zone among them.
|
|
9
|
+
*/
|
|
10
|
+
export declare function importOptions(url: string): ConnectionOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Opens one import's connection to the server at `url`, with `mysql` as mysql2. It answers once
|
|
13
|
+
* the connection has proved it runs one statement a query, and the server reports its session.
|
|
14
|
+
*
|
|
15
|
+
* `idleMs` is how long the import may sit unused between statements: the server is asked to keep
|
|
16
|
+
* the connection a minute longer than that, where it would drop it sooner. `closed` is called
|
|
17
|
+
* once, when the connection has gone, however it went.
|
|
18
|
+
*/
|
|
19
|
+
export declare function openImporter(mysql: MySql, url: string, { idleMs, closed }?: {
|
|
20
|
+
idleMs?: number;
|
|
21
|
+
closed?: () => void;
|
|
22
|
+
}): Promise<Importer>;
|