Skip to content

Cellarise/cellarise-connector-mssql

 
 

Repository files navigation

cellarise-connector-mssql

view on npm npm module downloads per month Dependency status Build Status Code Climate Test Coverage

MsSQL adapter for Loopback

##Installation

Install cellarise-connector-mssql:

npm install -g cellarise-connector-mssql

##Usage

This package uses the mssql package which in turn uses tedious out of the box. Support is also provided for the native Windows MSSQL driver as well as node-tds. See the mssql documentation page for more information.

  1. Setup dependencies in package.json:
    
    {
      ...
      "dependencies":{
		    "loopback": "^2.18.0",
		    "loopback-datasource-juggler": "^2.29.2",
      }
      ...
    }
    
  
  1. Use:
    
    var Schema = require("jugglingdb").Schema;
    var schema = new Schema("mssql", {host:"YourSqlServer", database:"YourDatabase"});
    ...
    
  
    
    var Schema = require("jugglingdb").Schema;
    var schema = new Schema("mssql", {host:"AzureServer", database:"YourDatabase",
                                      username: "YourUserName", password: "YourPassword",
                                      azure: true});
    ...
    
  
  1. Primary Keys: using anything other than the default 'id' as the primary key will cause the hasMany and belongsTo relationships in jugglingdb to not work, and possibly other oddities as well (so you probably shouldn't use it until it's officially supported).

to specify a custom primary key name for a model use

    
      var AppliesTo = schema.define("AppliesTo", {
        AppliesToID: {
          type:Number,
          primaryKey:true
        },
        Title: {
          type:String,
          limit:100
        },
        Identifier: {
          type:String,
          limit:100
        },
        Editable: {
          type:Number
        }
      });
    
  

API

documented by jsdoc-to-markdown.

Changelog

Type ID Summary
Version: 0.1.0 - released 2015-08-25
Non-functional MDCNSQL-5

Package: Update development dependencies

Minor MDCNSQL-4

Package: update based on changes to loopback-connector

Feature MDCNSQL-3

Include: Add SQL LEFT OUTER JOIN option for includes

Feature MDCNSQL-2

Package: Add mssql connector for loopback-datasource-juggler

License

MIT. All rights not explicitly granted in the license are reserved.

Copyright (c) 2015 Cellarise

Dependencies

[email protected] - "MIT", documented by npm-licenses.

About

MsSQL adapter for the jugglingdb ORM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Gherkin 0.4%