Skip to content

Commit

Permalink
fix: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Jan 17, 2024
1 parent f77a2e5 commit b35ee00
Show file tree
Hide file tree
Showing 8 changed files with 282 additions and 320 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- { uses: actions/setup-node@v4, with: { node-version: 'lts/*', cache: 'yarn' } }

# Cache for npm/npx in ~/.npm
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-v1-${{ runner.os }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"prepare": "husky install"
},
"dependencies": {
"@naturalcycles/db-lib": "^8.16.2",
"@naturalcycles/db-lib": "^9.1.0",
"@naturalcycles/js-lib": "^14.47.0",
"@naturalcycles/nodejs-lib": "^13.1.0",
"@types/mysql": "^2.15.19",
Expand Down
6 changes: 0 additions & 6 deletions src/dbAdapter.ts

This file was deleted.

11 changes: 3 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { getDBAdapter } from './dbAdapter'
import { MysqlDB, MysqlDBCfg, MysqlDBOptions, MysqlDBSaveOptions } from './mysql.db'
import { MySQLKeyValueDB } from './mysqlKeyValueDB'
import { jsonSchemaToMySQLDDL } from './schema/mysql.schema.util'

export type { MysqlDBCfg, MysqlDBOptions, MysqlDBSaveOptions }

export { MysqlDB, MySQLKeyValueDB, jsonSchemaToMySQLDDL, getDBAdapter }
export * from './mysql.db'
export * from './mysqlKeyValueDB'
export { jsonSchemaToMySQLDDL } from './schema/mysql.schema.util'
13 changes: 12 additions & 1 deletion src/mysql.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {
CommonDBSaveOptions,
DBQuery,
RunQueryResult,
CommonDBSupport,
commonDBFullSupport,
CommonDBType,
} from '@naturalcycles/db-lib'
import {
_assert,
Expand Down Expand Up @@ -91,6 +94,14 @@ const typeCast: TypeCast = (field, next) => {
}

export class MysqlDB extends BaseCommonDB implements CommonDB {
override dbType = CommonDBType.relational

override support: CommonDBSupport = {
...commonDBFullSupport,
updateSaveMethod: false,
transactions: false,
}

constructor(cfg: MysqlDBCfg = {}) {
super()
this.cfg = {
Expand Down Expand Up @@ -352,7 +363,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
/**
* Limitation: always returns [], regardless of which rows are actually deleted
*/
async deleteByIds<ROW extends ObjectWithId>(
override async deleteByIds<ROW extends ObjectWithId>(
table: string,
ids: ROW['id'][],
_opt?: MysqlDBOptions,
Expand Down
18 changes: 2 additions & 16 deletions src/test/mysql.manual.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,9 @@ afterAll(async () => {
await db.close()
})

describe('runCommonDBTest', () =>
runCommonDBTest(
db,
{
update: false,
},
{ allowExtraPropertiesInResponse: true },
))
describe('runCommonDBTest', () => runCommonDBTest(db, { allowExtraPropertiesInResponse: true }))

describe('runCommonDaoTest', () =>
runCommonDaoTest(
db,
{
update: false,
},
{ allowExtraPropertiesInResponse: false },
))
describe('runCommonDaoTest', () => runCommonDaoTest(db, { allowExtraPropertiesInResponse: false }))

test('getTableSchema', async () => {
// console.log(await db.getTables())
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@naturalcycles/dev-lib/cfg/tsconfig.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
},
"include": ["src"],
"exclude": ["**/__exclude"]
"exclude": ["**/__exclude"],
}
Loading

0 comments on commit b35ee00

Please sign in to comment.