The Wayback Machine - https://web.archive.org/web/20201102212153/https://github.com/wcoder/node-mysql-connect
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 

README.md

node-mysql-wrapper

Simple wrapper with additional functionality over node-mysql.

Install

npm i node-mysql-connect --save

Using

Minimal config:

var config = {
	user: '<your_user>',
	password: '<your_password>',
	database: '<your_database_name>'
};

Include and initialize module:

var connection = require('node-mysql-connect')(config);

Do query:

connection.query("SELECT * FROM <your_table>", function (err, data) {
	if (err) throw err;

	// working with data ...
});

Query with params:

connection.query("SELECT * FROM <your_table> WHERE a = ? AND b = ?", [a, b], function (err, data) {
	if (err) throw err;

	// working with data ...
});

Configuration

logger - enable logging:

var config = {
	//...
	logger: console.log // for example
};

About

Simple wrapper with additional functionality over node-mysql.

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.