mysql-q

1.0.1 • Public • Published

Mysql Query

Query mysql in json syntax

API

Properties

  • tables
  • options
  • pool

Methods

  • createPool
  • registerTable
  • getTable

Example

const mysql = require('mysql-query');
mysql.createPool(...config);

mysql.registerTable(['users', 'orders']);
mysql.registerTable('transactions');

const users = mysql.getTable('users');

users.findOne({});
users.find();
users.insertOne();
users.updateOne();
users.updateMany();
users.count();
users.join();

users.find({ username: 'rock' })
.select('username createdAt')
.skip(10)
.limit(20)
.sort({ username: 1 , createdAt: -1 });

/mysql-q/

    Package Sidebar

    Install

    npm i mysql-q

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    14.6 kB

    Total Files

    15

    Last publish

    Collaborators

    • yuva1422