3.1.1 • Published 4 years ago

viva-server-mssql v3.1.1

Weekly downloads
142
License
MIT
Repository
gitlab
Last release
4 years ago

Classes

Functions

Typedefs

Server_mssql

(license MIT) library for work with Microsoft SQL Server, full example - see example.js

Kind: global class

server_mssql.connected : boolean

Kind: instance property of Server_mssql

server_mssql.timezone_offset : number

Kind: instance property of Server_mssql

server_mssql.init(connection_config, callback)

init library, check connect to MS SQL Server

Kind: instance method of Server_mssql

ParamTypeDescription
connection_configtype_connection_configconnection setting
callbackcallback_error

server_mssql.exec(queries, options, callback)

exec query or queries

Kind: instance method of Server_mssql

ParamTypeDescription
queriesstring | Array.<string>query or array of queries (for run on one open connection)
optionstype_exec_option
callbackcallback_exec

exec~exec_result

Kind: inner property of exec
Privare: @type {type_exec_result}

server_mssql.action_add(action) ⇒ string

add one action

Kind: instance method of Server_mssql
Returns: string - error that prevented load action

ParamTypeDescription
actiontype_actionsingle action

server_mssql.action_del(key)

delete action from list

Kind: instance method of Server_mssql

ParamTypeDescription
keystringaction key

server_mssql.action_check(key) ⇒ type_action_find

find action key and load errors

Kind: instance method of Server_mssql

ParamTypeDescription
keystringaction key

server_mssql.action_exec(key, params, callback)

exec action

Kind: instance method of Server_mssql

ParamTypeDescription
keystringuniq key of action
paramsany
callbackcallback_action

server_mssql.schedule_go(job)

add new schedule or replace existsing schedule

Kind: instance method of Server_mssql

ParamType
joblib_vschedule.type_job

server_mssql.schedule_delete(job_key)

remove existsing schedule

Kind: instance method of Server_mssql

ParamType
job_keystring

server_mssql.get_newid(callback)

get new guid

Kind: instance method of Server_mssql

ParamTypeDescription
callbackcallback_get_newiderror, guid

server_mssql.date_in_sql(d) ⇒ Date

get date in ms sql server

Kind: instance method of Server_mssql

ParamTypeDescription
dDatelocal date regarding which to get the date on the server, default - now

clone_table(from) ⇒ type_exec_table_result

Kind: global function

ParamType
fromtype_exec_table_result

noname_row_beautify(table, type_ext)

Kind: global function

ParamType
tabletype_exec_table_result
type_extboolean

find_disappeared_numbers(nums) ⇒ Array.<number>

Kind: global function

ParamType
numsArray.<number>

type_connection_config

Kind: global typedef
Properties

NameTypeDescription
serverstringMS SQL instance, for example - 'server\instance1'
passwordstringpassrord for ms sql authentication or windows authentication
loginstringlogin for ms sql authentication, if empty - os authentication
databasestringname database for connect, default - 'tempdb'
app_namestringapp name, which will be visible in profiler
connection_timeoutnumberconnection timeout in milliseconds, default - 15000
execution_timeoutnumberexecution timeout in milliseconds, default - 0 (infinity)
encrypt_connectionbooleanencrypt connection, default - false
useUTCbooleandefault - true
action_allowbooleanuse action subsystem, default - false
again_connect_countnumbercount to try to connect to the server if the connection is unavailable, default - 0 (again try connect is disabled)
again_connect_timeoutnumbertimeout in milliseconds between attempts to connect to the server, default - 2000

type_action

Kind: global typedef
Properties

NameTypeDescription
keystringaction uniq key
sql_scriptstring
sql_paramstring
sql_param_notestring
sql_resultstring
sql_lockstringone thread - name
sql_lock_waitnumberone thread - wait timeout in milliseconds (0 - no wait), default 0
sql_lock_messagestringone thread - message if lock exists
js_scriptstring
titlestringaction title
notestringaction title
keys_nextstringexec this actions after exec this action, example - 'key1;key2'
correction_utc_modestring
extented_propertyObject

type_generate_class_with_exec_actions

Kind: global typedef
Properties

NameType
action_class_templatestring
class_namestring

callback_empty : function

Kind: global typedef

callback_error : function

Kind: global typedef

ParamType
errorError

type_exec_option

Kind: global typedef
Properties

NameTypeDescription
correction_utctype_exec_correction_utc_option
locktype_exec_lock_optionone thread subsystem
noname_row_beautifybooleandefault - false
chunk_rowsnumberreturn result by chunk, default - off (undefined)
chunk_msecnumberreturn result by chunk, default - off (undefined)
check_database_after_execbooleanreturn database name, which is active at the time the script is finished, default - false
check_spidbooleanreturn spid, for (example) kill process, default - false
check_printbooleanreturn PRINT and RAISERROR, default - false
type_extbooleancreate properties "type_name", "type_title", "type_charlen" in schema

type_exec_lock_option

Kind: global typedef
Properties

NameType
keystring
waitnumber
messagestring

type_exec_lock_result

Kind: global typedef
Properties

NameType
keystring
waitnumber
messagestring
allowboolean

type_exec_correction_utc_option

Kind: global typedef
Properties

