Skip to content

Commit

Permalink
chore: fix regression issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 7, 2023
1 parent 29d80a5 commit fbb2248
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
- name: Unit Test
run: yarn test:json mongo
- name: Report Coverage
if: ${{ matrix.node-version == 16 }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -106,7 +105,6 @@ jobs:
- name: Unit Test
run: yarn test:json ${{ matrix.driver-name }}
- name: Report Coverage
if: ${{ matrix.node-version == 16 }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
},
"devDependencies": {
"@types/mocha": "^9.1.1",
"@types/node": "^18.14.2",
"@types/node": "^18.15.3",
"c8": "^7.13.0",
"esbuild": "^0.17.10",
"esbuild": "^0.17.12",
"esbuild-register": "^3.4.2",
"mocha": "^9.2.2",
"shx": "^0.3.4",
"typescript": "^4.9.5",
"yakumo": "^0.3.9",
"yakumo": "^0.3.10",
"yakumo-esbuild": "^0.3.22",
"yakumo-mocha": "^0.3.1",
"yakumo-publish": "^0.3.4",
"yakumo-publish-sync": "^0.3.2",
"yakumo-tsc": "^0.3.7",
"yakumo-tsc": "^0.3.8",
"yakumo-upgrade": "^0.3.3",
"yakumo-version": "^0.3.4"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mysql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@minatojs/driver-mysql",
"version": "2.4.2",
"version": "2.4.4",
"description": "MySQL Driver for Minato",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
21 changes: 11 additions & 10 deletions packages/mysql/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,18 @@ interface QueryTask {
}

class MySQLBuilder extends Builder {
// eslint-disable-next-line no-control-regex
protected escapeRegExp = /[\0\b\t\n\r\x1a'"\\]/g
protected escapeMap = {
'\0' : '\\0',
'\b' : '\\b',
'\t' : '\\t',
'\n' : '\\n',
'\r' : '\\r',
'\x1a' : '\\Z',
'\"' : '\\\"',
'\'' : '\\\'',
'\\' : '\\\\',
'\0': '\\0',
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\r': '\\r',
'\x1a': '\\Z',
'\"': '\\\"',
'\'': '\\\'',
'\\': '\\\\',
}

constructor(tables?: Dict<Model>) {
Expand Down Expand Up @@ -348,7 +349,7 @@ export class MySQLDriver extends Driver {

_select<T extends {}>(table: string, fields: readonly (string & keyof T)[], conditional?: string, values?: readonly any[]): Promise<T[]>
_select(table: string, fields: string[], conditional?: string, values: readonly any[] = []) {
let sql = `SELECT ${this._joinKeys(fields)} FROM ${escapeId(table)}`
let sql = `SELECT ${this._joinKeys(fields)} FROM ${table}`
if (conditional) sql += ` WHERE ${conditional}`
return this.queue(sql, values)
}
Expand Down

0 comments on commit fbb2248

Please sign in to comment.