am

async-mysql

async-mysql is a wrapper for mysql that uses ES7 async functions.

Showing:

Popularity

Downloads/wk

27

Maintenance

No Maintenance Data Available

Package

Dependencies

2

Size (min+gzip)

89.8KB

License

BSD-3-Clause

Type Definitions

Tree-Shakeable

No?

Categories

Readme

async-mysql

NPM version Travis build status Dependency Status

async-mysql is a wrapper for mysql that uses ES7 async functions.

Usage

let main;

// async/await can be used only within an async function.
main = async () => {
    let mysql = require('async-mysql'),
        connection,
        rows;

    connection = await mysql.connect({
        host: 'localhost'
    });

    rows = await connection.query('SELECT 1');
    // [{'1': 1}]

    try {
        await connection.query('INVALID_QUERY');
    } catch (e) {
        e;
        // [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INVALID_QUERY' at line 1]
    }
};

main();

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100