Connect with mssql and implement memcached in your projects.
- Fix debugMsg params on removeKey
- Fix errorMsge undefined on memcached.set
- Autovalidate data type on addInput
- Convert data to utf8
var sql = require('mssql-memcached');
var connection = {
user: 'username',
password: 'password',
server: '0.0.0.0',
database: 'database'
};
sql.setMemcachedServers( '0.0.0.0:11211' );
sql.debug( true );
var types = sql.types;
var sp = new sql.prepare({
query: 'my_stored_procedure',
connection: connection,
cache: true,
lifetime: 86400,
utf8: true
});
sp.addInput('param_one', types.Int, 1);
sp.addInput('param_two', types.Int, 2);
sp.execute();
sp.success = function(data){
console.log(data);
};
sp.error = function(error){
console.log(error);
};
var sql = require('mssql-memcached');
var connection = {
user: 'username',
password: 'password',
server: '0.0.0.0',
database: 'database'
};
sql.setMemcachedServers( '0.0.0.0:11211' );
sql.debug( true );
var types = sql.types;
var mySimpleQuery = new sql.prepare({
query: 'SELECT foo FROM bar',
connection: connection,
cache: true,
lifetime: 86400,
type: 'query',
utf8: true
});
mySimpleQuery.execute();
mySimpleQuery.success = function(data){
console.log(data);
};
mySimpleQuery.error = function(error){
console.log(error);
};