library for work with Microsoft SQL Server
Homepage Repository npm Download
npm install viva-server-mssql@3.1.1
(license MIT) library for work with Microsoft SQL Server, full example - see example.js
Kind: global class
Kind: instance property of Server_mssql
Kind: instance property of Server_mssql
init library, check connect to MS SQL Server
Kind: instance method of Server_mssql
Param | Type | Description |
---|---|---|
connection_config | type_connection_config | connection setting |
callback | function | callback function, (error) => {} |
exec query or queries
Kind: instance method of Server_mssql
Param | Type | Description |
---|---|---|
queries | string | Array.<string> | query or array of queries (for run on one open connection) |
[options] | type_exec_options | |
callback | function | callback function, (error, result) => {} |
add one action
Kind: instance method of Server_mssql
Returns: string - error that prevented load action
Param | Type | Description |
---|---|---|
action | lib_vaction.type_action | single action |
exec action
Kind: instance method of Server_mssql
Param | Type | Description |
---|---|---|
key | string | uniq key of action |
params | any | |
options | lib_vaction.type_exec_option | |
callback | function | callback function, (error, result) => {} |
add new schedule or replace existsing schedule
Kind: instance method of Server_mssql
Param | Type |
---|---|
job | lib_vschedule.type_job |
remove existsing schedule
Kind: instance method of Server_mssql
Param | Type |
---|---|
job_key | string |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
server | string | MS SQL instance, for example - 'server\instance1' |
password | string | passrord for ms sql authentication or windows authentication |
[login] | string | login for ms sql authentication, if empty - os authentication |
[database] | string | name database for connect, default - 'tempdb' |
[app_name] | string | app name, which will be visible in profiler |
[connection_timeout] | number | connection timeout in milliseconds, default - 15000 |
[execution_timeout] | number | execution timeout in milliseconds, default - 0 (infinity) |
[encrypt_connection] | boolean | encrypt connection, default - false |
[useUTC] | boolean | default - true |
[action_allow] | boolean | use action subsystem, default - false |
[again_connect_count] | number | count to try to connect to the server if the connection is unavailable, default - 0 (again try connect is disabled) |
[again_connect_timeout] | number | timeout in milliseconds between attempts to connect to the server, default - 2000 |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[pack] | string | number | chunk return data, variants: 'all' - all data in one chunk, 'step' - each step individual chunk, 'table' - each table individual chunk, {number} - row chunk. default - 'all' |
[correction_utc_offset] | number | correct field with datetime type by this value (in minutes) |
[correction_utc_mode] | string | which fields correct by utc offset, example - '{#all}{}{fdm;ldm}' - in first table correct all datetime fields, second table is missing, in the third table correct only two fields |
[lock] | string | one thread - name |
[lock_wait] | number | one thread - wait timeout in milliseconds (0 - no wait), default 0 |