1.4.1 • Published 2 years ago

nodedb-helper v1.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.4.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.0

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago