diff --git a/rollup.config.js b/rollup.config.js index c3d0487..9dc9b09 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,7 +12,6 @@ export default { format: 'esm', }, ], - external: ['crypto', 'fs', 'path'], plugins: [ ts(), ], diff --git a/src/index.ts b/src/index.ts index 9d39187..47669e0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ export interface SqlObject { sql: string - values: TemplateStringsArray + values: any[] formatQuestion?: () => SqlObject formatColon?: () => SqlObject formatAtP?: () => SqlObject @@ -22,7 +22,7 @@ export interface SqlObject { * const colon = query.formatColon() * // colon.sql = 'select * from users where email = :1' */ -export function sql(string: string[], ...params: TemplateStringsArray): SqlObject { +export function sql(string: TemplateStringsArray, ...params: any[]): SqlObject { const sql = string.map((v, i) => (string.length - 1 === i) ? v : `${v}$${i + 1}`).join(''); function formatQuestion(): SqlObject {