@infinitaslearning/marv-mssql-driver

0.0.1 • Public • Published

Build Status Code Style

marv-mssql-driver

A SQL Server driver for marv

"If @cressie176 can do it, anyone can." Anon, 2019

Usage

migrations/
  |- 001.create-table.sql
  |- 002.create-another-table.sql
const marv = require('marv')
const mssqlDriver = require('marv-mssql-driver')
const directory = path.join(process.cwd(), 'migrations' )
const driver = mssqlDriver({
    table: 'db_migrations',     // defaults to 'migrations'
    connection: {               // the connection sub document is passed directly to mssql
        host: 'localhost',
        port: 1433,
        database: 'dbo',
        user: 'sa',
        password: 'Marv@234!',
        options: {
            encrypt: true // Use this if you're on Windows Azure
        }
    }
})
marv.scan(directory, (err, migrations) => {
    if (err) throw err
    marv.migrate(migrations, driver, (err) => {
        if (err) throw err
    })
})

SQL Server locally for testing

The password is: Marv@234!

Testing

npm install # or yarn
npm run docker
npm test

Package Sidebar

Install

npm i @infinitaslearning/marv-mssql-driver

Weekly Downloads

31

Version

0.0.1

License

MIT

Unpacked Size

15.6 kB

Total Files

19

Last publish

Collaborators

  • boreplusplus
  • teunmooij
  • cliftonc-infinitas