Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit b35ee00

Browse files
fix: deps
1 parent f77a2e5 commit b35ee00

File tree

8 files changed

+282
-320
lines changed

8 files changed

+282
-320
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- { uses: actions/setup-node@v4, with: { node-version: 'lts/*', cache: 'yarn' } }
1515

1616
# Cache for npm/npx in ~/.npm
17-
- uses: actions/cache@v3
17+
- uses: actions/cache@v4
1818
with:
1919
path: ~/.npm
2020
key: npm-v1-${{ runner.os }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"prepare": "husky install"
55
},
66
"dependencies": {
7-
"@naturalcycles/db-lib": "^8.16.2",
7+
"@naturalcycles/db-lib": "^9.1.0",
88
"@naturalcycles/js-lib": "^14.47.0",
99
"@naturalcycles/nodejs-lib": "^13.1.0",
1010
"@types/mysql": "^2.15.19",

src/dbAdapter.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import { getDBAdapter } from './dbAdapter'
2-
import { MysqlDB, MysqlDBCfg, MysqlDBOptions, MysqlDBSaveOptions } from './mysql.db'
3-
import { MySQLKeyValueDB } from './mysqlKeyValueDB'
4-
import { jsonSchemaToMySQLDDL } from './schema/mysql.schema.util'
5-
6-
export type { MysqlDBCfg, MysqlDBOptions, MysqlDBSaveOptions }
7-
8-
export { MysqlDB, MySQLKeyValueDB, jsonSchemaToMySQLDDL, getDBAdapter }
1+
export * from './mysql.db'
2+
export * from './mysqlKeyValueDB'
3+
export { jsonSchemaToMySQLDDL } from './schema/mysql.schema.util'

src/mysql.db.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import {
99
CommonDBSaveOptions,
1010
DBQuery,
1111
RunQueryResult,
12+
CommonDBSupport,
13+
commonDBFullSupport,
14+
CommonDBType,
1215
} from '@naturalcycles/db-lib'
1316
import {
1417
_assert,
@@ -91,6 +94,14 @@ const typeCast: TypeCast = (field, next) => {
9194
}
9295

9396
export class MysqlDB extends BaseCommonDB implements CommonDB {
97+
override dbType = CommonDBType.relational
98+
99+
override support: CommonDBSupport = {
100+
...commonDBFullSupport,
101+
updateSaveMethod: false,
102+
transactions: false,
103+
}
104+
94105
constructor(cfg: MysqlDBCfg = {}) {
95106
super()
96107
this.cfg = {
@@ -352,7 +363,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
352363
/**
353364
* Limitation: always returns [], regardless of which rows are actually deleted
354365
*/
355-
async deleteByIds<ROW extends ObjectWithId>(
366+
override async deleteByIds<ROW extends ObjectWithId>(
356367
table: string,
357368
ids: ROW['id'][],
358369
_opt?: MysqlDBOptions,

src/test/mysql.manual.test.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,9 @@ afterAll(async () => {
4242
await db.close()
4343
})
4444

45-
describe('runCommonDBTest', () =>
46-
runCommonDBTest(
47-
db,
48-
{
49-
update: false,
50-
},
51-
{ allowExtraPropertiesInResponse: true },
52-
))
45+
describe('runCommonDBTest', () => runCommonDBTest(db, { allowExtraPropertiesInResponse: true }))
5346

54-
describe('runCommonDaoTest', () =>
55-
runCommonDaoTest(
56-
db,
57-
{
58-
update: false,
59-
},
60-
{ allowExtraPropertiesInResponse: false },
61-
))
47+
describe('runCommonDaoTest', () => runCommonDaoTest(db, { allowExtraPropertiesInResponse: false }))
6248

6349
test('getTableSchema', async () => {
6450
// console.log(await db.getTables())

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": "@naturalcycles/dev-lib/cfg/tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "dist"
4+
"outDir": "dist",
55
},
66
"include": ["src"],
7-
"exclude": ["**/__exclude"]
7+
"exclude": ["**/__exclude"],
88
}

0 commit comments

Comments
 (0)