dot-mysql

Promosified MySQL Helper

Usage no npm install needed!

<script type="module">
  import dotMysql from 'https://cdn.skypack.dev/dot-mysql';
</script>

README

Dot-MySQL ·

dot-mysql is a JavaScript library for building mysql queries.

Build Status npm lowest npm lowest

· API · JSDOC ·

Installation

npm install --save dot-mysql

Usage

Import
import MySQL from 'dot-mysql'
Config
import MySQL from 'dot-mysql';

MySQL.config({
  host: 'localhost',
  port: 3306,
  database: 'test',
  user: 'root',
  password: ''
});
Direct Query
import MySQL from 'dot-mysql';

MySQL
    .query({ sql: 'SELECT * FROM table' })
    .then(({ results }) => {
        console.log(results);
    });
Query Builder
import MySQL from 'dot-mysql';

const db = new MySQL();
db
    .select('*')
    .from('table')
    .exec()
    .then(({ results }) => {
        console.log(results);
    });