Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mistergf/sails-mssqlserver
Microsoft SQL Server Adapter for sails.js
https://github.com/mistergf/sails-mssqlserver
ms-sql mssql orm sails sails-mssqlserver windows
Last synced: 2 days ago
JSON representation
Microsoft SQL Server Adapter for sails.js
- Host: GitHub
- URL: https://github.com/mistergf/sails-mssqlserver
- Owner: misterGF
- Created: 2016-04-08T17:44:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T14:38:40.000Z (almost 6 years ago)
- Last Synced: 2024-11-03T12:06:10.106Z (6 days ago)
- Topics: ms-sql, mssql, orm, sails, sails-mssqlserver, windows
- Language: JavaScript
- Homepage:
- Size: 131 KB
- Stars: 10
- Watchers: 3
- Forks: 20
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![sails logo](http://sailsjs.org/images/bkgd_squiddy.png)
# Sails-MSsqlserver
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![Dependency Status][daviddm-image]][daviddm-url]Microsoft SQL Server adapter for [sails.js](http://sailsjs.org/). 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](http://www.cnectdata.com/).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
```sh
$ npm install sails-mssqlserver --save
```### 2. Configure
#### `config/models.js`
```js
{
connection: 'sqlserver'
}
```#### `config/connections.js`
```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
``` javascript
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](http://sailsjs.org/documentation/concepts/models-and-orm/query-language)
## License
MIT## Credits
This project was originally forked from [cnect/sails-sqlserver](https://github.com/cnect/sails-sqlserver) in 2016. That repo was itself forked from [swelham/sails-mssql](https://github.com/swelham/sails-mssql) in early 2015. The code in both of those repositories is also available under the MIT license.
[npm-image]: https://img.shields.io/npm/v/sails-mssqlserver.svg?style=flat-square
[npm-url]: https://npmjs.org/package/sails-mssqlserver[ci-image]: https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva/branch/master
[ci-url]: https://ci.appveyor.com/project/misterGF/sails-mssqlserver/branch/master[daviddm-image]: http://img.shields.io/david/misterGF/sails-mssqlserver.svg?style=flat-square
[daviddm-url]: https://david-dm.org/misterGF/sails-mssqlserver