@prisma/adapter-mariadb 6.15.0-dev.26 → 6.15.0-dev.27
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/index.d.mts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +17 -6
- package/dist/index.mjs +17 -6
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -30,11 +30,9 @@ declare class MariaDbQueryable<Connection extends mariadb.Pool | mariadb.Connect
|
|
|
30
30
|
|
|
31
31
|
export declare class PrismaMariaDb implements SqlDriverAdapterFactory {
|
|
32
32
|
#private;
|
|
33
|
-
private readonly config;
|
|
34
|
-
private readonly options?;
|
|
35
33
|
readonly provider = "mysql";
|
|
36
34
|
readonly adapterName: string;
|
|
37
|
-
constructor(config: mariadb.PoolConfig | string, options?: PrismaMariadbOptions
|
|
35
|
+
constructor(config: mariadb.PoolConfig | string, options?: PrismaMariadbOptions);
|
|
38
36
|
connect(): Promise<PrismaMariaDbAdapter>;
|
|
39
37
|
}
|
|
40
38
|
|
package/dist/index.d.ts
CHANGED
|
@@ -30,11 +30,9 @@ declare class MariaDbQueryable<Connection extends mariadb.Pool | mariadb.Connect
|
|
|
30
30
|
|
|
31
31
|
export declare class PrismaMariaDb implements SqlDriverAdapterFactory {
|
|
32
32
|
#private;
|
|
33
|
-
private readonly config;
|
|
34
|
-
private readonly options?;
|
|
35
33
|
readonly provider = "mysql";
|
|
36
34
|
readonly adapterName: string;
|
|
37
|
-
constructor(config: mariadb.PoolConfig | string, options?: PrismaMariadbOptions
|
|
35
|
+
constructor(config: mariadb.PoolConfig | string, options?: PrismaMariadbOptions);
|
|
38
36
|
connect(): Promise<PrismaMariaDbAdapter>;
|
|
39
37
|
}
|
|
40
38
|
|
package/dist/index.js
CHANGED
|
@@ -417,19 +417,21 @@ var PrismaMariaDbAdapter = class extends MariaDbQueryable {
|
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
var PrismaMariaDbAdapterFactory = class {
|
|
420
|
-
constructor(config, options) {
|
|
421
|
-
this.config = config;
|
|
422
|
-
this.options = options;
|
|
423
|
-
}
|
|
424
420
|
provider = "mysql";
|
|
425
421
|
adapterName = name;
|
|
426
422
|
#capabilities;
|
|
423
|
+
#config;
|
|
424
|
+
#options;
|
|
425
|
+
constructor(config, options) {
|
|
426
|
+
this.#config = rewriteConnectionString(config);
|
|
427
|
+
this.#options = options;
|
|
428
|
+
}
|
|
427
429
|
async connect() {
|
|
428
|
-
const pool = mariadb.createPool(this
|
|
430
|
+
const pool = mariadb.createPool(this.#config);
|
|
429
431
|
if (this.#capabilities === void 0) {
|
|
430
432
|
this.#capabilities = await getCapabilities(pool);
|
|
431
433
|
}
|
|
432
|
-
return new PrismaMariaDbAdapter(pool, this.#capabilities, this
|
|
434
|
+
return new PrismaMariaDbAdapter(pool, this.#capabilities, this.#options);
|
|
433
435
|
}
|
|
434
436
|
};
|
|
435
437
|
async function getCapabilities(pool) {
|
|
@@ -459,6 +461,15 @@ function inferCapabilities(version) {
|
|
|
459
461
|
const supportsRelationJoins = !isMariaDB && (major > 8 || major === 8 && minor >= 0 && patch >= 13);
|
|
460
462
|
return { supportsRelationJoins };
|
|
461
463
|
}
|
|
464
|
+
function rewriteConnectionString(config) {
|
|
465
|
+
if (typeof config !== "string") {
|
|
466
|
+
return config;
|
|
467
|
+
}
|
|
468
|
+
if (!config.startsWith("mysql://")) {
|
|
469
|
+
return config;
|
|
470
|
+
}
|
|
471
|
+
return config.replace(/^mysql:\/\//, "mariadb://");
|
|
472
|
+
}
|
|
462
473
|
// Annotate the CommonJS export names for ESM import in node:
|
|
463
474
|
0 && (module.exports = {
|
|
464
475
|
PrismaMariaDb
|
package/dist/index.mjs
CHANGED
|
@@ -381,19 +381,21 @@ var PrismaMariaDbAdapter = class extends MariaDbQueryable {
|
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
var PrismaMariaDbAdapterFactory = class {
|
|
384
|
-
constructor(config, options) {
|
|
385
|
-
this.config = config;
|
|
386
|
-
this.options = options;
|
|
387
|
-
}
|
|
388
384
|
provider = "mysql";
|
|
389
385
|
adapterName = name;
|
|
390
386
|
#capabilities;
|
|
387
|
+
#config;
|
|
388
|
+
#options;
|
|
389
|
+
constructor(config, options) {
|
|
390
|
+
this.#config = rewriteConnectionString(config);
|
|
391
|
+
this.#options = options;
|
|
392
|
+
}
|
|
391
393
|
async connect() {
|
|
392
|
-
const pool = mariadb.createPool(this
|
|
394
|
+
const pool = mariadb.createPool(this.#config);
|
|
393
395
|
if (this.#capabilities === void 0) {
|
|
394
396
|
this.#capabilities = await getCapabilities(pool);
|
|
395
397
|
}
|
|
396
|
-
return new PrismaMariaDbAdapter(pool, this.#capabilities, this
|
|
398
|
+
return new PrismaMariaDbAdapter(pool, this.#capabilities, this.#options);
|
|
397
399
|
}
|
|
398
400
|
};
|
|
399
401
|
async function getCapabilities(pool) {
|
|
@@ -423,6 +425,15 @@ function inferCapabilities(version) {
|
|
|
423
425
|
const supportsRelationJoins = !isMariaDB && (major > 8 || major === 8 && minor >= 0 && patch >= 13);
|
|
424
426
|
return { supportsRelationJoins };
|
|
425
427
|
}
|
|
428
|
+
function rewriteConnectionString(config) {
|
|
429
|
+
if (typeof config !== "string") {
|
|
430
|
+
return config;
|
|
431
|
+
}
|
|
432
|
+
if (!config.startsWith("mysql://")) {
|
|
433
|
+
return config;
|
|
434
|
+
}
|
|
435
|
+
return config.replace(/^mysql:\/\//, "mariadb://");
|
|
436
|
+
}
|
|
426
437
|
export {
|
|
427
438
|
PrismaMariaDbAdapterFactory as PrismaMariaDb
|
|
428
439
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-mariadb",
|
|
3
|
-
"version": "6.15.0-dev.
|
|
3
|
+
"version": "6.15.0-dev.27",
|
|
4
4
|
"description": "Prisma's driver adapter for \"mariadb\"",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"mariadb": "3.4.2",
|
|
35
|
-
"@prisma/driver-adapter-utils": "6.15.0-dev.
|
|
35
|
+
"@prisma/driver-adapter-utils": "6.15.0-dev.27"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"vitest": "3.0.9"
|