Skip to content

artemrudenko/node-sql-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-sql-builder

This package is build on top of mssql and is using msnodesqlv8 driver. The main purpose is to simplify configuration for some base cases with NTLM auth and env variables usage.

Example

const table = `MOCK_Table`;

const options = new DBConfigInfoBuilder()
  .withServer(process.env.DB_SERVER_NAME)
  .withDatabase(process.env.DB_DATABASE_NAME)
  .withPort(process.env.DB_DATABASE_PORT)
  .withQuery(`SELECT * FROM ${table} WHERE id > 10`)
  .withUsername(process.env.DB_DATABASE_USERNAME)
  .withPassword(process.env.DB_DATABASE_USERPWD)
  .build();
const results = await new DBRequest(options)
  .execute();

Or using default setting and env variables:

const table = `MOCK_Table`;
const results = await new DBRequest(new DBRequestBuilder().build())
  .execute(`SELECT * FROM ${table} WHERE id > 10`);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published