@oino-ts/db-mariadb 1.6.0 → 1.6.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/package.json +39 -39
- package/src/OINODbMariadb.ts +5 -5
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@oino-ts/db-mariadb",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "OINO TS package for using Mariadb databases.",
|
|
5
|
-
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
|
-
"license": "MPL-2.0",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/pragmatta/oino-ts.git"
|
|
10
|
-
},
|
|
11
|
-
"keywords": [
|
|
12
|
-
"sql",
|
|
13
|
-
"database",
|
|
14
|
-
"rest-api",
|
|
15
|
-
"typescript",
|
|
16
|
-
"library",
|
|
17
|
-
"mariadb",
|
|
18
|
-
"mysql"
|
|
19
|
-
],
|
|
20
|
-
"main": "./dist/cjs/index.js",
|
|
21
|
-
"module": "./dist/esm/index.js",
|
|
22
|
-
"types": "./dist/types/index.d.ts",
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@oino-ts/common": "^1.6.
|
|
25
|
-
"@oino-ts/db": "^1.6.
|
|
26
|
-
"mariadb": "^3.
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/bun": "^1.
|
|
30
|
-
"@types/node": "^20.
|
|
31
|
-
"typescript": "~5.9.
|
|
32
|
-
},
|
|
33
|
-
"files": [
|
|
34
|
-
"src/*.ts",
|
|
35
|
-
"dist/cjs/*.js",
|
|
36
|
-
"dist/esm/*.js",
|
|
37
|
-
"dist/types/*.d.ts"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@oino-ts/db-mariadb",
|
|
3
|
+
"version": "1.6.1",
|
|
4
|
+
"description": "OINO TS package for using Mariadb databases.",
|
|
5
|
+
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/pragmatta/oino-ts.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"sql",
|
|
13
|
+
"database",
|
|
14
|
+
"rest-api",
|
|
15
|
+
"typescript",
|
|
16
|
+
"library",
|
|
17
|
+
"mariadb",
|
|
18
|
+
"mysql"
|
|
19
|
+
],
|
|
20
|
+
"main": "./dist/cjs/index.js",
|
|
21
|
+
"module": "./dist/esm/index.js",
|
|
22
|
+
"types": "./dist/types/index.d.ts",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@oino-ts/common": "^1.6.1",
|
|
25
|
+
"@oino-ts/db": "^1.6.1",
|
|
26
|
+
"mariadb": "^3.5.4"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/bun": "^1.4.2",
|
|
30
|
+
"@types/node": "^20.19.43",
|
|
31
|
+
"typescript": "~5.9.3"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"src/*.ts",
|
|
35
|
+
"dist/cjs/*.js",
|
|
36
|
+
"dist/esm/*.js",
|
|
37
|
+
"dist/types/*.d.ts"
|
|
38
|
+
]
|
|
39
|
+
}
|
package/src/OINODbMariadb.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { OINODataSet, OINOBooleanDataField, OINONumberDataField, OINOStringDataF
|
|
|
10
10
|
|
|
11
11
|
import { OINODb, OINODbParams, OINODbSqlStatement } from "@oino-ts/db";
|
|
12
12
|
|
|
13
|
-
import mariadb from "mariadb";
|
|
13
|
+
import mariadb, { type Pool, type PoolConnection } from "mariadb";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Implmentation of OINODataSet for MariaDb.
|
|
@@ -104,7 +104,7 @@ export class OINODbMariadb extends OINODb {
|
|
|
104
104
|
private static _connectionExceptionMessageRegex = /\(([^\)]*)\) (.*)/i
|
|
105
105
|
private static _sqlExceptionMessageRegex = /\(([^\)]*)\) (.*)\nsql\:(.*)?/i
|
|
106
106
|
|
|
107
|
-
private _pool:
|
|
107
|
+
private _pool:Pool
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Constructor of `OINODbMariadb`
|
|
@@ -129,7 +129,7 @@ export class OINODbMariadb extends OINODb {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
private async _query(sql:string, params?:OINODataCell[]):Promise<OINODataSet> {
|
|
132
|
-
let connection:
|
|
132
|
+
let connection:PoolConnection|null = null
|
|
133
133
|
let rows:OINODataRow[] = OINO_EMPTY_ROWS
|
|
134
134
|
try {
|
|
135
135
|
connection = await this._pool.getConnection()
|
|
@@ -151,7 +151,7 @@ export class OINODbMariadb extends OINODb {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
private async _exec(sql:string, params?:OINODataCell[]):Promise<OINODataSet> {
|
|
154
|
-
let connection:
|
|
154
|
+
let connection:PoolConnection|null = null
|
|
155
155
|
let rows:OINODataRow[] = OINO_EMPTY_ROWS
|
|
156
156
|
try {
|
|
157
157
|
connection = await this._pool.getConnection()
|
|
@@ -323,7 +323,7 @@ export class OINODbMariadb extends OINODb {
|
|
|
323
323
|
if (this.isConnected) {
|
|
324
324
|
return result
|
|
325
325
|
}
|
|
326
|
-
let connection:
|
|
326
|
+
let connection:PoolConnection|null = null
|
|
327
327
|
try {
|
|
328
328
|
// make sure that any items are correctly URL encoded in the connection string
|
|
329
329
|
connection = await this._pool.getConnection()
|