1.4.1 • Published 3 years ago

nodedb-helper v1.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

nodedb-helper

mysql helper

This package helps optimize mysql connection for re-use. You can manage multiple databases using this package easily.

setup

set .env variables for production and development

NODE_ENV=development

PROD_DB_URL=mysql_url
PROD_DB_USERNAME=mysql_admin
PROD_DB_PASSWORD=abcdefgh

DEV_DB_URL=localhost
DEV_DB_USERNAME=root
DEV_DB_PASSWORD=

setup database.js for re-use

const db = require('nodedb-helper')({
	user: 'my_user_db',
	product: 'my_product_db'
})

module.exports = db;

use in product.js

const db = require('./database.js');

let result = await db.product().select({
	table: 'product_details',
	where: 'product_id=?',
	params: [123]
});
1.4.1

3 years ago

1.4.0

3 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago