Skip to content

Commit 811b700

Browse files
committed
Export escape function on serverless-mysql
1 parent 16d9673 commit 811b700

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ declare namespace serverlessMysql {
100100
config(config?: MySQL.ConnectionConfig): MySQL.ConnectionConfig
101101
query<T>(...args): Promise<T>
102102
end(): Promise<void>
103+
escape(str: string): MySQL.EscapeFunctions
103104
quit(): void
104105
transaction(): Transaction
105106
getCounter(): number

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,16 +373,18 @@ module.exports = (params) => {
373373
onKillError = typeof cfg.onKillError === 'function' ? cfg.onKillError : () => {}
374374

375375
let connCfg = typeof cfg.config === 'object' && !Array.isArray(cfg.config) ? cfg.config : {}
376-
376+
let escape = MYSQL.escape
377377
// Set MySQL configs
378378
config(connCfg)
379379

380+
380381
// Return public methods
381382
return {
382383
connect,
383384
config,
384385
query,
385386
end,
387+
escape,
386388
quit,
387389
transaction,
388390
getCounter,

0 commit comments

Comments
 (0)