mysql
mysql copied to clipboard
Use template literals
trafficstars
I haven't tested it. Please test it if it works correctly.
Usage:
import { Client, SQL } from "https://deno.land/x/mysql/mod.ts";
const client = await new Client().connect({...options...});
client.query(SQL`select $${"name"} from $${"users"} where id = ${5}`);
// is exactly the same as:
client.query("select ?? from ?? where id = ?", [ "name", "users", 5 ]);
Tests fail on my try. Have u ever run the Unit Test though? Do they pass or not?
Have u ever run the Unit Test though? Do they pass or not?
I haven't tested anything. If you get any error, tell me.
@algiuxass Just run deno test --allow-env --allow-net test.ts. Basically , we should make sure the coming code will not break the unit test.
We always hope that new changes can be covered by corresponding tests