New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simple-mysql-query

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-mysql-query

simple mysql query with promise

latest
Source
npmnpm
Version
1.1.4
Version published
Maintainers
1
Created
Source

simple-mysql-query

simple mysql query with promise

install

npm i simple-mysql-query

usage

const query = require('simple-mysql-query');

set config in main file

query({
	host : '127.0.0.1',
	port : '3306',
	user : 'root',
	password : 'root',
	database : 'db'
})

query simple sql in other files

query({
	sql : 'select * from table where name=? ',
	params : ['name']
}).then(rs => {
	const list = rs[0];
	console.log(list);
}).catch(e => console.log(e));

query multi sql in other files

query([{
	sql : 'select * from table where name=? ',
	params : ['name']
},{
	sql : 'select * from table2 where name=?',
	params : ['name']
}]).then(rs => {
	const list = rs[0];
	console.log(list);
	const list2 = rs[1];
	console.log(list2);
}).catch(e => console.log(e));

license

MIT LICENSE

Keywords

simple

FAQs

Package last updated on 26 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts