Skip to content

nodenica/node-mssql-memcached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-mssql-memcached Dependency Status NPM version

NPM

Connect with mssql and implement memcached in your projects.

What's New v0.0.13

  • Fix debugMsg params on removeKey
  • Fix errorMsge undefined on memcached.set
  • Autovalidate data type on addInput
  • Convert data to utf8

Stored Procedure Example

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);
};

Query Example

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);
};

About

Connect with mssql and implement memcached in your projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published