简体   繁体   中英

Connecting Sails with SQL Server

I'm trying to set up a connection between a local SQL Server database I have set up on my computer and a sails project. I cannot get it to work to save my life, it seems there is very little documentation or I'm just not getting it.

I have found this: https://github.com/swelham/sails-mssql and https://github.com/jaredfromsubway/sails-mssql . And have installed npm sails-mssql and replaced the old lib files with the newer ones. I've set up the runner file to match my local SQL Server database. When I run npm test I get nothing.

runner js :

new TestRunner({

    // Load the adapter module.
    adapter: Adapter,

    // ADD YOUR CONFIG HERE
    config: {
        schema: true,
        host: 'computerName/databaseName',
        port: 0,
        user: 'computerName/userName',
        password: 'password',
        database: 'databaseName',
        timeout: 5000,
        pool: {
            min: 0,
            max: 10,
            idleTimeout: 30000
        }
    },

Is there additional documentation somewhere I'm missing? Or is there anyone that could give me some help that has successfully connected with SQL Server? It doesn't seem to be very common. I'd greatly appreciate any help! Thanks.

this configuration works for me on 0.10.x

https://gist.github.com/hybrisCole/868f979d8d129247a2da

Hope this is useful!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM