Execute Query ( mysql)
One script reply has been approved by the moderators Verified

Created by vivieninhittaumntuh 291 days ago Viewed 183 times -1 Points

No comments yet

Login to be able to comment
Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import { Client } from "https://deno.land/x/mysql/mod.ts";
import * as wmill from "https://deno.land/x/windmill@v1.13.0/index.ts";

export async function main(mysql_conn: wmill.Resource<"mysql">, query: string) {
    mysql_conn.db = mysql_conn.database;
    mysql_conn.hostname = mysql_conn.host;
    mysql_conn.username = mysql_conn.user;

    const client = await new Client().connect(
        mysql_conn,
    );

    return (await client.execute(query));
}

Submitted by rossmccrann 254 days ago

Edited 24 days ago

No comments yet

Login to be able to comment