Skip to content

Commit 2eb69f8

Browse files
authored
Upgrade to mysql2 (resolves #160) (#161)
* Upgrade to mysql2 * Update ci files * Version bump * Regenerate package-lock, upgrade word-wrap to resolve #151
1 parent 5c23404 commit 2eb69f8

File tree

5 files changed

+560
-869
lines changed

5 files changed

+560
-869
lines changed

.github/workflows/pull-request.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: 'Pull Request'
1+
name: 'CI'
22
on:
33
pull_request:
44
types: [opened, reopened, synchronize]
5+
push:
6+
branches:
7+
- main
8+
- master
59

610
env:
7-
NPM_VERSION: 7
11+
NPM_VERSION: 10
812

913
jobs:
1014
test:

index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Type definitions for serverless-mysql
22

3-
import * as MySQL from 'mysql'
3+
import * as MySQL from 'mysql2'
44

55
// https://github.com/microsoft/TypeScript/issues/8335#issuecomment-215194561
66
declare namespace serverlessMysql {
@@ -100,9 +100,9 @@ declare namespace serverlessMysql {
100100
config(config?: string | MySQL.ConnectionConfig): MySQL.ConnectionConfig
101101
query<T>(...args: any[]): Promise<T>
102102
end(): Promise<void>
103-
escape: MySQL.EscapeFunctions['escape'],
104-
escapeId: MySQL.EscapeFunctions['escapeId'],
105-
format: MySQL.EscapeFunctions['format'],
103+
escape: typeof MySQL.escape
104+
escapeId: typeof MySQL.escapeId
105+
format: typeof MySQL.format
106106
quit(): void
107107
transaction(): Transaction
108108
getCounter(): number

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ module.exports = (params) => {
383383
/********************************************************************/
384384
const cfg = typeof params === 'object' && !Array.isArray(params) ? params : {}
385385

386-
MYSQL = cfg.library || require('mysql')
386+
MYSQL = cfg.library || require('mysql2')
387387
PromiseLibrary = cfg.promise || Promise
388388

389389
// Set defaults for connection management

0 commit comments

Comments
 (0)