gm

grunt-mssql

wrapper around tedious to execute query against a Microsoft Sql Server

Showing:

Popularity

Downloads/wk

1

GitHub Stars

0

Maintenance

Last Commit

6yrs ago

Contributors

3

Package

Dependencies

1

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial