Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to mysql2 (resolves #160) #161

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: 'Pull Request'
name: 'CI'
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
- master

env:
NPM_VERSION: 7
NPM_VERSION: 10

jobs:
test:
Expand Down
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Type definitions for serverless-mysql

import * as MySQL from 'mysql'
import * as MySQL from 'mysql2'

// https://github.com/microsoft/TypeScript/issues/8335#issuecomment-215194561
declare namespace serverlessMysql {
Expand Down Expand Up @@ -100,9 +100,9 @@ declare namespace serverlessMysql {
config(config?: string | MySQL.ConnectionConfig): MySQL.ConnectionConfig
query<T>(...args: any[]): Promise<T>
end(): Promise<void>
escape: MySQL.EscapeFunctions['escape'],
escapeId: MySQL.EscapeFunctions['escapeId'],
format: MySQL.EscapeFunctions['format'],
escape: typeof MySQL.escape
escapeId: typeof MySQL.escapeId
format: typeof MySQL.format
quit(): void
transaction(): Transaction
getCounter(): number
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ module.exports = (params) => {
/********************************************************************/
const cfg = typeof params === 'object' && !Array.isArray(params) ? params : {}

MYSQL = cfg.library || require('mysql')
MYSQL = cfg.library || require('mysql2')
PromiseLibrary = cfg.promise || Promise

// Set defaults for connection management
Expand Down
Loading
Loading