mysql-dialect
v0.1.1
Published
Provides a MySql Query Builder. This version contains MySql CRUD operations. Each function returns a query string ready to use with a MySql connection provider like MSQL2 Package.
Downloads
5
Maintainers
Readme
mysql-dialect
Is a MySql Database ease query builder. Provides a MySql Query Builder. This version contains MySql CRUD operations. Each function returns a query string ready to use with a MySql connection provider like mysql2 Package.
CRUD operations examples supported:
const { SELECT, INSERT, DELETE, UPDATE, SELECTALL } = require("mysql-dialect");
Getting started:
const { SELECT } = require("mysql-dialect");
//Return `SELECT user_name,email FROM users`
const query = SELECT("user_name,email).FROM("users").get();
Use with mysql2:
//Find mysql2 configuration at own documentation.
const mysql = require("mysql2");
const pool = mysql.createPool(...);
//Use a query string instead raw string.
const result = await pool.query(query);