@pqe-pro/source-mysql 0.0.0-stage → 0.4.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.
@@ -0,0 +1,69 @@
1
+ import { SourceFailure } from "@pqe-pro/core/internal/execution/application/source-failure";
2
+ const headerBytes = 4;
3
+ /** Bound an uncompressed exchange before mysql2 retains, assembles or decodes any payload. */
4
+ export class MysqlPacketBudget {
5
+ #header = Buffer.alloc(headerBytes);
6
+ #used = 0;
7
+ #frame;
8
+ #remaining;
9
+ #discarded = false;
10
+ #trailing = false;
11
+ #maximum;
12
+ #forward;
13
+ constructor(maximum, forward) {
14
+ this.#maximum = maximum;
15
+ this.#forward = forward;
16
+ this.#remaining = maximum;
17
+ }
18
+ hasPendingData() {
19
+ return this.#used !== 0 || this.#trailing;
20
+ }
21
+ reset() {
22
+ if (this.#discarded || this.hasPendingData()) {
23
+ throw new SourceFailure("transport", "UPSTREAM_ERROR");
24
+ }
25
+ this.#remaining = this.#maximum;
26
+ }
27
+ discard() {
28
+ this.#discarded = true;
29
+ this.#frame = undefined;
30
+ this.#used = 0;
31
+ }
32
+ push(chunk) {
33
+ let offset = 0;
34
+ while (offset < chunk.length && !this.#discarded) {
35
+ if (!this.#frame) {
36
+ const count = Math.min(headerBytes - this.#used, chunk.length - offset);
37
+ chunk.copy(this.#header, this.#used, offset, offset + count);
38
+ offset += count;
39
+ this.#used += count;
40
+ if (this.#used < headerBytes) {
41
+ return;
42
+ }
43
+ const size = headerBytes + this.#header.readUIntLE(0, 3);
44
+ if (size > this.#remaining) {
45
+ throw new SourceFailure("invalid_response", "RESPONSE_LIMIT");
46
+ }
47
+ this.#remaining -= size;
48
+ this.#frame = Buffer.allocUnsafe(size);
49
+ this.#header.copy(this.#frame);
50
+ }
51
+ const frame = this.#frame;
52
+ const count = Math.min(frame.length - this.#used, chunk.length - offset);
53
+ chunk.copy(frame, this.#used, offset, offset + count);
54
+ offset += count;
55
+ this.#used += count;
56
+ if (this.#used === frame.length) {
57
+ this.#used = 0;
58
+ this.#frame = undefined;
59
+ this.#trailing = offset < chunk.length;
60
+ try {
61
+ this.#forward(frame);
62
+ }
63
+ finally {
64
+ this.#trailing = false;
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import type { SourceAdapter, SourceContext, SourceOperation } from "@pqe-pro/core/internal/execution/application/generic-contracts";
3
+ import { type Schema } from "@pqe-pro/core/internal/execution/domain/query-model";
4
+ export declare const mysqlSourceConfigSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ serverId: z.ZodUUID;
7
+ host: z.ZodCustomStringFormat<"hostname">;
8
+ port: z.ZodNumber;
9
+ ca: z.ZodString;
10
+ capacity: z.ZodNumber;
11
+ rootReserve: z.ZodNumber;
12
+ maxQueuedTasks: z.ZodNumber;
13
+ maxDurationMs: z.ZodNumber;
14
+ cleanupMs: z.ZodNumber;
15
+ tenants: z.ZodArray<z.ZodObject<{
16
+ tenantId: z.ZodString;
17
+ user: z.ZodString;
18
+ database: z.ZodString;
19
+ password: z.ZodString;
20
+ }, z.core.$strict>>;
21
+ }, z.core.$strict>;
22
+ export type MysqlSourceConfig = z.infer<typeof mysqlSourceConfigSchema>;
23
+ export interface MysqlVariant {
24
+ readonly id: string;
25
+ readonly text: string;
26
+ readonly parameters: Schema<readonly unknown[]>;
27
+ readonly row: Schema<unknown>;
28
+ readonly maxRows: number;
29
+ readonly maxBytes: number;
30
+ }
31
+ export declare class MysqlSource implements SourceAdapter {
32
+ #private;
33
+ readonly kind = "mysql";
34
+ readonly capacityScope = "local_and_remote";
35
+ readonly cancellation = "active_cancel";
36
+ readonly maxBatchSize = 50;
37
+ readonly id: string;
38
+ readonly capacity: number;
39
+ readonly rootReserve: number;
40
+ readonly maxQueuedTasks: number;
41
+ readonly maxDurationMs: number;
42
+ constructor(config: MysqlSourceConfig, variants: readonly MysqlVariant[]);
43
+ healthy(): boolean;
44
+ snapshot(): Readonly<{
45
+ active: number;
46
+ debt: number;
47
+ }>;
48
+ intentIdentity(): Readonly<{
49
+ serverId: string;
50
+ }>;
51
+ start(input: unknown, context: SourceContext): SourceOperation;
52
+ }
@@ -0,0 +1,296 @@
1
+ import { isIP } from "node:net";
2
+ import { z } from "zod";
3
+ import { AdmissionError } from "@pqe-pro/core/internal/execution/application/admission";
4
+ import { delay } from "@pqe-pro/core/internal/execution/application/ports";
5
+ import { SourceFailure } from "@pqe-pro/core/internal/execution/application/source-failure";
6
+ import { boundary, deferred, TaskFailure, untilAborted } from "@pqe-pro/core/internal/execution/application/task-boundary";
7
+ import { identifier, plainBytes, snapshot } from "@pqe-pro/core/internal/execution/domain/query-model";
8
+ import { MysqlConnection, MysqlServerFailure } from "./connection.js";
9
+ const maximumResultBytes = 65536;
10
+ const tenantSchema = z.strictObject({
11
+ tenantId: identifier,
12
+ user: z.string().regex(/^[a-zA-Z0-9_]{1,32}$/u),
13
+ database: z.string().regex(/^[a-zA-Z0-9_]{1,64}$/u),
14
+ password: z.string().min(1).max(512),
15
+ });
16
+ export const mysqlSourceConfigSchema = z
17
+ .strictObject({
18
+ id: identifier,
19
+ serverId: z.uuid(),
20
+ host: z.hostname().refine((host) => !isIP(host)),
21
+ port: z.number().int().min(1).max(65535),
22
+ ca: z.string().min(64).max(32768),
23
+ capacity: z.number().int().min(1).max(6),
24
+ rootReserve: z.number().int().min(0).max(5),
25
+ maxQueuedTasks: z.number().int().nonnegative().max(128),
26
+ maxDurationMs: z.number().int().min(1).max(1500),
27
+ cleanupMs: z.number().int().min(1).max(1000),
28
+ tenants: z.array(tenantSchema).min(1).max(128),
29
+ })
30
+ .refine(({ tenants, capacity, rootReserve }) => rootReserve < capacity &&
31
+ new Set(tenants.map(({ tenantId }) => tenantId)).size === tenants.length &&
32
+ new Set(tenants.map(({ user }) => user)).size === tenants.length &&
33
+ new Set(tenants.map(({ database }) => database.toLowerCase())).size === tenants.length, "Expected distinct tenant IDs, readers and schemas, with a root reserve below capacity");
34
+ const requestSchema = z.strictObject({
35
+ variant: identifier,
36
+ parameters: z.array(z.unknown()).max(64),
37
+ });
38
+ const parametersSchema = z
39
+ .array(z.union([z.string().max(16384), z.number(), z.boolean(), z.null()]))
40
+ .max(64);
41
+ const connectionIdSchema = z.string().regex(/^[1-9][0-9]{0,19}$/u);
42
+ const sessionSchema = z.tuple([
43
+ z.strictObject({
44
+ id: connectionIdSchema,
45
+ serverId: z.uuid(),
46
+ account: z.string(),
47
+ databaseName: z.string(),
48
+ version: z.string().regex(/^8\.4\.\d+(?:[-+].*)?$/u),
49
+ }),
50
+ ]);
51
+ const processListSchema = z.array(z.strictObject({ id: connectionIdSchema })).max(2);
52
+ const sessionSql = "SELECT CAST(CONNECTION_ID() AS CHAR) AS id, @@server_uuid AS serverId, CURRENT_USER() AS account, DATABASE() AS databaseName, VERSION() AS version";
53
+ const plainValue = { parse: (value) => value };
54
+ const confirmed = Object.freeze({ state: "settled", unknownRemoteOutcomes: 0 });
55
+ const unconfirmed = Object.freeze({ state: "debt", unknownRemoteOutcomes: 0 });
56
+ export class MysqlSource {
57
+ kind = "mysql";
58
+ capacityScope = "local_and_remote";
59
+ cancellation = "active_cancel";
60
+ maxBatchSize = 50;
61
+ id;
62
+ capacity;
63
+ rootReserve;
64
+ maxQueuedTasks;
65
+ maxDurationMs;
66
+ #config;
67
+ #variants = new Map();
68
+ #tenants;
69
+ #active = 0;
70
+ #debt = 0;
71
+ constructor(config, variants) {
72
+ this.#config = mysqlSourceConfigSchema.parse(config);
73
+ this.#tenants = new Map(this.#config.tenants.map((tenant) => [tenant.tenantId, tenant]));
74
+ this.id = this.#config.id;
75
+ this.capacity = this.#config.capacity;
76
+ this.rootReserve = this.#config.rootReserve;
77
+ this.maxQueuedTasks = this.#config.maxQueuedTasks;
78
+ this.maxDurationMs = this.#config.maxDurationMs;
79
+ for (const variant of variants) {
80
+ identifier.parse(variant.id);
81
+ if (this.#variants.has(variant.id) ||
82
+ !/^\s*SELECT\b/iu.test(variant.text) ||
83
+ Buffer.byteLength(variant.text) > 16384 ||
84
+ !Number.isSafeInteger(variant.maxRows) ||
85
+ variant.maxRows < 1 ||
86
+ variant.maxRows > this.maxBatchSize ||
87
+ !Number.isSafeInteger(variant.maxBytes) ||
88
+ variant.maxBytes < 2 ||
89
+ variant.maxBytes > maximumResultBytes) {
90
+ throw new Error("INVALID_MYSQL_VARIANT");
91
+ }
92
+ this.#variants.set(variant.id, Object.freeze({ ...variant }));
93
+ }
94
+ }
95
+ healthy() {
96
+ return this.#debt === 0;
97
+ }
98
+ snapshot() {
99
+ return Object.freeze({ active: this.#active, debt: this.#debt });
100
+ }
101
+ intentIdentity() {
102
+ return { serverId: this.#config.serverId };
103
+ }
104
+ start(input, context) {
105
+ context.throwIfExpired();
106
+ if (!this.healthy()) {
107
+ throw new TaskFailure("SOURCE_DEBT");
108
+ }
109
+ if (this.#active >= this.capacity) {
110
+ throw new AdmissionError("OVERLOADED");
111
+ }
112
+ const tenant = this.#tenants.get(context.tenantId);
113
+ const parsed = requestSchema.safeParse(input);
114
+ const variant = parsed.success ? this.#variants.get(parsed.data.variant) : undefined;
115
+ let parameters;
116
+ try {
117
+ if (!tenant || !parsed.success || !variant) {
118
+ throw new Error("UNREGISTERED_MYSQL_TENANT_OR_VARIANT");
119
+ }
120
+ parameters = snapshot(parametersSchema, variant.parameters.parse(parsed.data.parameters), 16384);
121
+ }
122
+ catch {
123
+ throw new SourceFailure("invalid_response", "INVALID_RESULT");
124
+ }
125
+ const deadline = Math.min(context.deadlineAtMs, context.clock.now() + this.maxDurationMs);
126
+ const task = boundary(context.clock, deadline, context.signal, "UPSTREAM_TIMEOUT");
127
+ const settlement = deferred();
128
+ this.#active++;
129
+ const result = Promise.resolve()
130
+ .then(() => this.#run(tenant, variant, parameters, context, task.signal, deadline, settlement.resolve))
131
+ .finally(() => task.dispose());
132
+ return {
133
+ result: untilAborted(result, task.signal),
134
+ settled: settlement.promise,
135
+ cancel: (reason) => task.cancel(reason),
136
+ };
137
+ }
138
+ async #run(tenant, variant, parameters, context, signal, deadline, settle) {
139
+ const checkDeadline = () => {
140
+ signal.throwIfAborted();
141
+ if (context.clock.now() >= deadline) {
142
+ throw new TaskFailure("UPSTREAM_TIMEOUT");
143
+ }
144
+ };
145
+ let control;
146
+ let observerId;
147
+ let worker;
148
+ let pair;
149
+ let rolledBack = false;
150
+ let proven;
151
+ const rows = [];
152
+ try {
153
+ checkDeadline();
154
+ const { host, port, ca, serverId } = this.#config;
155
+ const options = {
156
+ host,
157
+ port,
158
+ ca,
159
+ user: tenant.user,
160
+ password: tenant.password,
161
+ database: tenant.database,
162
+ connectTimeout: this.maxDurationMs,
163
+ };
164
+ control = new MysqlConnection(options);
165
+ await untilAborted(control.ready, signal);
166
+ observerId = await this.#session(control, tenant, signal);
167
+ checkDeadline();
168
+ worker = new MysqlConnection(options);
169
+ await untilAborted(worker.ready, signal);
170
+ const connectionId = await this.#session(worker, tenant, signal);
171
+ if (connectionId === observerId ||
172
+ !(await this.#visible(control, observerId, connectionId, signal))) {
173
+ throw new SourceFailure("transport", "UPSTREAM_ERROR");
174
+ }
175
+ pair = { serverId, connectionId, observerId };
176
+ await untilAborted(context.acquired({ serverId, connectionId }), signal);
177
+ checkDeadline();
178
+ await untilAborted(worker.query(`SET SESSION max_execution_time = ${this.maxDurationMs}`), signal);
179
+ checkDeadline();
180
+ await untilAborted(worker.query("START TRANSACTION READ ONLY"), signal);
181
+ checkDeadline();
182
+ let bytes = 2;
183
+ await untilAborted(worker.select(variant.text, parameters, (raw) => {
184
+ if (rows.length >= variant.maxRows) {
185
+ throw new SourceFailure("invalid_response", "RESPONSE_LIMIT");
186
+ }
187
+ let row;
188
+ try {
189
+ row = variant.row.parse(raw);
190
+ bytes += plainBytes(row) + (rows.length === 0 ? 0 : 1);
191
+ }
192
+ catch {
193
+ throw new SourceFailure("invalid_response", "INVALID_RESULT");
194
+ }
195
+ if (bytes > variant.maxBytes) {
196
+ throw new SourceFailure("invalid_response", "RESPONSE_LIMIT");
197
+ }
198
+ rows.push(snapshot(plainValue, row, variant.maxBytes));
199
+ }), signal);
200
+ checkDeadline();
201
+ await untilAborted(worker.query("ROLLBACK"), signal);
202
+ rolledBack = true;
203
+ }
204
+ catch (error) {
205
+ if (error instanceof MysqlServerFailure && error.serverCode === "ER_QUERY_TIMEOUT") {
206
+ throw new SourceFailure("server", "UPSTREAM_TIMEOUT");
207
+ }
208
+ if (signal.aborted || error instanceof TaskFailure) {
209
+ throw error;
210
+ }
211
+ throw new SourceFailure("transport", "UPSTREAM_ERROR");
212
+ }
213
+ finally {
214
+ proven = await this.#cleanup(context, worker, control, pair, rolledBack, observerId);
215
+ const report = proven ? confirmed : unconfirmed;
216
+ if (proven) {
217
+ this.#active--;
218
+ }
219
+ else {
220
+ this.#debt++;
221
+ }
222
+ settle(pair
223
+ ? {
224
+ ...report,
225
+ resourceIdentity: { serverId: pair.serverId, connectionId: pair.connectionId },
226
+ }
227
+ : report);
228
+ }
229
+ if (!proven) {
230
+ throw new TaskFailure("SOURCE_DEBT");
231
+ }
232
+ checkDeadline();
233
+ return Object.freeze(rows);
234
+ }
235
+ async #session(connection, tenant, signal) {
236
+ signal.throwIfAborted();
237
+ const [session] = sessionSchema.parse(await untilAborted(connection.query(sessionSql), signal));
238
+ if (session.serverId !== this.#config.serverId ||
239
+ session.id !== String(connection.threadId) ||
240
+ !session.account.startsWith(`${tenant.user}@`) ||
241
+ session.databaseName !== tenant.database) {
242
+ throw new SourceFailure("transport", "UPSTREAM_ERROR");
243
+ }
244
+ return session.id;
245
+ }
246
+ async #visible(control, observerId, connectionId, signal) {
247
+ signal.throwIfAborted();
248
+ const rows = processListSchema.parse(await untilAborted(control.query(`SELECT CAST(ID AS CHAR) AS id FROM performance_schema.processlist WHERE ID IN (${observerId}, ${connectionId})`), signal));
249
+ if (!rows.some(({ id }) => id === observerId)) {
250
+ throw new SourceFailure("transport", "UPSTREAM_ERROR");
251
+ }
252
+ return rows.some(({ id }) => id === connectionId);
253
+ }
254
+ async #cleanup(context, worker, control, pair, rolledBack, observerId) {
255
+ const cleanup = boundary(context.clock, context.clock.now() + this.#config.cleanupMs, new AbortController().signal, "UPSTREAM_TIMEOUT");
256
+ const { signal } = cleanup;
257
+ // Before a worker is opened, the control session can only be released after its startup
258
+ // exchange has completed. A lost control connection does not acknowledge that exchange.
259
+ let proven = !worker && (!control || observerId !== undefined);
260
+ try {
261
+ if (worker && control && pair) {
262
+ if (!rolledBack) {
263
+ // A KILL reply (including "no such thread") still requires independent evidence.
264
+ try {
265
+ await untilAborted(control.query(`KILL CONNECTION ${pair.connectionId}`), signal);
266
+ }
267
+ catch (error) {
268
+ if (!(error instanceof MysqlServerFailure && error.serverCode === "ER_NO_SUCH_THREAD")) {
269
+ throw error;
270
+ }
271
+ }
272
+ }
273
+ await untilAborted(worker.close(), signal);
274
+ while (await this.#visible(control, pair.observerId, pair.connectionId, signal)) {
275
+ await delay(context.clock, 25, signal);
276
+ }
277
+ proven = true;
278
+ }
279
+ }
280
+ catch {
281
+ proven = false;
282
+ }
283
+ finally {
284
+ try {
285
+ await untilAborted(Promise.all([worker?.close(), control?.close()]), signal);
286
+ }
287
+ catch {
288
+ proven = false;
289
+ }
290
+ finally {
291
+ cleanup.dispose();
292
+ }
293
+ }
294
+ return proven;
295
+ }
296
+ }
@@ -0,0 +1,2 @@
1
+ export { MysqlSource, mysqlSourceConfigSchema } from "../execution/infrastructure/mysql/source.js";
2
+ export type { MysqlSourceConfig, MysqlVariant } from "../execution/infrastructure/mysql/source.js";
@@ -0,0 +1 @@
1
+ export { MysqlSource, mysqlSourceConfigSchema } from "../execution/infrastructure/mysql/source.js";
@@ -0,0 +1,131 @@
1
+ {
2
+ "name": "@pqe-pro/source-mysql",
3
+ "version": "0.4.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "@pqe-pro/source-mysql",
9
+ "version": "0.4.0",
10
+ "engines": {
11
+ "node": ">=22.12.0"
12
+ },
13
+ "dependencies": {
14
+ "@pqe-pro/core": "0.4.0",
15
+ "mysql2": "3.26.1",
16
+ "zod": "4.6.7"
17
+ }
18
+ },
19
+ "node_modules/aws-ssl-profiles": {
20
+ "version": "1.1.2",
21
+ "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz",
22
+ "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==",
23
+ "license": "MIT",
24
+ "engines": {
25
+ "node": ">= 6.0.0"
26
+ }
27
+ },
28
+ "node_modules/generate-function": {
29
+ "version": "2.3.1",
30
+ "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
31
+ "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
32
+ "license": "MIT",
33
+ "dependencies": {
34
+ "is-property": "^1.0.2"
35
+ }
36
+ },
37
+ "node_modules/iconv-lite": {
38
+ "version": "0.7.3",
39
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
40
+ "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
41
+ "license": "MIT",
42
+ "dependencies": {
43
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
44
+ },
45
+ "engines": {
46
+ "node": ">=0.10.0"
47
+ },
48
+ "funding": {
49
+ "type": "opencollective",
50
+ "url": "https://opencollective.com/express"
51
+ }
52
+ },
53
+ "node_modules/is-property": {
54
+ "version": "1.0.2",
55
+ "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
56
+ "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
57
+ "license": "MIT"
58
+ },
59
+ "node_modules/long": {
60
+ "version": "5.3.2",
61
+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
62
+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
63
+ "license": "Apache-2.0"
64
+ },
65
+ "node_modules/lru.min": {
66
+ "version": "1.1.5",
67
+ "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.5.tgz",
68
+ "integrity": "sha512-5J9ysMYUpYIg9RF2vJpy9SinEmSviFSe0GyPpCQ4L5QSkLAgeLXlTAOu2ZwWUU5m+0SBl6gUU1R1ZQB3aKypfA==",
69
+ "license": "MIT",
70
+ "engines": {
71
+ "bun": ">=1.0.0",
72
+ "deno": ">=1.30.0",
73
+ "node": ">=8.0.0"
74
+ },
75
+ "funding": {
76
+ "type": "github",
77
+ "url": "https://github.com/sponsors/wellwelwel"
78
+ }
79
+ },
80
+ "node_modules/mysql2": {
81
+ "version": "3.26.1",
82
+ "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.26.1.tgz",
83
+ "integrity": "sha512-oaKGziozCVXn3/UQyGIvtSqdWyjbPx04+7/p9QAWOmPkUVSirQpzYaiT6stQys2dOeakrHvM4q46YUXpmUkt8w==",
84
+ "license": "MIT",
85
+ "dependencies": {
86
+ "aws-ssl-profiles": "^1.1.2",
87
+ "generate-function": "^2.3.1",
88
+ "iconv-lite": "^0.7.3",
89
+ "long": "^5.3.2",
90
+ "lru.min": "^1.1.5",
91
+ "sql-escaper": "^1.10.0"
92
+ },
93
+ "engines": {
94
+ "node": ">= 8.0"
95
+ },
96
+ "peerDependencies": {
97
+ "@types/node": ">= 8"
98
+ }
99
+ },
100
+ "node_modules/safer-buffer": {
101
+ "version": "2.1.2",
102
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
103
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
104
+ "license": "MIT"
105
+ },
106
+ "node_modules/sql-escaper": {
107
+ "version": "1.10.3",
108
+ "resolved": "https://registry.npmjs.org/sql-escaper/-/sql-escaper-1.10.3.tgz",
109
+ "integrity": "sha512-X0fuDP95fXheQgq5AH0QwMQi8gQzcxioWIYft3SJLvJaCdSNAHkHQ6pPEKYQc/F6BnJpz+ybPYMNBSFEM7V7sw==",
110
+ "license": "MIT",
111
+ "engines": {
112
+ "bun": ">=1.0.0",
113
+ "deno": ">=2.0.0",
114
+ "node": ">=12.0.0"
115
+ },
116
+ "funding": {
117
+ "type": "github",
118
+ "url": "https://github.com/mysqljs/sql-escaper?sponsor=1"
119
+ }
120
+ },
121
+ "node_modules/zod": {
122
+ "version": "4.6.7",
123
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
124
+ "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
125
+ "license": "MIT",
126
+ "funding": {
127
+ "url": "https://github.com/sponsors/colinhacks"
128
+ }
129
+ }
130
+ }
131
+ }
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "@pqe-pro/source-mysql",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Tenant-scoped, bounded MySQL 8.4 source for the Progressive Query Engine.",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "progressive",
8
+ "query",
9
+ "streaming",
10
+ "ndjson",
11
+ "deadline",
12
+ "typescript",
13
+ "mysql",
14
+ "mysql2"
15
+ ],
16
+ "homepage": "https://github.com/watscho/pqe-pro#readme",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/watscho/pqe-pro.git",
20
+ "directory": "packages/source-mysql"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/watscho/pqe-pro/issues"
24
+ },
25
+ "type": "module",
26
+ "engines": {
27
+ "node": ">=22.12.0"
28
+ },
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/exports/mysql.d.ts",
32
+ "import": "./dist/exports/mysql.js",
33
+ "default": "./dist/exports/mysql.js"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "LICENSE",
39
+ "README.md",
40
+ "NOTICE.md",
41
+ "dependency-notices.json",
42
+ "sbom.cdx.json",
43
+ "npm-shrinkwrap.json"
44
+ ],
45
+ "dependencies": {
46
+ "@pqe-pro/core": "0.4.0",
47
+ "mysql2": "3.26.1",
48
+ "zod": "4.6.7"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public",
52
+ "registry": "https://registry.npmjs.org/"
53
+ }
54
+ }