1.0.4 • Published 6 years ago

@ac-moore-inc/mssql-wrapper v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

MSSQL Wrapper

An easy to use MSSQL wrapper.

Created and maintained by the A.C. Moore software engineering team.

Methods

prepareService

Create the connection pools for provided databases

prepareService(config, callback);

Parameters:

config: object

A configuration object containing information related to the database is required to connect.

config Example:
{
    databaseName: {
        'user': 'db_user_name',
        'password': 'db_pass',
        'server': 'PATH\\TOSERVER'
        'database': 'DATABASE_NAME'
        'pool': {
            'max': 10,
            'min': 4,
            'idleTimeoutMillis': 30000
        }
    },
    other db connections...
}

executePSQuery

Execute prepared statement

executePSQuery(options, callback);

Parameters:

options: Object
FieldTypeRequiredValue
dbstringtruedatabase name as defined in the config object used to prepare the service
qrydataobjecttrueobject containing query fields, from_objects, and where_clause
serverstringfalsesever location of the database
inputarrayfalsearray of objects containing input name and type (as defined by mssql)
paramsobjectfalsekey value pairs defining any parameters, where key is the given input name and value is the parameter value

exeuteSP

Execute a stored procedure

executeSP(options, callback);

Parameters:

options: Object
FieldTypeRequiredValue
dbstringtruedatabase name as defined in the config object used to prepare the service
procedurestringtrueprocedure name
inputarrayfalsearray of objects containing input name, type (as defined by mssql), and value (key: val)
outputarrayfalsearray of objects containing output name and type (as defined by mssql)

executeQuery

call a basic query

executeQuery(options, callback);

Parameters:

options: Object
FieldTypeRequiredValue
dbstringtruedatabase name as defined in the config object used to prepare the service
qrydataarraytruearray of objects containing query: fields, from_objects, join_condition, where_clause, group_by, order_by
serverstringfalsesever location of the database
outFormatarrayfalsearray of objects containing output name and type (as defined by mssql)

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago