npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mssql-cr-layer

v3.0.1

Published

A MS SQL Server interface layer for common requests

Downloads

57

Readme

mssql-cr-layer NPM version Dependency Status CircleCI (https://coveralls.io/repos/github/andrglo/mssql-cr-layer/badge.svg?branch=master)](https://coveralls.io/github/andrglo/mssql-cr-layer?branch=master)

A MS SQL Server interface layer for common requests. It uses mssql to connect and wraps it in a tiny layer using ES2015 promises with the goal to be simpler and compatible with pg via pg-cr-layer

Install

$ npm install --save mssql-cr-layer

Usage

var mssqlCrLayer = require('mssql-cr-layer');

var config = {
  user: 'me',
  password: 'my password',
  host: 'localhost',
  port: 1433,
  pool: {
    max: 25,
    idleTimeout: 30000
  }
};

var layer = new MssqlCrLayer(config)

layer.connect()
  .then(function() {
    return layer.execute('CREATE TABLE products ( ' +
      'product_no integer, ' +
      'name varchar(10), ' +
      'price numeric(12,2) )');
  })
  .then(function() {
    return layer.transaction(function(t) {
      return layer
	      .execute('INSERT INTO products VALUES (1, \'Cheese\', 9.99)', null, {transaction: t})
          .then(function() {
            return layer.execute('INSERT INTO products VALUES (2, \'Chicken\', 19.99)', null, {transaction: t})
          })
		  .then(function() {
        return layer
          .execute('INSERT INTO products VALUES ($1, $2, $3)', [3, 'Duck', 0.99], {transaction: t})
       });
     })
  })
  .then(function() {
    return layer.query('SELECT * FROM products WHERE product_no=@product_no',
      {product_no: {value: 1, type: 'integer'}}) // or just {product_no: 1}
    .then(function(recordset) {
      console.log(recordset[0]); // => { product_no: 1, name: 'Cheese', price: 9.99 }
    })
  })
  .then(function() {
    return layer.close();
  })
  .catch(function(error) {
	  console.log(error);
  });

License

MIT © Andre Gloria