From a77e73ceb408b4311985b5da61deab62aaa39e7f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 24 Feb 2023 17:19:13 +0100 Subject: [PATCH] fix(deno): remove mysql support waiting for deno fix --- frontend/src/lib/script_helpers.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/frontend/src/lib/script_helpers.ts b/frontend/src/lib/script_helpers.ts index 92f75c4158..c254c43615 100644 --- a/frontend/src/lib/script_helpers.ts +++ b/frontend/src/lib/script_helpers.ts @@ -95,22 +95,22 @@ export async function main( return query.rows; }` -// export const MYSQL_INIT_CODE = `import { -// mySql, -// type Resource -// } from "https://deno.land/x/windmill@v${__pkg__.version}/mysql.ts"; +export const MYSQL_INIT_CODE = `import { + mySql, + type Resource +} from "https://deno.land/x/windmill@v${__pkg__.version}/mysql.ts"; -// // MySQL parameterized statement. No SQL injection is possible. -// export async function main( -// db: Resource<"mysql">, -// key: number, -// value: string, -// ) { -// const query = await mySql( -// db -// )\`INSERT INTO demo VALUES (\${key}, \${value})\`; -// return query.rows; -// }`; +// MySQL parameterized statement. No SQL injection is possible. +export async function main( + db: Resource<"mysql">, + key: number, + value: string, +) { + const query = await mySql( + db + )\`INSERT INTO demo VALUES (\${key}, \${value})\`; + return query.rows; +}`; export const BASH_INIT_CODE = `# arguments of the form X="$I" are parsed as parameters X of type string msg="$1"