@salamandradevs/core 0.1.0 → 0.1.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/dist/infra/database/database-provider.js +4 -4
- package/dist/infra/database/dataset-provisioner.js +4 -5
- package/dist/infra/database/mysql/mysql-dataset.js +2 -2
- package/package.json +1 -1
- package/types/infra/database/database-provider.d.ts +4 -4
- package/types/infra/database/dataset-provisioner.d.ts +3 -4
- package/types/infra/database/dataset-provisioner.d.ts.map +1 -1
- package/types/infra/database/mysql/mysql-dataset.d.ts +2 -2
|
@@ -5,10 +5,10 @@ import { MySqlDbConnection } from './mysql/mysql-db-connection.js';
|
|
|
5
5
|
* Backend-neutral database provider that owns one connection lifecycle.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* Selects a MongoDB, MySQL, or future-vendor connection from the `backend` argument,
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Selects a MongoDB, MySQL, or future-vendor connection from the `backend` argument, but
|
|
9
|
+
* opens nothing; `connect` establishes the connection and caches the backend-tagged
|
|
10
|
+
* {@link DatabaseHandle} that {@link DatabaseAdapter} consumes. One provider owns one
|
|
11
|
+
* connection, so a composition root closes it once during shutdown.
|
|
12
12
|
* @group Infra
|
|
13
13
|
* @category Database
|
|
14
14
|
*/
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Provisioning workflow that converts schemas and coordinates dataset setup.
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
|
-
* Converts a dataset's Zod schema through the injected {@link SchemaConverter}, then
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* each startup.
|
|
5
|
+
* Converts a dataset's Zod schema through the injected {@link SchemaConverter}, then drives
|
|
6
|
+
* an {@link IDataset} to create the dataset and its indexes. Every step is guarded by a
|
|
7
|
+
* prior existence check, so `provision` is idempotent and safe to run on each startup.
|
|
9
8
|
* @group Infra
|
|
10
9
|
* @category Database
|
|
11
10
|
* @template TDef - Dataset definition shape, extending {@link DatasetDef}.
|
|
@@ -68,4 +67,4 @@ export class DatasetProvisioner {
|
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YXNldC1wcm92aXNpb25lci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9pbmZyYS9kYXRhYmFzZS9kYXRhc2V0LXByb3Zpc2lvbmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBOzs7Ozs7Ozs7Ozs7R0FZRztBQUNILE1BQU0sT0FBTyxrQkFBa0I7SUFZVjtJQUNBO0lBUm5COzs7OztPQUtHO0lBQ0gsWUFDbUIsT0FBa0MsRUFDbEMsYUFBdUM7UUFEdkMsWUFBTyxHQUFQLE9BQU8sQ0FBMkI7UUFDbEMsa0JBQWEsR0FBYixhQUFhLENBQTBCO0lBQ3ZELENBQUM7SUFFSjs7Ozs7Ozs7T0FRRztJQUNILEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBUztRQUN2QixNQUFNLGVBQWUsR0FBWSxJQUFJLENBQUMsYUFBYSxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUVoRSxNQUFNLElBQUksQ0FBQyxhQUFhLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxlQUFlLENBQUMsQ0FBQztRQUNwRCxNQUFNLElBQUksQ0FBQyxhQUFhLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbEQsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNLLEtBQUssQ0FBQyxhQUFhLENBQUMsSUFBWSxFQUFFLGFBQXNCO1FBQzlELE1BQU0sTUFBTSxHQUFZLE1BQU0sSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7UUFFdEQsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDO1lBQ1osTUFBTSxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsYUFBYSxDQUFDLENBQUM7UUFDakQsQ0FBQztJQUNILENBQUM7SUFFRDs7Ozs7O09BTUc7SUFDSyxLQUFLLENBQUMsYUFBYSxDQUN6QixXQUFtQixFQUNuQixPQUEwQjtRQUUxQixLQUFLLE1BQU0sWUFBWSxJQUFJLE9BQU8sRUFBRSxDQUFDO1lBQ25DLE1BQU0sWUFBWSxHQUFrQixNQUFNLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUM5RCxXQUFXLEVBQ1gsWUFBWSxDQUFDLElBQUksQ0FDbEIsQ0FBQztZQUVGLElBQUksWUFBWSxLQUFLLElBQUksRUFBRSxDQUFDO2dCQUMxQixNQUFNLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLFdBQVcsRUFBRSxZQUFZLENBQUMsQ0FBQztZQUM1RCxDQUFDO1FBQ0gsQ0FBQztJQUNILENBQUM7Q0FDRiJ9
|
|
@@ -3,8 +3,8 @@ import { CustomError } from '@salamandradevs/tools/shared';
|
|
|
3
3
|
* MySQL dataset administration adapter.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
|
-
* Inspects `information_schema` for table and index existence and issues DDL to create
|
|
7
|
-
*
|
|
6
|
+
* Inspects `information_schema` for table and index existence and issues DDL to create what
|
|
7
|
+
* is missing, wrapping every driver failure as a `DB_DATASET_ERROR`. Unlike the Mongo
|
|
8
8
|
* adapter, `readIndex` reconstructs the full index definition (fields, direction, and
|
|
9
9
|
* uniqueness) from catalog rows.
|
|
10
10
|
* @group Infra
|
package/package.json
CHANGED
|
@@ -4,10 +4,10 @@ import type { DatabaseBackend, DatabaseHandle } from './types.js';
|
|
|
4
4
|
* Backend-neutral database provider that owns one connection lifecycle.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* Selects a MongoDB, MySQL, or future-vendor connection from the `backend` argument,
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Selects a MongoDB, MySQL, or future-vendor connection from the `backend` argument, but
|
|
8
|
+
* opens nothing; `connect` establishes the connection and caches the backend-tagged
|
|
9
|
+
* {@link DatabaseHandle} that {@link DatabaseAdapter} consumes. One provider owns one
|
|
10
|
+
* connection, so a composition root closes it once during shutdown.
|
|
11
11
|
* @group Infra
|
|
12
12
|
* @category Database
|
|
13
13
|
*/
|
|
@@ -4,10 +4,9 @@ import type { DatasetDef } from './types.js';
|
|
|
4
4
|
* Provisioning workflow that converts schemas and coordinates dataset setup.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* Converts a dataset's Zod schema through the injected {@link SchemaConverter}, then
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* each startup.
|
|
7
|
+
* Converts a dataset's Zod schema through the injected {@link SchemaConverter}, then drives
|
|
8
|
+
* an {@link IDataset} to create the dataset and its indexes. Every step is guarded by a
|
|
9
|
+
* prior existence check, so `provision` is idempotent and safe to run on each startup.
|
|
11
10
|
* @group Infra
|
|
12
11
|
* @category Database
|
|
13
12
|
* @template TDef - Dataset definition shape, extending {@link DatasetDef}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-provisioner.d.ts","sourceRoot":"","sources":["../../../src/infra/database/dataset-provisioner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"dataset-provisioner.d.ts","sourceRoot":"","sources":["../../../src/infra/database/dataset-provisioner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,qBAAa,kBAAkB,CAC7B,IAAI,SAAS,UAAU,CAAC,MAAM,CAAC,EAC/B,OAAO,EACP,MAAM,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAC/B,YAAW,mBAAmB,CAAC,IAAI,CAAC;IAQlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IARhC;;;;;OAKG;gBAEgB,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,EAClC,aAAa,EAAE,eAAe,CAAC,OAAO,CAAC;IAG1D;;;;;;;;OAQG;IACG,SAAS,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzC;;;;;;OAMG;YACW,aAAa;IAQ3B;;;;;;OAMG;YACW,aAAa;CAe5B"}
|
|
@@ -6,8 +6,8 @@ import type { MySqlSchema } from './types.js';
|
|
|
6
6
|
* MySQL dataset administration adapter.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Inspects `information_schema` for table and index existence and issues DDL to create
|
|
10
|
-
*
|
|
9
|
+
* Inspects `information_schema` for table and index existence and issues DDL to create what
|
|
10
|
+
* is missing, wrapping every driver failure as a `DB_DATASET_ERROR`. Unlike the Mongo
|
|
11
11
|
* adapter, `readIndex` reconstructs the full index definition (fields, direction, and
|
|
12
12
|
* uniqueness) from catalog rows.
|
|
13
13
|
* @group Infra
|