Microsoft SQL Server Adapter for sails.js
JavaScript
Latest commit 66ec803 Jan 10, 2017 @misterGF Upped version number
Permalink
Failed to load latest commit information.
lib Removed path dependancy Jan 10, 2017
test Added default pw back to runner Jun 24, 2016
.editorconfig issue orm fail when kill sails.js Jun 1, 2015
.gitignore
.jshintrc add jshintrc and fix warnings Jan 15, 2015
README.md Fixed typo in README.md Oct 27, 2016
package.json Upped version number Jan 10, 2017

README.md

sails logo

Sails-MSsqlserver

NPM version Build status Dependency Status

Microsoft SQL Server adapter for sails.js. Tested on SQL Server 2012 and 2014, but should support any SQL Server 2005 and newer. CI tests are run against SQL Server Express. Originally published by c*nect.

The development and acceptance of pull request have stalled on the original project. Therefore I am publishing this project with some enhancements.

Getting Started

1. Install

$ npm install sails-mssqlserver --save

2. Configure

config/models.js

{
  connection: 'sqlserver'
}

config/connections.js

{
  sqlserver: {
    adapter: 'sails-mssqlserver',
    user: 'sa',
    password: 'secureP@ssword',
    host: 'abc123.database.windows.net', // azure database
    database: 'mydb',
    options: {
      encrypt: true   // use this for Azure databases
    }
  }
}

Query Examples

Select with certain columns

Plugins.find({
  select: ['name','author'] // Optional
})
.where({
  framework: 'sails.js'
})
.then(function(results){
  if (results) {
    results.forEach(function(plugin)){
      console.log(plugin)
    }      
  } else {
    console.log('No plugins found')
 }
})

For further examples check out Sail's Waterline ORM page

License

MIT

Credits

This project was originally forked from cnect/sails-sqlserver in 2016. That repo was itself forked from swelham/sails-mssql in early 2015. The code in both of those repositories is also available under the MIT license.