Coder Social home page Coder Social logo

mssql-redis's Introduction

Getting Started

npm i mssql-redis

config

    mssql: {
            user: 'username',
            password: 'password',
            server: 'host',
            database: 'db',
            requestTimeout: 300000,
            options: {
            encrypt: false
            },
            pool: {
            max : maxConnections,
            min: minConnections 
            },
            options: {
                            appName: "name"
            }
    },
    redisConfig: {
    host: 'host',
    port: 'port',
    timeToDelete: 60  //seconds to delete key Refresh every insert. 
    }
}

How to use :

const MssqlRedis = require('mssql-redis');

let mssqlRedis = new MssqlRedis()

mssqlRedis.Redis(redisConfig)

pool = await mssqlRedis.Connect(mssql)

Cache options: 
ttl : time for use cache - defualt 10 seconds
key: key for Cache (no must if you using input the key will be generated)
timeToDelete //seconds to delete key Refresh every insert. will overwrite global value 

pool.request()
    .input('id',dal.sql.NVarChar,2)
    .Cache(options)
    .query('selete * from table where @id')
    .then( console.log ) 


# mssql-redis using mssql request pool for more available used: 
https://www.npmjs.com/package/mssql#request



mssql-redis's People

Contributors

tzachish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.