@jskit-ai/database-runtime-mysql 0.1.115 → 0.1.117

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.
@@ -1,7 +1,19 @@
1
+ import { DIALECT_ID } from "./src/shared/dialect.js";
2
+
3
+ const CI_DATABASE = Object.freeze({
4
+ host: "127.0.0.1",
5
+ hostPort: "33060",
6
+ containerPort: "3306",
7
+ name: "jskit_ci",
8
+ user: "jskit_ci",
9
+ password: "jskit_ci_only_password",
10
+ rootPassword: "jskit_ci_only_root_password"
11
+ });
12
+
1
13
  export default Object.freeze({
2
14
  packageVersion: 1,
3
15
  packageId: "@jskit-ai/database-runtime-mysql",
4
- version: "0.1.115",
16
+ version: "0.1.117",
5
17
  kind: "runtime",
6
18
  options: {
7
19
  "db-host": {
@@ -88,10 +100,40 @@ export default Object.freeze({
88
100
  }
89
101
  }
90
102
  },
103
+ ci: {
104
+ environment: {
105
+ DB_CLIENT: DIALECT_ID,
106
+ DB_HOST: CI_DATABASE.host,
107
+ DB_PORT: CI_DATABASE.hostPort,
108
+ DB_NAME: CI_DATABASE.name,
109
+ DB_USER: CI_DATABASE.user,
110
+ DB_PASSWORD: CI_DATABASE.password
111
+ },
112
+ services: [
113
+ {
114
+ id: "mariadb",
115
+ image: "mariadb:11.4",
116
+ environment: {
117
+ MARIADB_DATABASE: CI_DATABASE.name,
118
+ MARIADB_USER: CI_DATABASE.user,
119
+ MARIADB_PASSWORD: CI_DATABASE.password,
120
+ MARIADB_ROOT_PASSWORD: CI_DATABASE.rootPassword
121
+ },
122
+ ports: [`${CI_DATABASE.hostPort}:${CI_DATABASE.containerPort}`],
123
+ healthCheck: {
124
+ command: "healthcheck.sh --connect --innodb_initialized",
125
+ interval: "10s",
126
+ timeout: "5s",
127
+ retries: 10
128
+ }
129
+ }
130
+ ],
131
+ steps: []
132
+ },
91
133
  mutations: {
92
134
  dependencies: {
93
135
  runtime: {
94
- "@jskit-ai/database-runtime": "0.1.116",
136
+ "@jskit-ai/database-runtime": "0.1.118",
95
137
  "mysql2": "^3.11.2"
96
138
  },
97
139
  dev: {}
@@ -106,7 +148,7 @@ export default Object.freeze({
106
148
  file: ".env",
107
149
  op: "upsert-env",
108
150
  key: "DB_CLIENT",
109
- value: "mysql2",
151
+ value: DIALECT_ID,
110
152
  reason: "Configure database client driver for runtime wiring.",
111
153
  category: "runtime-config",
112
154
  id: "database-client-mysql"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/database-runtime-mysql",
3
- "version": "0.1.115",
3
+ "version": "0.1.117",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -12,7 +12,7 @@
12
12
  "./shared/dialect": "./src/shared/dialect.js"
13
13
  },
14
14
  "dependencies": {
15
- "@jskit-ai/database-runtime": "0.1.116",
16
- "@jskit-ai/kernel": "0.1.117"
15
+ "@jskit-ai/database-runtime": "0.1.118",
16
+ "@jskit-ai/kernel": "0.1.119"
17
17
  }
18
18
  }
@@ -0,0 +1,22 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import descriptor from "../package.descriptor.mjs";
4
+ import { DIALECT_ID } from "../src/shared/dialect.js";
5
+
6
+ test("database-runtime-mysql contributes canonical synthetic MariaDB CI requirements", () => {
7
+ assert.equal(descriptor.ci.environment.DB_CLIENT, DIALECT_ID);
8
+ assert.equal(descriptor.ci.environment.DB_HOST, "127.0.0.1");
9
+ assert.equal(descriptor.ci.environment.DB_PORT, "33060");
10
+ assert.match(descriptor.ci.environment.DB_PASSWORD, /ci_only/u);
11
+
12
+ const service = descriptor.ci.services.find((entry) => entry.id === "mariadb");
13
+ assert.equal(service.image, "mariadb:11.4");
14
+ assert.equal(service.environment.MARIADB_DATABASE, descriptor.ci.environment.DB_NAME);
15
+ assert.equal(service.environment.MARIADB_USER, descriptor.ci.environment.DB_USER);
16
+ assert.equal(service.environment.MARIADB_PASSWORD, descriptor.ci.environment.DB_PASSWORD);
17
+ assert.deepEqual(service.ports, ["33060:3306"]);
18
+ assert.match(service.healthCheck.command, /healthcheck\.sh/u);
19
+
20
+ const clientMutation = descriptor.mutations.text.find((entry) => entry.key === "DB_CLIENT");
21
+ assert.equal(clientMutation.value, DIALECT_ID);
22
+ });