Skip to content

markusfuerer/mysql-slim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySQL driver

    const options = {
      user: 'dbuser',
      password: 'dbpassword',
      database: 'foobar'
    };

    const db = require('mysql-slim')(options);

    db.execute('SELECT * FROM users WHERE id = ?', [1]).then((rows) => {
      console.info(rows);
    });

Installation

$ npm i mysql-slim

Options

const db = require('mysql-slim')([options]);

Property Description Default
host The hostname of the database you are connecting to. "localhost"
port The port number to connect to. 3306
user The MySQL user to authenticate as.
password The password of that MySQL user.
database Name of the database to use for this connection.

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm i
$ npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published