GithubHelp home page GithubHelp logo

adamherrmann / sequelize-msnodesqlv8 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ratanakvlun/sequelize-msnodesqlv8

0.0 3.0 0.0 24 KB

A sequelize dialect driver for the msnodesqlv8 module.

License: ISC License

JavaScript 100.00%

sequelize-msnodesqlv8's Introduction

sequelize-msnodesqlv8

The sequelize-msnodesqlv8 module is a mssql dialect driver for sequelize.

There are many node mssql clients and sequelize defaults to using tedious, but being pure javascript,tedious lacks support for integrated security. msnodesqlv8 is a client that interfaces with a native odbc library. This allows integrated security to be used. It does require additional binaries to deploy, but fortunately, msnodesqlv8 is distributed with binaries for the most common architectures.

The purpose of sequelize-msnodesqlv8 is to provide a dialect driver to sequelize so that msnodesqlv8 can be used instead of tedious.

Installation

npm install sequelize-msnodesqlv8

Usage

Using sequelize-msnodesqlv8 is simple. Just specify sequelize-msnodesqlv8 as the dialectModulePath:

const Sequelize = require('sequelize');

let db = new Sequelize({
  dialect: 'mssql',
  dialectModulePath: 'sequelize-msnodesqlv8',
  dialectOptions: {
    /* Configuration */
  }
});

Configuration

The following options are used by sequelize-msnodesqlv8. Options specific to sequelize like pooling still apply to the sequelize layer.

  • database - Name of the database to use.
  • username - Username if using SQL authentication.
  • password - Password if using SQL authentication.
  • host - Hostname of the server. Default: localhost
  • dialectOptions.driver - Name of the odbc driver to use (e.g. SQL Server Native Client 10.0).
  • dialectOptions.instanceName - Name of the instance to connect to.
  • dialectOptions.trustedConnection - Indicates whether integrated security should be used. Default: false
  • dialectOptions.connectionString - Connection string to use. Overrides all other options.

If a driver is not provided in either dialectOptions.driver or the connection string, sequelize-msnodesqlv8 will attempt to detect the driver.

Example: Using a connection string directly with sequelize pooling.

let db = new Sequelize({
  dialect: 'mssql',
  dialectModulePath: 'sequelize-msnodesqlv8',
  dialectOptions: {
    connectionString: 'Driver={SQL Server Native Client 10.0};Server=localhost\\SQLEXPRESS;Database=finances;Trusted_Connection=yes;'
  },
  pool: {
    min: 0,
    max: 5,
    idle: 10000
  }
});

Example: Using options for Windows authentication.

let db = new Sequelize({
  dialect: 'mssql',
  dialectModulePath: 'sequelize-msnodesqlv8',
  dialectOptions: {
    driver: 'SQL Server Native Client 10.0',
    instanceName: 'SQLEXPRESS',
    trustedConnection: true
  },
  host: 'localhost',
  database: 'finances'
});

Example: Using options for SQL authentication.

let db = new Sequelize({
  dialect: 'mssql',
  dialectModulePath: 'sequelize-msnodesqlv8',
  dialectOptions: {
    driver: 'SQL Server Native Client 10.0',
    instanceName: 'SQLEXPRESS'
  },
  host: 'localhost',
  username: 'sa',
  password: 'password',
  database: 'finances'
});

sequelize-msnodesqlv8's People

Contributors

ratanaklun avatar ratanakvlun avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.