diff --git a/src/adapters/adapters.ts b/src/adapters/adapters.ts index 3c50eeb..66f0670 100644 --- a/src/adapters/adapters.ts +++ b/src/adapters/adapters.ts @@ -24,7 +24,7 @@ function timeoutOrImmediate(fn: () => void, time: number) { const delay = (time: number | undefined) => new Promise(done => timeoutOrImmediate(done, time ?? 0)); -function replaceQueryArgs$(this: void, sql: string, values: any[]) { +export function replaceQueryArgs$(this: void, sql: string, values: any[]) { return sql.replace(/\$(\d+)/g, (str: any, istr: any) => { const i = Number.parseInt(istr); if (i > values.length) { diff --git a/src/index.ts b/src/index.ts index 6739790..913feef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ export { newDb } from './db'; export { enableStatementLocationTracking } from './parser/parse-cache'; +export { replaceQueryArgs$ } from './adapters'; export * from './interfaces';