Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wcoder/node-mysql-connect
Simple wrapper with additional functionality over node-mysql.
https://github.com/wcoder/node-mysql-connect
javascript mysql node-mysql nodejs wrapper
Last synced: 14 days ago
JSON representation
Simple wrapper with additional functionality over node-mysql.
- Host: GitHub
- URL: https://github.com/wcoder/node-mysql-connect
- Owner: wcoder
- License: mit
- Created: 2016-01-16T12:21:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-16T22:22:12.000Z (almost 9 years ago)
- Last Synced: 2024-04-23T11:18:20.816Z (7 months ago)
- Topics: javascript, mysql, node-mysql, nodejs, wrapper
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-mysql-wrapper
Simple wrapper with additional functionality over node-mysql.
## Install
```
npm i node-mysql-connect --save
```## Using
Minimal config:
```js
var config = {
user: '',
password: '',
database: ''
};
```
Include and initialize module:
```js
var connection = require('node-mysql-connect')(config);
```
Do query:
```js
connection.query("SELECT * FROM ", function (err, data) {
if (err) throw err;// working with data ...
});
```
Query with params:
```js
connection.query("SELECT * FROM WHERE a = ? AND b = ?", [a, b], function (err, data) {
if (err) throw err;// working with data ...
});
```## Configuration
`logger` - enable logging:
```js
var config = {
//...
logger: console.log // for example
};
```