Skip to content

Commit

Permalink
Merge pull request #65 from wviveiro/escape-function
Browse files Browse the repository at this point in the history
Export escape function on serverless-mysql
  • Loading branch information
jeremydaly authored Jan 28, 2020
2 parents 00afe1d + 811b700 commit 5a61b56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ declare namespace serverlessMysql {
config(config?: MySQL.ConnectionConfig): MySQL.ConnectionConfig
query<T>(...args): Promise<T>
end(): Promise<void>
escape(str: string): MySQL.EscapeFunctions
quit(): void
transaction(): Transaction
getCounter(): number
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,18 @@ module.exports = (params) => {
onKillError = typeof cfg.onKillError === 'function' ? cfg.onKillError : () => {}

let connCfg = typeof cfg.config === 'object' && !Array.isArray(cfg.config) ? cfg.config : {}

let escape = MYSQL.escape
// Set MySQL configs
config(connCfg)


// Return public methods
return {
connect,
config,
query,
end,
escape,
quit,
transaction,
getCounter,
Expand Down

0 comments on commit 5a61b56

Please sign in to comment.