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

Commit ef8eaab

Browse files
chore: minor things
1 parent 48d0d3f commit ef8eaab

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/mysql.db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export interface MysqlDBCfg extends PoolConfig {
6060
const BOOLEAN_TYPES = new Set(['TINY', 'TINYINT', 'INT'])
6161
const BOOLEAN_BIT_TYPES = new Set(['BIT'])
6262

63-
export const typeCast: TypeCast = (field, next) => {
63+
const typeCast: TypeCast = (field, next) => {
6464
// cast to boolean
6565
if (field.length === 1) {
6666
if (BOOLEAN_BIT_TYPES.has(field.type)) {

src/mysqlKeyValueDB.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,18 @@ import { CommonDBCreateOptions, CommonKeyValueDB, KeyValueDBTuple } from '@natur
33
import { pMap } from '@naturalcycles/js-lib'
44
import { ReadableTyped } from '@naturalcycles/nodejs-lib'
55
import { QueryOptions } from 'mysql'
6-
import { MysqlDB, MysqlDBCfg, typeCast } from './mysql.db'
6+
import { MysqlDB, MysqlDBCfg } from './mysql.db'
77

88
interface KeyValueObject {
99
id: string
1010
v: Buffer
1111
}
1212

1313
export class MySQLKeyValueDB implements CommonKeyValueDB {
14-
constructor(cfg: MysqlDBCfg = {}) {
15-
this.cfg = {
16-
typeCast,
17-
...cfg,
18-
}
19-
14+
constructor(public cfg: MysqlDBCfg) {
2015
this.db = new MysqlDB(this.cfg)
2116
}
2217

23-
cfg: MysqlDBCfg
24-
2518
db: MysqlDB
2619

2720
async ping(): Promise<void> {

0 commit comments

Comments
 (0)