diff --git a/index.d.ts b/index.d.ts index 8ee916f..5ce24c0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -100,6 +100,7 @@ declare namespace serverlessMysql { config(config?: MySQL.ConnectionConfig): MySQL.ConnectionConfig query(...args): Promise end(): Promise + escape(str: string): MySQL.EscapeFunctions quit(): void transaction(): Transaction getCounter(): number diff --git a/index.js b/index.js index a9abfe5..43d2ae7 100644 --- a/index.js +++ b/index.js @@ -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,