Waddler <> SingleStore
To use Waddler with a SingleStore database, you should use the mysql2
driver
According to the official website,
mysql2
is a MySQL/SingleStore client for Node.js with focus on performance.
Waddler natively supports mysql2
with waddler/mysql2
package.
Step 1 - Install packages
npm
yarn
pnpm
bun
npm i waddler mysql2
Step 2 - Initialize the driver and make a query
mysql2
mysql with config
import { waddler } from "waddler/mysql2";
const sql = waddler(process.env.DATABASE_URL);
const result = await sql`select 1;`;
If you need to provide your existing driver:
Client connection
Pool connection
import { waddler } from "waddler/mysql2";
import mysql from "mysql2/promise";
const connection = await mysql.createConnection({
host: "host",
user: "user",
database: "database",
...
});
const sql = waddler({ client: connection });