Formatting.

This commit is contained in:
Mike Cao 2023-07-28 18:30:02 -07:00
parent 200e9b8bfa
commit 0cc289b3cd
2 changed files with 19 additions and 12 deletions

View file

@ -103,6 +103,7 @@ async function rawQuery(sql: string, data: object): Promise<any> {
if (db !== POSTGRESQL && db !== MYSQL) {
return Promise.reject(new Error('Unknown database.'));
}
const query = sql?.replaceAll(/\{\{\s*(\w+)(::\w+)?\s*}}/g, (...args) => {
const [, name, type] = args;
params.push(data[name]);