NameTypeDescription
offsetnumbercorrect field with datetime type by this value (in minutes)
modestringwhich 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

type_exec_correction_utc_result

Kind: global typedef
Properties

NameTypeDescription
offsetnumbercorrect field with datetime type by this value (in minutes)
modestringwhich 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

type_exec_error_result

Kind: global typedef
Properties

NameType
stepnumber
errorError
point'connect' | 'sql' | 'kill' | 'action'

type_exec_script_result

Kind: global typedef
Properties

NameType
lock_onstring
lock_offstring
queueArray.<string>
name_serverstring
name_databasestring
name_database_after_execstring
spidnumber
spguidstring
get_plain_queryfunction

type_exec_table_result

Kind: global typedef
Properties

NameType
schemaObject
stepnumber
table_indexnumber
rowsArray.<Object>

function_tables_to_xml_file1 : function

Kind: global typedef

ParamType
errorError
xmlstring

function_tables_to_xml_file2 : function

Kind: global typedef

ParamTypeDescription
full_file_namestring//if empty, see xml as a string in callback
table_name_listArray.<string>
callbackfunction_tables_to_xml_file1

type_performance

Kind: global typedef
Properties

NameType
perfomance_exec_beforenumber
perfomance_exec_afternumber
duration_exec_millisecondArray.<number>

type_exec_result

Kind: global typedef
Properties

NameType
handle_errortype_exec_error_result
locktype_exec_lock_result
scripttype_exec_script_result
correction_utctype_exec_correction_utc_result
performancetype_performance
tablesArray.<type_exec_table_result>
tables_to_xmlfunction_tables_to_xml_file2

type_exec_runtime

Kind: global typedef
Properties

NameType
type'spid' | 'print' | 'table'
spidtype_exec_spid
printtype_exec_print
tabletype_exec_table_result

type_exec_spid

Kind: global typedef
Properties

NameType
spguidstring
spidnumber
existsboolean
killedboolean

type_exec_print

Kind: global typedef
Properties

NameType
messagestring
procnamestring
is_errorboolean

callback_exec_part : function

Kind: global typedef

ParamType
errorObject

callback_exec : function

Kind: global typedef

ParamType
resulttype_exec_result
runtimetype_exec_runtime

callback_exec_runtime : function

Kind: global typedef

ParamType
runtimetype_exec_runtime

callback_print : function

Kind: global typedef

ParamType
printtype_exec_print

callback_table : function

Kind: global typedef

ParamType
tabletype_exec_table_result

callback_action : function

Kind: global typedef

ParamType
resulttype_exec_result
named_tablesArray.<Object>
warningArray.<string>

callback_get_connection_pool : function

Kind: global typedef

ParamType
errorError
connection_poollib_sql.ConnectionPool

callback_connect : function

Kind: global typedef

ParamType
errorError
connection_poollib_sql.Request

type_action_find

Kind: global typedef
Properties

NameType
keystring
titlestring
sql_result_listArray.<string>
notestring
error_listArray.<string>

callback_get_newid : function

Kind: global typedef

ParamType
errorError
guidstring
3.1.1

4 years ago

3.0.38

4 years ago

3.0.35

4 years ago

3.0.36

4 years ago

3.0.34

4 years ago

3.0.33

4 years ago

3.0.32

4 years ago

3.0.31

4 years ago

3.0.30

4 years ago

3.0.29

4 years ago

3.0.28

4 years ago

3.0.27

4 years ago

3.0.26

4 years ago

3.0.25

4 years ago

3.0.23

4 years ago

3.0.24

4 years ago

3.0.22

4 years ago

3.0.21

4 years ago

3.0.20

4 years ago

3.0.19

4 years ago

3.0.18

4 years ago

3.0.17

4 years ago

3.0.16

4 years ago

3.0.14

4 years ago

3.0.13

4 years ago

3.0.12

4 years ago

3.0.11

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.2

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

1.0.110

5 years ago

1.0.109

5 years ago

1.0.108

5 years ago

1.0.107

5 years ago

1.0.106

5 years ago

1.0.105

5 years ago

1.0.104

5 years ago

1.0.103

5 years ago

1.0.102

5 years ago

1.0.101

5 years ago

1.0.100

5 years ago

1.0.99

5 years ago

1.0.98

5 years ago

1.0.97

5 years ago

1.0.96

5 years ago

1.0.95

5 years ago

1.0.94

5 years ago

1.0.93

5 years ago

1.0.92

5 years ago

1.0.91

5 years ago

1.0.90

5 years ago

1.0.89

5 years ago

1.0.88

5 years ago

1.0.87

5 years ago

1.0.86

5 years ago

1.0.85

5 years ago

1.0.84

5 years ago

1.0.83

5 years ago

1.0.82

5 years ago

1.0.81

5 years ago

1.0.80

5 years ago

1.0.79

5 years ago

1.0.78

5 years ago

1.0.77

5 years ago

1.0.76

5 years ago

1.0.69

5 years ago

1.0.68

5 years ago

1.0.67

5 years ago

1.0.66

5 years ago

1.0.65

5 years ago

1.0.64

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.61

5 years ago

1.0.59

5 years ago

1.0.58

5 years ago

1.0.57

5 years ago

1.0.55

5 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.50

5 years ago

1.0.49

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago