mirror of https://github.com/aldy505/sql-dsl.git
fix: typings
This commit is contained in:
parent
e9c2153538
commit
8583fc7f48
|
@ -12,7 +12,6 @@ export default {
|
|||
format: 'esm',
|
||||
},
|
||||
],
|
||||
external: ['crypto', 'fs', 'path'],
|
||||
plugins: [
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue