1.1.7 • Published 4 years ago

geosolve-db v1.1.7

Weekly downloads
13
License
ISC
Repository
github
Last release
4 years ago

Control "Store Procedure"

This package seeks to resolve problem when you call "store procedure" in original package mysql, in this package always return array of two elements, the results and "store procedure" info. geosolve-db always return the results of "store procedure".

Extension of mysql package

This package is an extension of mysql original package

npm.io

Install

You can install this package using npm

$ npm install geosolve-db --save

How to use

/* remember that this package have all properties mysql original package */
const  mysql  =  require('geosolve-db');
/* 
	You must encapsulate connection in patchFeature function for connection have the new method querySP		  
*/

/* example with pool connection */ 
const  pool  =  mysql.patchFeatures(mysql.createPool({
connectionLimit :  10,
host :  'host',
user :  'root',
password :  'password',
database :  'database'
}));

/*
	Now, if you wannt , you can export pool variable for import it in 	other files and use query function querySP
	
	CommonJS -> module.exports = pool
	Es6 Modules -> export default pool
*/ 

/* 
	but, if you need use it in this file 
	¡IMPORTANT! function querySP return a promise
*/

pool.querySP('call sp_test(?)', ['hola'])
	.then(results  =>  console.log('DATA => ', results.data))
	.catch(err  =>  console.log(err))
1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago