node-firebird 2.3.4 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +574 -20
  2. package/lib/callback.d.ts +20 -0
  3. package/lib/callback.js +6 -16
  4. package/lib/firebird.msg.json +1370 -1370
  5. package/lib/gdscodes.d.ts +1519 -1520
  6. package/lib/gdscodes.js +5 -5
  7. package/lib/ieee754-decimal.d.ts +38 -0
  8. package/lib/ieee754-decimal.js +71 -118
  9. package/lib/index.d.ts +37 -338
  10. package/lib/index.js +97 -86
  11. package/lib/messages.d.ts +6 -0
  12. package/lib/messages.js +135 -162
  13. package/lib/pool.d.ts +23 -0
  14. package/lib/pool.js +34 -47
  15. package/lib/srp.d.ts +51 -0
  16. package/lib/srp.js +62 -72
  17. package/lib/types.d.ts +375 -0
  18. package/lib/types.js +22 -0
  19. package/lib/unix-crypt.d.ts +1 -0
  20. package/lib/unix-crypt.js +126 -152
  21. package/lib/utils.d.ts +16 -0
  22. package/lib/utils.js +24 -48
  23. package/lib/wire/connection.d.ts +100 -0
  24. package/lib/wire/connection.js +1029 -1009
  25. package/lib/wire/const.d.ts +567 -0
  26. package/lib/wire/const.js +620 -599
  27. package/lib/wire/database.d.ts +57 -0
  28. package/lib/wire/database.js +111 -108
  29. package/lib/wire/eventConnection.d.ts +16 -0
  30. package/lib/wire/eventConnection.js +29 -31
  31. package/lib/wire/fbEventManager.d.ts +45 -0
  32. package/lib/wire/fbEventManager.js +38 -57
  33. package/lib/wire/serialize.d.ts +97 -0
  34. package/lib/wire/serialize.js +42 -141
  35. package/lib/wire/service.d.ts +66 -0
  36. package/lib/wire/service.js +374 -401
  37. package/lib/wire/socket.d.ts +59 -0
  38. package/lib/wire/socket.js +79 -40
  39. package/lib/wire/statement.d.ts +25 -0
  40. package/lib/wire/statement.js +13 -9
  41. package/lib/wire/transaction.d.ts +21 -0
  42. package/lib/wire/transaction.js +33 -61
  43. package/lib/wire/xsqlvar.d.ts +175 -0
  44. package/lib/wire/xsqlvar.js +169 -269
  45. package/package.json +12 -4
  46. package/src/callback.ts +55 -0
  47. package/{poc/node_modules/node-firebird/lib/gdscodes.js → src/gdscodes.ts} +3 -3
  48. package/{poc/node_modules/node-firebird/lib/ieee754-decimal.js → src/ieee754-decimal.ts} +7 -14
  49. package/src/index.ts +157 -0
  50. package/{poc/node_modules/node-firebird/lib/messages.js → src/messages.ts} +163 -162
  51. package/src/pool.ts +209 -0
  52. package/{poc/node_modules/node-firebird/lib/srp.js → src/srp.ts} +74 -33
  53. package/src/types.ts +419 -0
  54. package/{poc/node_modules/node-firebird/lib/unix-crypt.js → src/unix-crypt.ts} +6 -12
  55. package/{poc/node_modules/node-firebird/lib/utils.js → src/utils.ts} +11 -20
  56. package/{poc/node_modules/node-firebird/lib/wire/connection.js → src/wire/connection.ts} +611 -129
  57. package/{poc/node_modules/node-firebird/lib/wire/const.js → src/wire/const.ts} +96 -9
  58. package/{poc/node_modules/node-firebird/lib/wire/database.js → src/wire/database.ts} +110 -44
  59. package/{poc/node_modules/node-firebird/lib/wire/eventConnection.js → src/wire/eventConnection.ts} +29 -14
  60. package/{poc/node_modules/node-firebird/lib/wire/fbEventManager.js → src/wire/fbEventManager.ts} +39 -30
  61. package/{poc/node_modules/node-firebird/lib/wire/serialize.js → src/wire/serialize.ts} +78 -59
  62. package/{poc/node_modules/node-firebird/lib/wire/service.js → src/wire/service.ts} +90 -88
  63. package/src/wire/socket.ts +262 -0
  64. package/src/wire/statement.ts +71 -0
  65. package/{poc/node_modules/node-firebird/lib/wire/transaction.js → src/wire/transaction.ts} +25 -19
  66. package/{poc/node_modules/node-firebird/lib/wire/xsqlvar.js → src/wire/xsqlvar.ts} +244 -143
  67. package/.eslintrc.json +0 -12
  68. package/.github/workflows/codeql.yml +0 -76
  69. package/.github/workflows/node.js.yml +0 -95
  70. package/BIGINT_MIGRATION.md +0 -374
  71. package/CI_DEBUGGING_GUIDE.md +0 -148
  72. package/ENCRYPTION_CALLBACK.md +0 -152
  73. package/FIREBIRD_LOG_FEATURE.md +0 -145
  74. package/MINIMAL_CHANGES_SUMMARY.md +0 -136
  75. package/PR_SUMMARY.md +0 -96
  76. package/ROADMAP.md +0 -223
  77. package/SRP_PROTOCOL.md +0 -482
  78. package/poc/README.md +0 -160
  79. package/poc/helpers.js +0 -59
  80. package/poc/node_modules/.package-lock.json +0 -14
  81. package/poc/node_modules/node-firebird/.eslintrc.json +0 -12
  82. package/poc/node_modules/node-firebird/.github/workflows/codeql.yml +0 -76
  83. package/poc/node_modules/node-firebird/.github/workflows/node.js.yml +0 -95
  84. package/poc/node_modules/node-firebird/BIGINT_MIGRATION.md +0 -374
  85. package/poc/node_modules/node-firebird/CI_DEBUGGING_GUIDE.md +0 -148
  86. package/poc/node_modules/node-firebird/ENCRYPTION_CALLBACK.md +0 -152
  87. package/poc/node_modules/node-firebird/FIREBIRD_LOG_FEATURE.md +0 -145
  88. package/poc/node_modules/node-firebird/LICENSE +0 -373
  89. package/poc/node_modules/node-firebird/MINIMAL_CHANGES_SUMMARY.md +0 -136
  90. package/poc/node_modules/node-firebird/PR_SUMMARY.md +0 -96
  91. package/poc/node_modules/node-firebird/README.md +0 -794
  92. package/poc/node_modules/node-firebird/ROADMAP.md +0 -223
  93. package/poc/node_modules/node-firebird/SRP_PROTOCOL.md +0 -482
  94. package/poc/node_modules/node-firebird/lib/callback.js +0 -38
  95. package/poc/node_modules/node-firebird/lib/gdscodes.d.ts +0 -1524
  96. package/poc/node_modules/node-firebird/lib/index.d.ts +0 -316
  97. package/poc/node_modules/node-firebird/lib/index.js +0 -128
  98. package/poc/node_modules/node-firebird/lib/pool.js +0 -108
  99. package/poc/node_modules/node-firebird/lib/wire/socket.js +0 -175
  100. package/poc/node_modules/node-firebird/lib/wire/statement.js +0 -48
  101. package/poc/node_modules/node-firebird/package.json +0 -38
  102. package/poc/node_modules/node-firebird/vitest.config.js +0 -24
  103. package/poc/package-lock.json +0 -21
  104. package/poc/package.json +0 -12
  105. package/poc/reproduce-fixed.js +0 -150
  106. package/poc/reproduce.js +0 -133
  107. package/vitest.config.js +0 -27
  108. /package/{poc/node_modules/node-firebird/lib → src}/firebird.msg +0 -0
  109. /package/{poc/node_modules/node-firebird/lib → src}/firebird.msg.json +0 -0
package/lib/wire/const.js CHANGED
@@ -1,158 +1,152 @@
1
+ "use strict";
1
2
  /***************************************
2
3
  *
3
4
  * Constantes
4
5
  *
5
6
  ***************************************/
6
-
7
7
  const defaultOptions = {
8
- DEFAULT_HOST : '127.0.0.1',
9
- DEFAULT_PORT : 3050,
10
- DEFAULT_USER : 'SYSDBA',
11
- DEFAULT_PASSWORD : 'masterkey',
12
- DEFAULT_LOWERCASE_KEYS : false,
13
- DEFAULT_PAGE_SIZE : 4096,
14
- DEFAULT_SVC_NAME : 'service_mgr',
15
- DEFAULT_ENCODING : 'UTF8',
16
- DEFAULT_FETCHSIZE : 200,
17
- };
18
-
19
- const buffer= {
20
- MAX_BUFFER_SIZE : 8192,
21
- };
22
-
8
+ DEFAULT_HOST: '127.0.0.1',
9
+ DEFAULT_PORT: 3050,
10
+ DEFAULT_USER: 'SYSDBA',
11
+ DEFAULT_PASSWORD: 'masterkey',
12
+ DEFAULT_LOWERCASE_KEYS: false,
13
+ DEFAULT_PAGE_SIZE: 4096,
14
+ DEFAULT_SVC_NAME: 'service_mgr',
15
+ DEFAULT_ENCODING: 'utf8',
16
+ DEFAULT_FETCHSIZE: 200,
17
+ };
18
+ const buffer = {
19
+ MAX_BUFFER_SIZE: 8192,
20
+ };
23
21
  const int = {
24
- MAX_INT : Math.pow(2, 31) - 1,
25
- MIN_INT : -Math.pow(2, 31),
22
+ MAX_INT: Math.pow(2, 31) - 1,
23
+ MIN_INT: -Math.pow(2, 31),
26
24
  };
27
-
28
25
  const op = {
29
- op_void : 0, // Packet has been voided
30
- op_connect : 1, // Connect to remote server
31
- op_exit : 2, // Remote end has exitted
32
- op_accept : 3, // Server accepts connection
33
- op_reject : 4, // Server rejects connection
34
- op_disconnect : 6, // Connect is going away
35
- op_response : 9, // Generic response block
36
-
26
+ op_void: 0, // Packet has been voided
27
+ op_connect: 1, // Connect to remote server
28
+ op_exit: 2, // Remote end has exitted
29
+ op_accept: 3, // Server accepts connection
30
+ op_reject: 4, // Server rejects connection
31
+ op_disconnect: 6, // Connect is going away
32
+ op_response: 9, // Generic response block
37
33
  // Full context server operations
38
-
39
- op_attach : 19, // Attach database
40
- op_create : 20, // Create database
41
- op_detach : 21, // Detach database
42
- op_compile : 22, // Request based operations
43
- op_start : 23,
44
- op_start_and_send : 24,
45
- op_send : 25,
46
- op_receive : 26,
47
- op_unwind : 27, // apparently unused, see protocol.cpp's case op_unwind
48
- op_release : 28,
49
-
50
- op_transaction : 29, // Transaction operations
51
- op_commit : 30,
52
- op_rollback : 31,
53
- op_prepare : 32,
54
- op_reconnect : 33,
55
-
56
- op_create_blob : 34, // Blob operations
57
- op_open_blob : 35,
58
- op_get_segment : 36,
59
- op_put_segment : 37,
60
- op_cancel_blob : 38,
61
- op_close_blob : 39,
62
-
63
- op_info_database : 40, // Information services
64
- op_info_request : 41,
65
- op_info_transaction : 42,
66
- op_info_blob : 43,
67
-
68
- op_batch_segments : 44, // Put a bunch of blob segments
69
-
70
- op_que_events : 48, // Que event notification request
71
- op_cancel_events : 49, // Cancel event notification request
72
- op_commit_retaining : 50, // Commit retaining (what else)
73
- op_prepare2 : 51, // Message form of prepare
74
- op_event : 52, // Completed event request (asynchronous)
75
- op_connect_request : 53, // Request to establish connection
76
- op_aux_connect : 54, // Establish auxiliary connection
77
- op_ddl : 55, // DDL call
78
- op_open_blob2 : 56,
79
- op_create_blob2 : 57,
80
- op_get_slice : 58,
81
- op_put_slice : 59,
82
- op_slice : 60, // Successful response to op_get_slice
83
- op_seek_blob : 61, // Blob seek operation
84
-
85
- // DSQL operations
86
-
87
- op_allocate_statement : 62, // allocate a statment handle
88
- op_execute : 63, // execute a prepared statement
89
- op_exec_immediate : 64, // execute a statement
90
- op_fetch : 65, // fetch a record
91
- op_fetch_response : 66, // response for record fetch
92
- op_free_statement : 67, // free a statement
93
- op_prepare_statement : 68, // prepare a statement
94
- op_set_cursor : 69, // set a cursor name
95
- op_info_sql : 70,
96
-
97
- op_dummy : 71, // dummy packet to detect loss of client
98
- op_response_piggyback : 72, // response block for piggybacked messages
99
- op_start_and_receive : 73,
100
- op_start_send_and_receive : 74,
101
- op_exec_immediate2 : 75, // execute an immediate statement with msgs
102
- op_execute2 : 76, // execute a statement with msgs
103
- op_insert : 77,
104
- op_sql_response : 78, // response from execute, exec immed, insert
105
- op_transact : 79,
106
- op_transact_response : 80,
107
- op_drop_database : 81,
108
- op_service_attach : 82,
109
- op_service_detach : 83,
110
- op_service_info : 84,
111
- op_service_start : 85,
112
- op_rollback_retaining : 86,
113
- op_partial : 89, // packet is not complete - delay processing
114
- op_trusted_auth : 90,
115
- op_cancel : 91,
116
- op_cont_auth : 92,
117
- op_ping : 93,
118
- op_accept_data : 94, // Server accepts connection and returns some data to client
119
- op_abort_aux_connection : 95, // Async operation - stop waiting for async connection to arrive
120
- op_crypt : 96,
121
- op_crypt_key_callback : 97,
122
- op_cond_accept : 98, // Server accepts connection, returns some data to client
123
- // and asks client to continue authentication before attach call
124
- };
125
-
34
+ op_attach: 19, // Attach database
35
+ op_create: 20, // Create database
36
+ op_detach: 21, // Detach database
37
+ op_compile: 22, // Request based operations
38
+ op_start: 23,
39
+ op_start_and_send: 24,
40
+ op_send: 25,
41
+ op_receive: 26,
42
+ op_unwind: 27, // apparently unused, see protocol.cpp's case op_unwind
43
+ op_release: 28,
44
+ op_transaction: 29, // Transaction operations
45
+ op_commit: 30,
46
+ op_rollback: 31,
47
+ op_prepare: 32,
48
+ op_reconnect: 33,
49
+ op_create_blob: 34, // Blob operations
50
+ op_open_blob: 35,
51
+ op_get_segment: 36,
52
+ op_put_segment: 37,
53
+ op_cancel_blob: 38,
54
+ op_close_blob: 39,
55
+ op_info_database: 40, // Information services
56
+ op_info_request: 41,
57
+ op_info_transaction: 42,
58
+ op_info_blob: 43,
59
+ op_batch_segments: 44, // Put a bunch of blob segments
60
+ op_que_events: 48, // Que event notification request
61
+ op_cancel_events: 49, // Cancel event notification request
62
+ op_commit_retaining: 50, // Commit retaining (what else)
63
+ op_prepare2: 51, // Message form of prepare
64
+ op_event: 52, // Completed event request (asynchronous)
65
+ op_connect_request: 53, // Request to establish connection
66
+ op_aux_connect: 54, // Establish auxiliary connection
67
+ op_ddl: 55, // DDL call
68
+ op_open_blob2: 56,
69
+ op_create_blob2: 57,
70
+ op_get_slice: 58,
71
+ op_put_slice: 59,
72
+ op_slice: 60, // Successful response to op_get_slice
73
+ op_seek_blob: 61, // Blob seek operation
74
+ // DSQL operations
75
+ op_allocate_statement: 62, // allocate a statment handle
76
+ op_execute: 63, // execute a prepared statement
77
+ op_exec_immediate: 64, // execute a statement
78
+ op_fetch: 65, // fetch a record
79
+ op_fetch_response: 66, // response for record fetch
80
+ op_free_statement: 67, // free a statement
81
+ op_prepare_statement: 68, // prepare a statement
82
+ op_set_cursor: 69, // set a cursor name
83
+ op_info_sql: 70,
84
+ op_dummy: 71, // dummy packet to detect loss of client
85
+ op_response_piggyback: 72, // response block for piggybacked messages
86
+ op_start_and_receive: 73,
87
+ op_start_send_and_receive: 74,
88
+ op_exec_immediate2: 75, // execute an immediate statement with msgs
89
+ op_execute2: 76, // execute a statement with msgs
90
+ op_insert: 77,
91
+ op_sql_response: 78, // response from execute, exec immed, insert
92
+ op_transact: 79,
93
+ op_transact_response: 80,
94
+ op_drop_database: 81,
95
+ op_service_attach: 82,
96
+ op_service_detach: 83,
97
+ op_service_info: 84,
98
+ op_service_start: 85,
99
+ op_rollback_retaining: 86,
100
+ op_partial: 89, // packet is not complete - delay processing
101
+ op_trusted_auth: 90,
102
+ op_cancel: 91,
103
+ op_cont_auth: 92,
104
+ op_ping: 93,
105
+ op_accept_data: 94, // Server accepts connection and returns some data to client
106
+ op_abort_aux_connection: 95, // Async operation - stop waiting for async connection to arrive
107
+ op_crypt: 96,
108
+ op_crypt_key_callback: 97,
109
+ op_cond_accept: 98, // Server accepts connection, returns some data to client
110
+ // and asks client to continue authentication before attach call
111
+ op_fetch_scroll: 112,
112
+ op_info_cursor: 113,
113
+ op_inline_blob: 114,
114
+ };
126
115
  const dsql = {
127
- DSQL_close : 1,
128
- DSQL_drop : 2,
129
- DSQL_unprepare : 4, // >: 2.5
116
+ DSQL_close: 1,
117
+ DSQL_drop: 2,
118
+ DSQL_unprepare: 4, // >: 2.5
119
+ };
120
+ const fetchOp = {
121
+ fetch_next: 0,
122
+ fetch_prior: 1,
123
+ fetch_first: 2,
124
+ fetch_last: 3,
125
+ fetch_absolute: 4,
126
+ fetch_relative: 5,
130
127
  };
131
-
132
128
  /***********************/
133
129
  /* ISC Error Codes */
134
130
  /***********************/
135
131
  const iscError = {
136
132
  isc_sqlerr: 335544436,
137
- isc_arg_end : 0, // end of argument list
138
- isc_arg_gds : 1, // generic DSRI status value
139
- isc_arg_string : 2, // string argument
140
- isc_arg_cstring : 3, // count & string argument
141
- isc_arg_number : 4, // numeric argument (long)
142
- isc_arg_interpreted : 5, // interpreted status code (string)
143
- isc_arg_unix : 7, // UNIX error code
144
- isc_arg_next_mach : 15, // NeXT/Mach error code
145
- isc_arg_win32 : 17, // Win32 error code
146
- isc_arg_warning : 18, // warning argument
147
- isc_arg_sql_state : 19, // SQLSTATE
148
- };
149
-
133
+ isc_arg_end: 0, // end of argument list
134
+ isc_arg_gds: 1, // generic DSRI status value
135
+ isc_arg_string: 2, // string argument
136
+ isc_arg_cstring: 3, // count & string argument
137
+ isc_arg_number: 4, // numeric argument (long)
138
+ isc_arg_interpreted: 5, // interpreted status code (string)
139
+ isc_arg_unix: 7, // UNIX error code
140
+ isc_arg_next_mach: 15, // NeXT/Mach error code
141
+ isc_arg_win32: 17, // Win32 error code
142
+ isc_arg_warning: 18, // warning argument
143
+ isc_arg_sql_state: 19, // SQLSTATE
144
+ };
150
145
  const connect = {
151
- CONNECT_VERSION2 : 2,
152
- CONNECT_VERSION3 : 3,
153
- ARCHITECTURE_GENERIC : 1,
146
+ CONNECT_VERSION2: 2,
147
+ CONNECT_VERSION3: 3,
148
+ ARCHITECTURE_GENERIC: 1,
154
149
  };
155
-
156
150
  /*******************/
157
151
  /* Protocols */
158
152
  /*******************/
@@ -160,52 +154,51 @@ const FB_PROTOCOL_FLAG = 0x8000;
160
154
  const protocol = {
161
155
  // Protocol 10 includes support for warnings and removes the requirement for
162
156
  // encoding and decoding status codes
163
- PROTOCOL_VERSION10 : 10,
164
-
157
+ PROTOCOL_VERSION10: 10,
165
158
  // Since protocol 11 we must be separated from Borland Interbase.
166
159
  // Therefore always set highmost bit in protocol version to 1.
167
160
  // For unsigned protocol version this does not break version's compare.
168
- FB_PROTOCOL_FLAG : FB_PROTOCOL_FLAG,
169
- FB_PROTOCOL_MASK : ~FB_PROTOCOL_FLAG & 0xFFFF,
170
-
161
+ FB_PROTOCOL_FLAG: FB_PROTOCOL_FLAG,
162
+ FB_PROTOCOL_MASK: ~FB_PROTOCOL_FLAG & 0xFFFF,
171
163
  // Protocol 11 has support for user authentication related
172
164
  // operations (op_update_account_info, op_authenticate_user and
173
165
  // op_trusted_auth). When specific operation is not supported,
174
166
  // we say "sorry".
175
- PROTOCOL_VERSION11 : (FB_PROTOCOL_FLAG | 11),
176
-
167
+ PROTOCOL_VERSION11: (FB_PROTOCOL_FLAG | 11),
177
168
  // Protocol 12 has support for asynchronous call op_cancel.
178
169
  // Currently implemented asynchronously only for TCP/IP.
179
- PROTOCOL_VERSION12 : (FB_PROTOCOL_FLAG | 12),
180
-
170
+ PROTOCOL_VERSION12: (FB_PROTOCOL_FLAG | 12),
181
171
  // Protocol 13 has support for authentication plugins (op_cont_auth).
182
- PROTOCOL_VERSION13 : (FB_PROTOCOL_FLAG | 13),
183
-
172
+ PROTOCOL_VERSION13: (FB_PROTOCOL_FLAG | 13),
184
173
  // Protocol 14 has support for wire encryption.
185
- PROTOCOL_VERSION14 : (FB_PROTOCOL_FLAG | 14),
186
-
174
+ PROTOCOL_VERSION14: (FB_PROTOCOL_FLAG | 14),
187
175
  // Protocol 15 has support for conditional accept with early wire encryption.
188
- PROTOCOL_VERSION15 : (FB_PROTOCOL_FLAG | 15),
189
-
176
+ PROTOCOL_VERSION15: (FB_PROTOCOL_FLAG | 15),
190
177
  // Protocol 16 has support for statement timeouts, DECFLOAT data types,
191
178
  // and extended metadata identifiers (up to 63 characters).
192
179
  // Introduced in Firebird 4.0.
193
- PROTOCOL_VERSION16 : (FB_PROTOCOL_FLAG | 16),
194
-
180
+ PROTOCOL_VERSION16: (FB_PROTOCOL_FLAG | 16),
195
181
  // Protocol 17 continues Firebird 4.0 enhancements.
196
- PROTOCOL_VERSION17 : (FB_PROTOCOL_FLAG | 17),
182
+ PROTOCOL_VERSION17: (FB_PROTOCOL_FLAG | 17),
183
+ // Protocol 18 includes support for fetches from scrollable cursors.
184
+ // Introduced in Firebird 5.0.
185
+ PROTOCOL_VERSION18: (FB_PROTOCOL_FLAG | 18),
186
+ // Protocol 19 includes support for Inline BLOBs.
187
+ // Introduced in Firebird 5.0.3.
188
+ PROTOCOL_VERSION19: (FB_PROTOCOL_FLAG | 19),
189
+ // Protocol 20 includes support for SQL Schemas and Named Arguments.
190
+ // Introduced in Firebird 6.0.
191
+ PROTOCOL_VERSION20: (FB_PROTOCOL_FLAG | 20),
197
192
  };
198
-
199
193
  // Protocols types (accept_type)
200
194
  const acceptType = {
201
- ptype_rpc : 2, // Simple remote procedure call
202
- ptype_batch_send : 3, // Batch sends, no asynchrony
203
- ptype_out_of_band : 4, // Batch sends w/ out of band notification
204
- ptype_lazy_send : 5, // Deferred packets delivery;
205
- ptype_mask : 0xFF, // Mask - up to 255 types of protocol
206
- pflag_compress : 0x100 // Turn on compression if possible
207
- };
208
-
195
+ ptype_rpc: 2, // Simple remote procedure call
196
+ ptype_batch_send: 3, // Batch sends, no asynchrony
197
+ ptype_out_of_band: 4, // Batch sends w/ out of band notification
198
+ ptype_lazy_send: 5, // Deferred packets delivery;
199
+ ptype_mask: 0xFF, // Mask - up to 255 types of protocol
200
+ pflag_compress: 0x100 // Turn on compression if possible
201
+ };
209
202
  const SUPPORTED_PROTOCOL = [
210
203
  [protocol.PROTOCOL_VERSION10, connect.ARCHITECTURE_GENERIC, acceptType.ptype_rpc, acceptType.ptype_batch_send, 1],
211
204
  [protocol.PROTOCOL_VERSION11, connect.ARCHITECTURE_GENERIC, acceptType.ptype_lazy_send, acceptType.ptype_lazy_send, 2],
@@ -215,314 +208,325 @@ const SUPPORTED_PROTOCOL = [
215
208
  [protocol.PROTOCOL_VERSION15, connect.ARCHITECTURE_GENERIC, acceptType.ptype_lazy_send, acceptType.ptype_lazy_send, 6],
216
209
  [protocol.PROTOCOL_VERSION16, connect.ARCHITECTURE_GENERIC, acceptType.ptype_lazy_send, acceptType.ptype_lazy_send, 7],
217
210
  [protocol.PROTOCOL_VERSION17, connect.ARCHITECTURE_GENERIC, acceptType.ptype_lazy_send, acceptType.ptype_lazy_send, 8],
211
+ [protocol.PROTOCOL_VERSION18, connect.ARCHITECTURE_GENERIC, acceptType.ptype_lazy_send, acceptType.ptype_lazy_send, 9],
212
+ [protocol.PROTOCOL_VERSION19, connect.ARCHITECTURE_GENERIC, acceptType.ptype_lazy_send, acceptType.ptype_lazy_send, 10]
218
213
  ];
219
-
220
214
  const authPlugin = {
221
- AUTH_PLUGIN_LEGACY : 'Legacy_Auth',
222
- AUTH_PLUGIN_SRP : 'Srp',
223
- AUTH_PLUGIN_SRP256 : 'Srp256',
215
+ AUTH_PLUGIN_LEGACY: 'Legacy_Auth',
216
+ AUTH_PLUGIN_SRP: 'Srp',
217
+ AUTH_PLUGIN_SRP256: 'Srp256',
218
+ AUTH_PLUGIN_SRP384: 'Srp384',
219
+ AUTH_PLUGIN_SRP512: 'Srp512',
224
220
  };
225
-
226
221
  const authOptions = {
227
- AUTH_PLUGIN_LIST : [authPlugin.AUTH_PLUGIN_SRP256, authPlugin.AUTH_PLUGIN_SRP, authPlugin.AUTH_PLUGIN_LEGACY],
228
- AUTH_PLUGIN_SRP_LIST : [authPlugin.AUTH_PLUGIN_SRP256, authPlugin.AUTH_PLUGIN_SRP],
229
- LEGACY_AUTH_SALT : '9z',
230
- WIRE_CRYPT_DISABLE : 0,
231
- WIRE_CRYPT_ENABLE : 1,
222
+ AUTH_PLUGIN_LIST: [
223
+ authPlugin.AUTH_PLUGIN_SRP512,
224
+ authPlugin.AUTH_PLUGIN_SRP384,
225
+ authPlugin.AUTH_PLUGIN_SRP256,
226
+ authPlugin.AUTH_PLUGIN_SRP,
227
+ authPlugin.AUTH_PLUGIN_LEGACY
228
+ ],
229
+ AUTH_PLUGIN_SRP_LIST: [
230
+ authPlugin.AUTH_PLUGIN_SRP512,
231
+ authPlugin.AUTH_PLUGIN_SRP384,
232
+ authPlugin.AUTH_PLUGIN_SRP256,
233
+ authPlugin.AUTH_PLUGIN_SRP
234
+ ],
235
+ LEGACY_AUTH_SALT: '9z',
236
+ WIRE_CRYPT_DISABLE: 0,
237
+ WIRE_CRYPT_ENABLE: 1,
232
238
  };
233
-
234
239
  /*******************/
235
240
  /* SQL Type */
236
241
  /*******************/
237
242
  const sqlType = {
238
- SQL_TEXT : 452, // Array of char
239
- SQL_VARYING : 448,
240
- SQL_SHORT : 500,
241
- SQL_LONG : 496,
242
- SQL_FLOAT : 482,
243
- SQL_DOUBLE : 480,
244
- SQL_D_FLOAT : 530,
245
- SQL_TIMESTAMP : 510,
246
- SQL_BLOB : 520,
247
- SQL_ARRAY : 540,
248
- SQL_QUAD : 550,
249
- SQL_TYPE_TIME : 560,
250
- SQL_TYPE_DATE : 570,
251
- SQL_INT64 : 580,
243
+ SQL_TEXT: 452, // Array of char
244
+ SQL_VARYING: 448,
245
+ SQL_SHORT: 500,
246
+ SQL_LONG: 496,
247
+ SQL_FLOAT: 482,
248
+ SQL_DOUBLE: 480,
249
+ SQL_D_FLOAT: 530,
250
+ SQL_TIMESTAMP: 510,
251
+ SQL_BLOB: 520,
252
+ SQL_ARRAY: 540,
253
+ SQL_QUAD: 550,
254
+ SQL_TYPE_TIME: 560,
255
+ SQL_TYPE_DATE: 570,
256
+ SQL_INT64: 580,
252
257
  SQL_INT128: 32752, // >= 4.0
253
- SQL_TIMESTAMP_TZ : 32754, // >= 4.0 - timestamp with time zone
254
- SQL_TIMESTAMP_TZ_EX : 32748, // >= 4.0 - extended timestamp with time zone
255
- SQL_TIME_TZ : 32756, // >= 4.0 - time with time zone
256
- SQL_TIME_TZ_EX : 32750, // >= 4.0 - extended time with time zone
257
- SQL_DEC16 : 32760, // >= 4.0 - DECFLOAT(16) - 8 bytes, IEEE 754 Decimal64
258
- SQL_DEC34 : 32762, // >= 4.0 - DECFLOAT(34) - 16 bytes, IEEE 754 Decimal128
259
- SQL_BOOLEAN : 32764, // >: 3.0
260
- SQL_NULL : 32766, // >= 2.5
261
- SQL_TIMESTAMP_TZ_EX : 32748,
262
- SQL_TIME_TZ_EX : 32750,
263
- SQL_TIMESTAMP_TZ : 32754,
264
- SQL_TIME_TZ : 32756,
265
- };
266
-
258
+ SQL_TIMESTAMP_TZ: 32754, // >= 4.0 - timestamp with time zone
259
+ SQL_TIMESTAMP_TZ_EX: 32748, // >= 4.0 - extended timestamp with time zone
260
+ SQL_TIME_TZ: 32756, // >= 4.0 - time with time zone
261
+ SQL_TIME_TZ_EX: 32750, // >= 4.0 - extended time with time zone
262
+ SQL_DEC16: 32760, // >= 4.0 - DECFLOAT(16) - 8 bytes, IEEE 754 Decimal64
263
+ SQL_DEC34: 32762, // >= 4.0 - DECFLOAT(34) - 16 bytes, IEEE 754 Decimal128
264
+ SQL_BOOLEAN: 32764, // >: 3.0
265
+ SQL_NULL: 32766, // >= 2.5
266
+ };
267
267
  const blobType = {
268
- isc_blob_text : 1,
268
+ isc_blob_text: 1,
269
269
  };
270
-
271
270
  /*******************/
272
271
  /* Blr definitions */
273
272
  /*******************/
274
273
  const blr = {
275
- blr_text : 14,
276
- blr_text2 : 15,
277
- blr_short : 7,
278
- blr_long : 8,
279
- blr_quad : 9,
280
- blr_float : 10,
281
- blr_double : 27,
282
- blr_d_float : 11,
283
- blr_timestamp : 35,
284
- blr_varying : 37,
285
- blr_varying2 : 38,
286
- blr_blob : 261,
287
- blr_cstring : 40,
288
- blr_cstring2 : 41,
289
- blr_blob_id : 45,
290
- blr_sql_date : 12,
291
- blr_sql_time : 13,
292
- blr_int64 : 16,
293
- blr_int128 : 26, // >: 4.0
294
- blr_dec64 : 24, // >= 4.0 - DECFLOAT(16), IEEE 754 Decimal64
295
- blr_dec128 : 25, // >= 4.0 - DECFLOAT(34), IEEE 754 Decimal128
296
- blr_timestamp_tz : 28, // >= 4.0 - timestamp with time zone
297
- blr_time_tz : 29, // >= 4.0 - time with time zone
298
- blr_blob2 : 17, // >: 2.0
299
- blr_domain_name : 18, // >: 2.1
300
- blr_domain_name2 : 19, // >: 2.1
301
- blr_not_nullable : 20, // >: 2.1
302
- blr_column_name : 21, // >: 2.5
303
- blr_column_name2 : 22, // >: 2.5
304
- blr_bool : 23, // >: 3.0
305
-
306
- blr_sql_time_tz : 28, // >: 4.0
307
- blr_timestamp_tz : 29, // >: 4.0
308
- blr_ex_time_tz : 30, // >: 4.0
309
- blr_ex_timestamp_tz : 31, // >: 4.0
310
-
311
- blr_version4 : 4,
312
- blr_version5 : 5, // dialect 3
313
- blr_eoc : 76,
314
- blr_end : 255,
315
-
316
- blr_assignment : 1,
317
- blr_begin : 2,
318
- blr_dcl_variable : 3,
319
- blr_message : 4,
320
- };
321
-
274
+ blr_text: 14,
275
+ blr_text2: 15,
276
+ blr_short: 7,
277
+ blr_long: 8,
278
+ blr_quad: 9,
279
+ blr_float: 10,
280
+ blr_double: 27,
281
+ blr_d_float: 11,
282
+ blr_timestamp: 35,
283
+ blr_varying: 37,
284
+ blr_varying2: 38,
285
+ blr_blob: 261,
286
+ blr_cstring: 40,
287
+ blr_cstring2: 41,
288
+ blr_blob_id: 45,
289
+ blr_sql_date: 12,
290
+ blr_sql_time: 13,
291
+ blr_int64: 16,
292
+ blr_int128: 26, // >: 4.0
293
+ blr_dec64: 24, // >= 4.0 - DECFLOAT(16), IEEE 754 Decimal64
294
+ blr_dec128: 25, // >= 4.0 - DECFLOAT(34), IEEE 754 Decimal128
295
+ blr_time_tz: 29, // >= 4.0 - time with time zone
296
+ blr_blob2: 17, // >: 2.0
297
+ blr_domain_name: 18, // >: 2.1
298
+ blr_domain_name2: 19, // >: 2.1
299
+ blr_not_nullable: 20, // >: 2.1
300
+ blr_column_name: 21, // >: 2.5
301
+ blr_column_name2: 22, // >: 2.5
302
+ blr_bool: 23, // >: 3.0
303
+ blr_sql_time_tz: 28, // >: 4.0
304
+ blr_timestamp_tz: 29, // >: 4.0
305
+ blr_ex_time_tz: 30, // >: 4.0
306
+ blr_ex_timestamp_tz: 31, // >: 4.0
307
+ blr_version4: 4,
308
+ blr_version5: 5, // dialect 3
309
+ blr_eoc: 76,
310
+ blr_end: 255,
311
+ blr_assignment: 1,
312
+ blr_begin: 2,
313
+ blr_dcl_variable: 3,
314
+ blr_message: 4,
315
+ };
322
316
  /**********************************/
323
317
  /* Database parameter block stuff */
324
318
  /**********************************/
325
319
  const dpb = {
326
- isc_dpb_version1 : 1,
327
- isc_dpb_version2 : 2, // >: FB30
328
- isc_dpb_cdd_pathname : 1,
329
- isc_dpb_allocation : 2,
330
- isc_dpb_journal : 3,
331
- isc_dpb_page_size : 4,
332
- isc_dpb_num_buffers : 5,
333
- isc_dpb_buffer_length : 6,
334
- isc_dpb_debug : 7,
335
- isc_dpb_garbage_collect : 8,
336
- isc_dpb_verify : 9,
337
- isc_dpb_sweep : 10,
338
- isc_dpb_enable_journal : 11,
339
- isc_dpb_disable_journal : 12,
340
- isc_dpb_dbkey_scope : 13,
341
- isc_dpb_number_of_users : 14,
342
- isc_dpb_trace : 15,
343
- isc_dpb_no_garbage_collect : 16,
344
- isc_dpb_damaged : 17,
345
- isc_dpb_license : 18,
346
- isc_dpb_sys_user_name : 19,
347
- isc_dpb_encrypt_key : 20,
348
- isc_dpb_activate_shadow : 21,
349
- isc_dpb_sweep_interval : 22,
350
- isc_dpb_delete_shadow : 23,
351
- isc_dpb_force_write : 24,
352
- isc_dpb_begin_log : 25,
353
- isc_dpb_quit_log : 26,
354
- isc_dpb_no_reserve : 27,
355
- isc_dpb_user_name : 28,
356
- isc_dpb_password : 29,
357
- isc_dpb_password_enc : 30,
358
- isc_dpb_sys_user_name_enc : 31,
359
- isc_dpb_interp : 32,
360
- isc_dpb_online_dump : 33,
361
- isc_dpb_old_file_size : 34,
362
- isc_dpb_old_num_files : 35,
363
- isc_dpb_old_file : 36,
364
- isc_dpb_old_start_page : 37,
365
- isc_dpb_old_start_seqno : 38,
366
- isc_dpb_old_start_file : 39,
367
- isc_dpb_old_dump_id : 41,
368
- isc_dpb_lc_messages : 47,
369
- isc_dpb_lc_ctype : 48,
370
- isc_dpb_cache_manager : 49,
371
- isc_dpb_shutdown : 50,
372
- isc_dpb_online : 51,
373
- isc_dpb_shutdown_delay : 52,
374
- isc_dpb_reserved : 53,
375
- isc_dpb_overwrite : 54,
376
- isc_dpb_sec_attach : 55,
377
- isc_dpb_connect_timeout : 57,
378
- isc_dpb_dummy_packet_interval : 58,
379
- isc_dpb_gbak_attach : 59,
380
- isc_dpb_sql_role_name : 60,
381
- isc_dpb_set_page_buffers : 61,
382
- isc_dpb_working_directory : 62,
383
- isc_dpb_sql_dialect : 63,
384
- isc_dpb_set_db_readonly : 64,
385
- isc_dpb_set_db_sql_dialect : 65,
386
- isc_dpb_gfix_attach : 66,
387
- isc_dpb_gstat_attach : 67,
388
- isc_dpb_set_db_charset : 68,
389
- isc_dpb_gsec_attach : 69,
390
- isc_dpb_address_path : 70,
391
- isc_dpb_process_id : 71,
392
- isc_dpb_no_db_triggers : 72,
393
- isc_dpb_trusted_auth : 73,
394
- isc_dpb_process_name : 74,
395
- isc_dpb_trusted_role : 75,
396
- isc_dpb_org_filename : 76,
397
- isc_dpb_utf8_filename : 77,
398
- isc_dpb_ext_call_depth : 78,
399
- isc_dpb_auth_block : 79,
400
- isc_dpb_client_version : 80,
401
- isc_dpb_remote_protocol : 81,
402
- isc_dpb_host_name : 82,
403
- isc_dpb_os_user : 83,
404
- isc_dpb_specific_auth_data : 84,
405
- isc_dpb_auth_plugin_list : 85,
406
- isc_dpb_auth_plugin_name : 86,
407
- isc_dpb_config : 87,
408
- isc_dpb_nolinger : 88,
409
- isc_dpb_reset_icu : 89,
410
- isc_dpb_map_attach : 90,
411
- isc_dpb_session_time_zone : 91,
412
- };
413
-
320
+ isc_dpb_version1: 1,
321
+ isc_dpb_version2: 2, // >: FB30
322
+ isc_dpb_cdd_pathname: 1,
323
+ isc_dpb_allocation: 2,
324
+ isc_dpb_journal: 3,
325
+ isc_dpb_page_size: 4,
326
+ isc_dpb_num_buffers: 5,
327
+ isc_dpb_buffer_length: 6,
328
+ isc_dpb_debug: 7,
329
+ isc_dpb_garbage_collect: 8,
330
+ isc_dpb_verify: 9,
331
+ isc_dpb_sweep: 10,
332
+ isc_dpb_enable_journal: 11,
333
+ isc_dpb_disable_journal: 12,
334
+ isc_dpb_dbkey_scope: 13,
335
+ isc_dpb_number_of_users: 14,
336
+ isc_dpb_trace: 15,
337
+ isc_dpb_no_garbage_collect: 16,
338
+ isc_dpb_damaged: 17,
339
+ isc_dpb_license: 18,
340
+ isc_dpb_sys_user_name: 19,
341
+ isc_dpb_encrypt_key: 20,
342
+ isc_dpb_activate_shadow: 21,
343
+ isc_dpb_sweep_interval: 22,
344
+ isc_dpb_delete_shadow: 23,
345
+ isc_dpb_force_write: 24,
346
+ isc_dpb_begin_log: 25,
347
+ isc_dpb_quit_log: 26,
348
+ isc_dpb_no_reserve: 27,
349
+ isc_dpb_user_name: 28,
350
+ isc_dpb_password: 29,
351
+ isc_dpb_password_enc: 30,
352
+ isc_dpb_sys_user_name_enc: 31,
353
+ isc_dpb_interp: 32,
354
+ isc_dpb_online_dump: 33,
355
+ isc_dpb_old_file_size: 34,
356
+ isc_dpb_old_num_files: 35,
357
+ isc_dpb_old_file: 36,
358
+ isc_dpb_old_start_page: 37,
359
+ isc_dpb_old_start_seqno: 38,
360
+ isc_dpb_old_start_file: 39,
361
+ isc_dpb_old_dump_id: 41,
362
+ isc_dpb_lc_messages: 47,
363
+ isc_dpb_lc_ctype: 48,
364
+ isc_dpb_cache_manager: 49,
365
+ isc_dpb_shutdown: 50,
366
+ isc_dpb_online: 51,
367
+ isc_dpb_shutdown_delay: 52,
368
+ isc_dpb_reserved: 53,
369
+ isc_dpb_overwrite: 54,
370
+ isc_dpb_sec_attach: 55,
371
+ isc_dpb_connect_timeout: 57,
372
+ isc_dpb_dummy_packet_interval: 58,
373
+ isc_dpb_gbak_attach: 59,
374
+ isc_dpb_sql_role_name: 60,
375
+ isc_dpb_set_page_buffers: 61,
376
+ isc_dpb_working_directory: 62,
377
+ isc_dpb_sql_dialect: 63,
378
+ isc_dpb_set_db_readonly: 64,
379
+ isc_dpb_set_db_sql_dialect: 65,
380
+ isc_dpb_gfix_attach: 66,
381
+ isc_dpb_gstat_attach: 67,
382
+ isc_dpb_set_db_charset: 68,
383
+ isc_dpb_gsec_attach: 69,
384
+ isc_dpb_address_path: 70,
385
+ isc_dpb_process_id: 71,
386
+ isc_dpb_no_db_triggers: 72,
387
+ isc_dpb_trusted_auth: 73,
388
+ isc_dpb_process_name: 74,
389
+ isc_dpb_trusted_role: 75,
390
+ isc_dpb_org_filename: 76,
391
+ isc_dpb_utf8_filename: 77,
392
+ isc_dpb_ext_call_depth: 78,
393
+ isc_dpb_auth_block: 79,
394
+ isc_dpb_client_version: 80,
395
+ isc_dpb_remote_protocol: 81,
396
+ isc_dpb_host_name: 82,
397
+ isc_dpb_os_user: 83,
398
+ isc_dpb_specific_auth_data: 84,
399
+ isc_dpb_auth_plugin_list: 85,
400
+ isc_dpb_auth_plugin_name: 86,
401
+ isc_dpb_config: 87,
402
+ isc_dpb_nolinger: 88,
403
+ isc_dpb_reset_icu: 89,
404
+ isc_dpb_map_attach: 90,
405
+ isc_dpb_session_time_zone: 91,
406
+ isc_dpb_parallel_workers: 92,
407
+ isc_dpb_max_inline_blob_size: 93,
408
+ // Firebird 6.0 SQL Schema parameters
409
+ // isc_dpb_search_path sets the comma-separated ordered list of schema
410
+ // names to search for unqualified object names (similar to PostgreSQL
411
+ // search_path). Available on Protocol 20+ (Firebird 6.0).
412
+ isc_dpb_search_path: 94,
413
+ // isc_dpb_default_schema overrides the session's current schema
414
+ // (CURRENT_SCHEMA) at connection time. Available on Protocol 20+.
415
+ isc_dpb_default_schema: 95,
416
+ };
414
417
  const cnct = {
415
- CNCT_user : 1, // User name
416
- CNCT_passwd : 2,
418
+ CNCT_user: 1, // User name
419
+ CNCT_passwd: 2,
417
420
  // CNCT_ppo : 3, // Apollo person, project, organization. OBSOLETE.
418
- CNCT_host : 4,
419
- CNCT_group : 5, // Effective Unix group id
420
- CNCT_user_verification : 6, // Attach/create using this connection will use user verification
421
- CNCT_specific_data : 7, // Some data, needed for user verification on server
422
- CNCT_plugin_name : 8, // Name of plugin, which generated that data
423
- CNCT_login : 9, // Same data as isc_dpb_user_name
424
- CNCT_plugin_list : 10, // List of plugins, available on client
425
- CNCT_client_crypt : 11, // Client encyption level (DISABLED/ENABLED/REQUIRED)
426
- WIRE_CRYPT_DISABLED : 0,
427
- WIRE_CRYPT_ENABLED : 1,
428
- WIRE_CRYPT_REQUIRED : 2,
429
- };
430
-
421
+ CNCT_host: 4,
422
+ CNCT_group: 5, // Effective Unix group id
423
+ CNCT_user_verification: 6, // Attach/create using this connection will use user verification
424
+ CNCT_specific_data: 7, // Some data, needed for user verification on server
425
+ CNCT_plugin_name: 8, // Name of plugin, which generated that data
426
+ CNCT_login: 9, // Same data as isc_dpb_user_name
427
+ CNCT_plugin_list: 10, // List of plugins, available on client
428
+ CNCT_client_crypt: 11, // Client encyption level (DISABLED/ENABLED/REQUIRED)
429
+ WIRE_CRYPT_DISABLED: 0,
430
+ WIRE_CRYPT_ENABLED: 1,
431
+ WIRE_CRYPT_REQUIRED: 2,
432
+ };
431
433
  /****************************/
432
434
  /* Common, structural codes */
433
435
  /****************************/
434
436
  const common = {
435
- isc_info_end : 1,
436
- isc_info_truncated : 2,
437
- isc_info_error : 3,
438
- isc_info_data_not_ready : 4,
439
- isc_info_length : 126,
440
- isc_info_flag_end : 127,
441
- };
442
-
437
+ isc_info_end: 1,
438
+ isc_info_truncated: 2,
439
+ isc_info_error: 3,
440
+ isc_info_data_not_ready: 4,
441
+ isc_info_length: 126,
442
+ isc_info_flag_end: 127,
443
+ fb_info_parallel_workers: 149,
444
+ };
443
445
  /*************************************/
444
446
  /* Transaction parameter block stuff */
445
447
  /*************************************/
446
448
  const tpb = {
447
- isc_tpb_version1 : 1,
448
- isc_tpb_version3 : 3,
449
- isc_tpb_consistency : 1,
450
- isc_tpb_concurrency : 2,
451
- isc_tpb_shared : 3, // < FB21
452
- isc_tpb_protected : 4, // < FB21
453
- isc_tpb_exclusive : 5, // < FB21
454
- isc_tpb_wait : 6,
455
- isc_tpb_nowait : 7,
456
- isc_tpb_read : 8,
457
- isc_tpb_write : 9,
458
- isc_tpb_lock_read : 10,
459
- isc_tpb_lock_write : 11,
460
- isc_tpb_verb_time : 12,
461
- isc_tpb_commit_time : 13,
462
- isc_tpb_ignore_limbo : 14,
463
- isc_tpb_read_committed : 15,
464
- isc_tpb_autocommit : 16,
465
- isc_tpb_rec_version : 17,
466
- isc_tpb_no_rec_version : 18,
467
- isc_tpb_restart_requests : 19,
468
- isc_tpb_no_auto_undo : 20,
469
- isc_tpb_lock_timeout : 21, // >= FB20
470
- };
471
-
449
+ isc_tpb_version1: 1,
450
+ isc_tpb_version3: 3,
451
+ isc_tpb_consistency: 1,
452
+ isc_tpb_concurrency: 2,
453
+ isc_tpb_shared: 3, // < FB21
454
+ isc_tpb_protected: 4, // < FB21
455
+ isc_tpb_exclusive: 5, // < FB21
456
+ isc_tpb_wait: 6,
457
+ isc_tpb_nowait: 7,
458
+ isc_tpb_read: 8,
459
+ isc_tpb_write: 9,
460
+ isc_tpb_lock_read: 10,
461
+ isc_tpb_lock_write: 11,
462
+ isc_tpb_verb_time: 12,
463
+ isc_tpb_commit_time: 13,
464
+ isc_tpb_ignore_limbo: 14,
465
+ isc_tpb_read_committed: 15,
466
+ isc_tpb_autocommit: 16,
467
+ isc_tpb_rec_version: 17,
468
+ isc_tpb_no_rec_version: 18,
469
+ isc_tpb_restart_requests: 19,
470
+ isc_tpb_no_auto_undo: 20,
471
+ isc_tpb_lock_timeout: 21, // >= FB20
472
+ };
472
473
  const transactionIsolation = {
473
- ISOLATION_READ_UNCOMMITTED : [tpb.isc_tpb_read_committed, tpb.isc_tpb_rec_version],
474
- ISOLATION_READ_COMMITTED : [tpb.isc_tpb_read_committed, tpb.isc_tpb_no_rec_version],
475
- ISOLATION_REPEATABLE_READ : [tpb.isc_tpb_concurrency],
476
- ISOLATION_SERIALIZABLE : [tpb.isc_tpb_consistency],
477
- ISOLATION_READ_COMMITTED_READ_ONLY : [tpb.isc_tpb_read_committed, tpb.isc_tpb_no_rec_version],
474
+ ISOLATION_READ_UNCOMMITTED: [tpb.isc_tpb_read_committed, tpb.isc_tpb_rec_version],
475
+ ISOLATION_READ_COMMITTED: [tpb.isc_tpb_read_committed, tpb.isc_tpb_no_rec_version],
476
+ ISOLATION_REPEATABLE_READ: [tpb.isc_tpb_concurrency],
477
+ ISOLATION_SERIALIZABLE: [tpb.isc_tpb_consistency],
478
+ ISOLATION_READ_COMMITTED_READ_ONLY: [tpb.isc_tpb_read_committed, tpb.isc_tpb_no_rec_version],
478
479
  };
479
-
480
480
  /*************************/
481
481
  /* SQL information items */
482
482
  /*************************/
483
483
  const sqlInfo = {
484
- isc_info_sql_select : 4,
485
- isc_info_sql_bind : 5,
486
- isc_info_sql_num_variables : 6,
487
- isc_info_sql_describe_vars : 7,
488
- isc_info_sql_describe_end : 8,
489
- isc_info_sql_sqlda_seq : 9,
490
- isc_info_sql_message_seq : 10,
491
- isc_info_sql_type : 11,
492
- isc_info_sql_sub_type : 12,
493
- isc_info_sql_scale : 13,
494
- isc_info_sql_length : 14,
495
- isc_info_sql_null_ind : 15,
496
- isc_info_sql_field : 16,
497
- isc_info_sql_relation : 17,
498
- isc_info_sql_owner : 18,
499
- isc_info_sql_alias : 19,
500
- isc_info_sql_sqlda_start : 20,
501
- isc_info_sql_stmt_type : 21,
502
- isc_info_sql_get_plan : 22,
503
- isc_info_sql_records : 23,
504
- isc_info_sql_batch_fetch : 24,
505
- isc_info_sql_relation_alias : 25, // >: 2.0
506
- isc_info_sql_explain_plan : 26, // >= 3.0
507
- };
508
-
484
+ isc_info_sql_select: 4,
485
+ isc_info_sql_bind: 5,
486
+ isc_info_sql_num_variables: 6,
487
+ isc_info_sql_describe_vars: 7,
488
+ isc_info_sql_describe_end: 8,
489
+ isc_info_sql_sqlda_seq: 9,
490
+ isc_info_sql_message_seq: 10,
491
+ isc_info_sql_type: 11,
492
+ isc_info_sql_sub_type: 12,
493
+ isc_info_sql_scale: 13,
494
+ isc_info_sql_length: 14,
495
+ isc_info_sql_null_ind: 15,
496
+ isc_info_sql_field: 16,
497
+ isc_info_sql_relation: 17,
498
+ isc_info_sql_owner: 18,
499
+ isc_info_sql_alias: 19,
500
+ isc_info_sql_sqlda_start: 20,
501
+ isc_info_sql_stmt_type: 21,
502
+ isc_info_sql_get_plan: 22,
503
+ isc_info_sql_records: 23,
504
+ isc_info_sql_batch_fetch: 24,
505
+ isc_info_sql_relation_alias: 25, // >: 2.0
506
+ isc_info_sql_explain_plan: 26, // >= 3.0
507
+ // Firebird 6.0 (Protocol 20): schema name of the source relation for a
508
+ // result-set column. The server only sends this item when the column is
509
+ // drawn from a named schema (i.e. not the legacy PUBLIC or unqualified).
510
+ isc_info_sql_relation_schema: 33,
511
+ };
509
512
  const statementInfo = {
510
- isc_info_sql_stmt_select : 1,
511
- isc_info_sql_stmt_insert : 2,
512
- isc_info_sql_stmt_update : 3,
513
- isc_info_sql_stmt_delete : 4,
514
- isc_info_sql_stmt_ddl : 5,
515
- isc_info_sql_stmt_get_segment : 6,
516
- isc_info_sql_stmt_put_segment : 7,
517
- isc_info_sql_stmt_exec_procedure : 8,
518
- isc_info_sql_stmt_start_trans : 9,
519
- isc_info_sql_stmt_commit : 10,
520
- isc_info_sql_stmt_rollback : 11,
521
- isc_info_sql_stmt_select_for_upd : 12,
522
- isc_info_sql_stmt_set_generator : 13,
523
- isc_info_sql_stmt_savepoint : 14,
524
- };
525
-
513
+ isc_info_sql_stmt_select: 1,
514
+ isc_info_sql_stmt_insert: 2,
515
+ isc_info_sql_stmt_update: 3,
516
+ isc_info_sql_stmt_delete: 4,
517
+ isc_info_sql_stmt_ddl: 5,
518
+ isc_info_sql_stmt_get_segment: 6,
519
+ isc_info_sql_stmt_put_segment: 7,
520
+ isc_info_sql_stmt_exec_procedure: 8,
521
+ isc_info_sql_stmt_start_trans: 9,
522
+ isc_info_sql_stmt_commit: 10,
523
+ isc_info_sql_stmt_rollback: 11,
524
+ isc_info_sql_stmt_select_for_upd: 12,
525
+ isc_info_sql_stmt_set_generator: 13,
526
+ isc_info_sql_stmt_savepoint: 14,
527
+ };
528
+ // Standard DESCRIBE request (Protocols 10–19). Sent in op_prepare_statement
529
+ // to ask the server for result-set and input column metadata.
526
530
  const DESCRIBE = [
527
531
  sqlInfo.isc_info_sql_stmt_type,
528
532
  sqlInfo.isc_info_sql_select,
@@ -546,75 +550,94 @@ const DESCRIBE = [
546
550
  sqlInfo.isc_info_sql_length,
547
551
  sqlInfo.isc_info_sql_describe_end
548
552
  ];
549
-
553
+ // Extended DESCRIBE request for Protocol 20+ (Firebird 6.0).
554
+ // Adds isc_info_sql_relation_schema to capture the schema name alongside the
555
+ // relation name for each output column.
556
+ const DESCRIBE_WITH_SCHEMA = [
557
+ sqlInfo.isc_info_sql_stmt_type,
558
+ sqlInfo.isc_info_sql_select,
559
+ sqlInfo.isc_info_sql_describe_vars,
560
+ sqlInfo.isc_info_sql_sqlda_seq,
561
+ sqlInfo.isc_info_sql_type,
562
+ sqlInfo.isc_info_sql_sub_type,
563
+ sqlInfo.isc_info_sql_scale,
564
+ sqlInfo.isc_info_sql_length,
565
+ sqlInfo.isc_info_sql_field,
566
+ sqlInfo.isc_info_sql_relation,
567
+ sqlInfo.isc_info_sql_relation_schema, // FB 6.0: schema of source relation
568
+ //isc_info_sql_owner,
569
+ sqlInfo.isc_info_sql_alias,
570
+ sqlInfo.isc_info_sql_describe_end,
571
+ sqlInfo.isc_info_sql_bind,
572
+ sqlInfo.isc_info_sql_describe_vars,
573
+ sqlInfo.isc_info_sql_sqlda_seq,
574
+ sqlInfo.isc_info_sql_type,
575
+ sqlInfo.isc_info_sql_sub_type,
576
+ sqlInfo.isc_info_sql_scale,
577
+ sqlInfo.isc_info_sql_length,
578
+ sqlInfo.isc_info_sql_describe_end
579
+ ];
550
580
  /***********************/
551
581
  /* ISC Services */
552
582
  /***********************/
553
583
  const iscAction = {
554
- isc_action_svc_backup : 1, /* Starts database backup process on the server */
555
- isc_action_svc_restore : 2, /* Starts database restore process on the server */
556
- isc_action_svc_repair : 3, /* Starts database repair process on the server */
557
- isc_action_svc_add_user : 4, /* Adds a new user to the security database */
558
- isc_action_svc_delete_user : 5, /* Deletes a user record from the security database */
559
- isc_action_svc_modify_user : 6, /* Modifies a user record in the security database */
560
- isc_action_svc_display_user : 7, /* Displays a user record from the security database */
561
- isc_action_svc_properties : 8, /* Sets database properties */
562
- isc_action_svc_add_license : 9, /* Adds a license to the license file */
563
- isc_action_svc_remove_license : 10, /* Removes a license from the license file */
564
- isc_action_svc_db_stats : 11, /* Retrieves database statistics */
565
- isc_action_svc_get_ib_log : 12, /* Retrieves the InterBase log file from the server */
566
- isc_action_svc_get_fb_log : 12, // isc_action_svc_get_ib_log, /* Retrieves the Firebird log file from the server */
567
- isc_action_svc_nbak : 20, /* start nbackup */
568
- isc_action_svc_nrest : 21, /* start nrestore */
569
- isc_action_svc_trace_start : 22,
570
- isc_action_svc_trace_stop : 23,
571
- isc_action_svc_trace_suspend : 24,
572
- isc_action_svc_trace_resume : 25,
573
- isc_action_svc_trace_list : 26,
574
- };
575
-
584
+ isc_action_svc_backup: 1, /* Starts database backup process on the server */
585
+ isc_action_svc_restore: 2, /* Starts database restore process on the server */
586
+ isc_action_svc_repair: 3, /* Starts database repair process on the server */
587
+ isc_action_svc_add_user: 4, /* Adds a new user to the security database */
588
+ isc_action_svc_delete_user: 5, /* Deletes a user record from the security database */
589
+ isc_action_svc_modify_user: 6, /* Modifies a user record in the security database */
590
+ isc_action_svc_display_user: 7, /* Displays a user record from the security database */
591
+ isc_action_svc_properties: 8, /* Sets database properties */
592
+ isc_action_svc_add_license: 9, /* Adds a license to the license file */
593
+ isc_action_svc_remove_license: 10, /* Removes a license from the license file */
594
+ isc_action_svc_db_stats: 11, /* Retrieves database statistics */
595
+ isc_action_svc_get_ib_log: 12, /* Retrieves the InterBase log file from the server */
596
+ isc_action_svc_get_fb_log: 12, // isc_action_svc_get_ib_log, /* Retrieves the Firebird log file from the server */
597
+ isc_action_svc_nbak: 20, /* start nbackup */
598
+ isc_action_svc_nrest: 21, /* start nrestore */
599
+ isc_action_svc_trace_start: 22,
600
+ isc_action_svc_trace_stop: 23,
601
+ isc_action_svc_trace_suspend: 24,
602
+ isc_action_svc_trace_resume: 25,
603
+ isc_action_svc_trace_list: 26,
604
+ };
576
605
  /* Services Properties */
577
606
  const service = {
578
- isc_spb_prp_page_buffers : 5,
579
- isc_spb_prp_sweep_interval : 6,
580
- isc_spb_prp_shutdown_db : 7,
581
- isc_spb_prp_deny_new_attachments : 9,
582
- isc_spb_prp_deny_new_transactions : 10,
583
- isc_spb_prp_reserve_space : 11,
584
- isc_spb_prp_write_mode : 12,
585
- isc_spb_prp_access_mode : 13,
586
- isc_spb_prp_set_sql_dialect : 14,
587
- isc_spb_num_att : 5,
588
- isc_spb_num_db : 6,
607
+ isc_spb_prp_page_buffers: 5,
608
+ isc_spb_prp_sweep_interval: 6,
609
+ isc_spb_prp_shutdown_db: 7,
610
+ isc_spb_prp_deny_new_attachments: 9,
611
+ isc_spb_prp_deny_new_transactions: 10,
612
+ isc_spb_prp_reserve_space: 11,
613
+ isc_spb_prp_write_mode: 12,
614
+ isc_spb_prp_access_mode: 13,
615
+ isc_spb_prp_set_sql_dialect: 14,
616
+ isc_spb_num_att: 5,
617
+ isc_spb_num_db: 6,
589
618
  // SHUTDOWN OPTION FOR 2.0
590
- isc_spb_prp_force_shutdown : 41,
591
- isc_spb_prp_attachments_shutdown : 42,
592
- isc_spb_prp_transactions_shutdown : 43,
593
- isc_spb_prp_shutdown_mode : 44,
594
- isc_spb_prp_online_mode : 45,
595
-
596
- isc_spb_prp_sm_normal : 0,
597
- isc_spb_prp_sm_multi : 1,
598
- isc_spb_prp_sm_single : 2,
599
- isc_spb_prp_sm_full : 3,
600
-
619
+ isc_spb_prp_force_shutdown: 41,
620
+ isc_spb_prp_attachments_shutdown: 42,
621
+ isc_spb_prp_transactions_shutdown: 43,
622
+ isc_spb_prp_shutdown_mode: 44,
623
+ isc_spb_prp_online_mode: 45,
624
+ isc_spb_prp_sm_normal: 0,
625
+ isc_spb_prp_sm_multi: 1,
626
+ isc_spb_prp_sm_single: 2,
627
+ isc_spb_prp_sm_full: 3,
601
628
  // WRITE_MODE_PARAMETERS
602
- isc_spb_prp_wm_async : 37,
603
- isc_spb_prp_wm_sync : 38,
604
-
629
+ isc_spb_prp_wm_async: 37,
630
+ isc_spb_prp_wm_sync: 38,
605
631
  // ACCESS_MODE_PARAMETERS
606
- isc_spb_prp_am_readonly : 39,
607
- isc_spb_prp_am_readwrite : 40,
608
-
632
+ isc_spb_prp_am_readonly: 39,
633
+ isc_spb_prp_am_readwrite: 40,
609
634
  // RESERVE_SPACE_PARAMETERS
610
- isc_spb_prp_res_use_full : 35,
611
- isc_spb_prp_res : 36,
612
-
635
+ isc_spb_prp_res_use_full: 35,
636
+ isc_spb_prp_res: 36,
613
637
  // Option Flags
614
- isc_spb_prp_activate : 0x0100,
615
- isc_spb_prp_db_online : 0x0200,
638
+ isc_spb_prp_activate: 0x0100,
639
+ isc_spb_prp_db_online: 0x0200,
616
640
  };
617
-
618
641
  /****************************/
619
642
  /* Service info */
620
643
  /****************************/
@@ -640,136 +663,131 @@ const serviceInfo = {
640
663
  isc_info_svc_get_users: 68, /* Returns the user information from isc_action_svc_display_users */
641
664
  isc_info_svc_stdin: 78,
642
665
  };
643
-
644
666
  /*************************************/
645
667
  /* Services parameter block stuff */
646
668
  /*************************************/
647
669
  const spb = {
648
- isc_spb_version1 : 1,
649
- isc_spb_current_version : 2,
650
- isc_spb_version : 2, // isc_spb_current_version,
651
- isc_spb_user_name : dpb.isc_dpb_user_name,
652
- isc_spb_sys_user_name : dpb.isc_dpb_sys_user_name,
653
- isc_spb_sys_user_name_enc : dpb.isc_dpb_sys_user_name_enc,
654
- isc_spb_password : dpb.isc_dpb_password,
655
- isc_spb_password_enc : dpb.isc_dpb_password_enc,
656
- isc_spb_command_line : 105,
657
- isc_spb_dbname : 106,
658
- isc_spb_verbose : 107,
659
- isc_spb_options : 108,
660
- };
661
-
670
+ isc_spb_version1: 1,
671
+ isc_spb_current_version: 2,
672
+ isc_spb_version: 2, // isc_spb_current_version,
673
+ isc_spb_user_name: dpb.isc_dpb_user_name,
674
+ isc_spb_sys_user_name: dpb.isc_dpb_sys_user_name,
675
+ isc_spb_sys_user_name_enc: dpb.isc_dpb_sys_user_name_enc,
676
+ isc_spb_password: dpb.isc_dpb_password,
677
+ isc_spb_password_enc: dpb.isc_dpb_password_enc,
678
+ isc_spb_command_line: 105,
679
+ isc_spb_dbname: 106,
680
+ isc_spb_verbose: 107,
681
+ isc_spb_options: 108,
682
+ };
662
683
  /* · Backup Service ·*/
663
684
  const serviceBackup = {
664
- isc_spb_bkp_file : 5,
665
- isc_spb_bkp_factor : 6,
666
- isc_spb_bkp_length : 7,
667
- isc_spb_bkp_ignore_checksums : 0x01,
668
- isc_spb_bkp_ignore_limbo : 0x02,
669
- isc_spb_bkp_metadata_only : 0x04,
670
- isc_spb_bkp_no_garbage_collect : 0x08,
671
- isc_spb_bkp_old_descriptions : 0x10,
672
- isc_spb_bkp_non_transportable : 0x20,
673
- isc_spb_bkp_convert : 0x40,
674
- isc_spb_bkp_expand : 0x80,
675
- isc_spb_bkp_no_triggers : 0x8000,
685
+ isc_spb_bkp_file: 5,
686
+ isc_spb_bkp_factor: 6,
687
+ isc_spb_bkp_length: 7,
688
+ isc_spb_bkp_ignore_checksums: 0x01,
689
+ isc_spb_bkp_ignore_limbo: 0x02,
690
+ isc_spb_bkp_metadata_only: 0x04,
691
+ isc_spb_bkp_no_garbage_collect: 0x08,
692
+ isc_spb_bkp_old_descriptions: 0x10,
693
+ isc_spb_bkp_non_transportable: 0x20,
694
+ isc_spb_bkp_convert: 0x40,
695
+ isc_spb_bkp_expand: 0x80,
696
+ isc_spb_bkp_no_triggers: 0x8000,
697
+ isc_spb_bkp_parallel_workers: 21,
676
698
  // nbackup
677
- isc_spb_nbk_level : 5,
678
- isc_spb_nbk_file : 6,
679
- isc_spb_nbk_direct : 7,
680
- isc_spb_nbk_no_triggers : 0x01,
699
+ isc_spb_nbk_level: 5,
700
+ isc_spb_nbk_file: 6,
701
+ isc_spb_nbk_direct: 7,
702
+ isc_spb_nbk_no_triggers: 0x01,
681
703
  };
682
-
683
704
  /* Restore Service ·*/
684
705
  const serviceRestore = {
685
- isc_spb_res_buffers : 9,
686
- isc_spb_res_page_size : 10,
687
- isc_spb_res_length : 11,
688
- isc_spb_res_access_mode : 12,
689
- isc_spb_res_fix_fss_data : 13,
690
- isc_spb_res_fix_fss_metadata : 14,
691
- isc_spb_res_am_readonly : service.isc_spb_prp_am_readonly,
692
- isc_spb_res_am_readwrite : service.isc_spb_prp_am_readwrite,
693
- isc_spb_res_deactivate_idx : 0x0100,
694
- isc_spb_res_no_shadow : 0x0200,
695
- isc_spb_res_no_validity : 0x0400,
696
- isc_spb_res_one_at_a_time : 0x0800,
697
- isc_spb_res_replace : 0x1000,
698
- isc_spb_res_create : 0x2000,
699
- isc_spb_res_use_all_space : 0x4000,
700
- };
701
-
706
+ isc_spb_res_buffers: 9,
707
+ isc_spb_res_page_size: 10,
708
+ isc_spb_res_length: 11,
709
+ isc_spb_res_access_mode: 12,
710
+ isc_spb_res_parallel_workers: 21,
711
+ isc_spb_res_fix_fss_data: 13,
712
+ isc_spb_res_fix_fss_metadata: 14,
713
+ isc_spb_res_am_readonly: service.isc_spb_prp_am_readonly,
714
+ isc_spb_res_am_readwrite: service.isc_spb_prp_am_readwrite,
715
+ isc_spb_res_deactivate_idx: 0x0100,
716
+ isc_spb_res_no_shadow: 0x0200,
717
+ isc_spb_res_no_validity: 0x0400,
718
+ isc_spb_res_one_at_a_time: 0x0800,
719
+ isc_spb_res_replace: 0x1000,
720
+ isc_spb_res_create: 0x2000,
721
+ isc_spb_res_use_all_space: 0x4000,
722
+ };
702
723
  /* · Repair Service ·*/
703
724
  const serviceRepair = {
704
- isc_spb_rpr_commit_trans : 15,
705
- isc_spb_rpr_rollback_trans : 34,
706
- isc_spb_rpr_recover_two_phase : 17,
707
- isc_spb_tra_id : 18,
708
- isc_spb_single_tra_id : 19,
709
- isc_spb_multi_tra_id : 20,
710
- isc_spb_tra_state : 21,
711
- isc_spb_tra_state_limbo : 22,
712
- isc_spb_tra_state_commit : 23,
713
- isc_spb_tra_state_rollback : 24,
714
- isc_spb_tra_state_unknown : 25,
715
- isc_spb_tra_host_site : 26,
716
- isc_spb_tra_remote_site : 27,
717
- isc_spb_tra_db_path : 28,
718
- isc_spb_tra_advise : 29,
719
- isc_spb_tra_advise_commit : 30,
720
- isc_spb_tra_advise_rollback : 31,
721
- isc_spb_tra_advise_unknown : 33,
722
- isc_spb_rpr_validate_db : 0x01,
723
- isc_spb_rpr_sweep_db : 0x02,
724
- isc_spb_rpr_mend_db : 0x04,
725
- isc_spb_rpr_list_limbo_trans : 0x08,
726
- isc_spb_rpr_check_db : 0x10,
727
- isc_spb_rpr_ignore_checksum : 0x20,
728
- isc_spb_rpr_kill_shadows : 0x40,
729
- isc_spb_rpr_full : 0x80,
730
- isc_spb_rpr_icu : 0x0800,
731
- };
732
-
725
+ isc_spb_rpr_commit_trans: 15,
726
+ isc_spb_rpr_rollback_trans: 34,
727
+ isc_spb_rpr_recover_two_phase: 17,
728
+ isc_spb_tra_id: 18,
729
+ isc_spb_single_tra_id: 19,
730
+ isc_spb_multi_tra_id: 20,
731
+ isc_spb_tra_state: 21,
732
+ isc_spb_tra_state_limbo: 22,
733
+ isc_spb_tra_state_commit: 23,
734
+ isc_spb_tra_state_rollback: 24,
735
+ isc_spb_tra_state_unknown: 25,
736
+ isc_spb_tra_host_site: 26,
737
+ isc_spb_tra_remote_site: 27,
738
+ isc_spb_tra_db_path: 28,
739
+ isc_spb_tra_advise: 29,
740
+ isc_spb_tra_advise_commit: 30,
741
+ isc_spb_tra_advise_rollback: 31,
742
+ isc_spb_tra_advise_unknown: 33,
743
+ isc_spb_rpr_validate_db: 0x01,
744
+ isc_spb_rpr_sweep_db: 0x02,
745
+ isc_spb_rpr_mend_db: 0x04,
746
+ isc_spb_rpr_list_limbo_trans: 0x08,
747
+ isc_spb_rpr_check_db: 0x10,
748
+ isc_spb_rpr_ignore_checksum: 0x20,
749
+ isc_spb_rpr_kill_shadows: 0x40,
750
+ isc_spb_rpr_full: 0x80,
751
+ isc_spb_rpr_icu: 0x0800,
752
+ isc_spb_rpr_par_workers: 52,
753
+ };
733
754
  /* · Security Service ·*/
734
755
  const serviceSecurity = {
735
- isc_spb_sec_userid : 5,
736
- isc_spb_sec_groupid : 6,
737
- isc_spb_sec_username : 7,
738
- isc_spb_sec_password : 8,
739
- isc_spb_sec_groupname : 9,
740
- isc_spb_sec_firstname : 10,
741
- isc_spb_sec_middlename : 11,
742
- isc_spb_sec_lastname : 12,
743
- isc_spb_sec_admin : 13,
744
- };
745
-
756
+ isc_spb_sec_userid: 5,
757
+ isc_spb_sec_groupid: 6,
758
+ isc_spb_sec_username: 7,
759
+ isc_spb_sec_password: 8,
760
+ isc_spb_sec_groupname: 9,
761
+ isc_spb_sec_firstname: 10,
762
+ isc_spb_sec_middlename: 11,
763
+ isc_spb_sec_lastname: 12,
764
+ isc_spb_sec_admin: 13,
765
+ };
746
766
  /* License Service */
747
767
  const serviceLicence = {
748
- isc_spb_lic_key : 5,
749
- isc_spb_lic_id : 6,
750
- isc_spb_lic_desc : 7,
768
+ isc_spb_lic_key: 5,
769
+ isc_spb_lic_id: 6,
770
+ isc_spb_lic_desc: 7,
751
771
  };
752
-
753
772
  /* Statistics Service */
754
773
  const serviceStatistics = {
755
- isc_spb_sts_data_pages : 0x01,
756
- isc_spb_sts_db_log : 0x02,
757
- isc_spb_sts_hdr_pages : 0x04,
758
- isc_spb_sts_idx_pages : 0x08,
759
- isc_spb_sts_sys_relations : 0x10,
760
- isc_spb_sts_record_versions : 0x20,
761
- isc_spb_sts_table : 0x40,
762
- isc_spb_sts_nocreation : 0x80,
763
- };
764
-
774
+ isc_spb_sts_data_pages: 0x01,
775
+ isc_spb_sts_db_log: 0x02,
776
+ isc_spb_sts_hdr_pages: 0x04,
777
+ isc_spb_sts_idx_pages: 0x08,
778
+ isc_spb_sts_sys_relations: 0x10,
779
+ isc_spb_sts_record_versions: 0x20,
780
+ isc_spb_sts_table: 0x40,
781
+ isc_spb_sts_nocreation: 0x80,
782
+ isc_spb_sts_encryption: 0x100,
783
+ };
765
784
  /* Trace Service */
766
785
  const serviceTrace = {
767
- isc_spb_trc_id : 1,
768
- isc_spb_trc_name : 2,
769
- isc_spb_trc_cfg : 3,
786
+ isc_spb_trc_id: 1,
787
+ isc_spb_trc_name: 2,
788
+ isc_spb_trc_cfg: 3,
770
789
  };
771
-
772
- module.exports = Object.freeze({
790
+ const Const = Object.freeze({
773
791
  ...acceptType,
774
792
  ...authPlugin,
775
793
  ...authOptions,
@@ -781,8 +799,10 @@ module.exports = Object.freeze({
781
799
  ...connect,
782
800
  ...defaultOptions,
783
801
  DESCRIBE,
802
+ DESCRIBE_WITH_SCHEMA,
784
803
  ...dpb,
785
804
  ...dsql,
805
+ ...fetchOp,
786
806
  ...int,
787
807
  ...iscAction,
788
808
  ...iscError,
@@ -805,3 +825,4 @@ module.exports = Object.freeze({
805
825
  ...tpb,
806
826
  ...transactionIsolation,
807
827
  });
828
+ module.exports = Const;