grunt-mssql

0.1.0 • Public • Published

grunt-mssql

installation

npm install numera/grunt-mssql.git --save-dev

A wrapper around tedious for executing query against Microsoft Sql Server. This is not meant to be used in a production enviroment but more for E2E testing where there is a need to take database snapshot and restoring the snapshot.

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-mssql');

The "mssql" task

Overview

In your project's Gruntfile, add a section named mssql to the data object passed into grunt.initConfig().

grunt.initConfig({
  mssql: {
    options: {
      server: '',
      userName: '',
      password: ''
    },
    restore: {
      query: ''
    },
  },
})

Options

server

Type: String Default value: ''

Location of the MS Sql Server.

userName

Type: String Default value: '.'

Account to log in to the server

password

Type: String Default value: '.'

Password for the account

query

Type: String or String[] Default value: '.'

Sql statement to be executed

Usage Examples

grunt.initConfig({
    mssql:{
        options: {
            server: '127.0.0.1',
            userName: 'user',
            password: 'password'
        },
        snapshot: {
            query: "EXECUTE SomeStoreProcedueToTakeSnapshot;"
        },
        restore: {
            query: [
              "ALTER DATABASE MyDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE;",
              "RESTORE DATABASE MyDatabase FROM DATABASE_SNAPSHOT =  'MyDatabaseSnapShot';",
              "ALTER DATABASE MyDatabase SET MULTI_USER;"
              ]
 
        }
    }
});

Published to npm on behalf of https://github.com/dphung20

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    0

Package Sidebar

Install

npm i grunt-mssql

Weekly Downloads

0

Version

0.1.0

License

none

Last publish

Collaborators

  • clarkie