Add sqlstring.raw to sqlstring type definitions.

This commit is contained in:
David Gomes
2019-01-03 17:03:19 +00:00
parent a1b863c972
commit 0566178dc9
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -7,3 +7,4 @@
export function format(sql: string, args: object | any[]): string;
export function escape(value: any): string;
export function escapeId(value: any, dotQualifier?: boolean): string;
export function raw(sql: string): { toSqlString: () => string };
+7
View File
@@ -29,3 +29,10 @@ const sql6 =
const userId4 = 1;
const inserts = ["users", "id", userId4];
const sql7 = SqlString.format("SELECT * FROM ?? WHERE ?? = ?", inserts);
const userId4 = 1;
const inserts = ["users", "id", userId4];
const sql7 = SqlString.format("SELECT * FROM ?? WHERE ?? = ?", inserts);
var CURRENT_TIMESTAMP = SqlString.raw('CURRENT_TIMESTAMP()');
const sql8 = SqlString.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]);