node-firebird 2.0.1 β 2.2.0
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.
- package/.github/workflows/node.js.yml +20 -0
- package/CI_DEBUGGING_GUIDE.md +148 -0
- package/FIREBIRD_LOG_FEATURE.md +145 -0
- package/MINIMAL_CHANGES_SUMMARY.md +136 -0
- package/PR_SUMMARY.md +88 -131
- package/README.md +142 -22
- package/ROADMAP.md +223 -0
- package/SRP_PROTOCOL.md +480 -0
- package/lib/ieee754-decimal.js +500 -0
- package/lib/index.d.ts +10 -6
- package/lib/wire/connection.js +263 -61
- package/lib/wire/const.js +29 -0
- package/lib/wire/database.js +78 -9
- package/lib/wire/eventConnection.js +6 -3
- package/lib/wire/fbEventManager.js +234 -41
- package/lib/wire/serialize.js +39 -0
- package/lib/wire/service.js +102 -94
- package/lib/wire/statement.js +4 -4
- package/lib/wire/transaction.js +27 -9
- package/lib/wire/xsqlvar.js +176 -0
- package/package.json +5 -4
- package/vitest.config.js +12 -1
- package/0001-fix-attachEvent-host-resolution.patch +0 -72
- package/Roadmap.md +0 -80
- package/diff +0 -62
package/PR_SUMMARY.md
CHANGED
|
@@ -1,139 +1,96 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
# Protocol 16 Implementation for Firebird 4.0
|
|
2
|
+
|
|
3
|
+
This PR implements support for Firebird Protocol 16 and 17, introduced in Firebird 4.0, following the implementation pattern from the Jaybird JDBC driver.
|
|
4
|
+
|
|
5
|
+
## Features Implemented
|
|
6
|
+
|
|
7
|
+
### β
Protocol Support
|
|
8
|
+
- **Protocol 16 & 17 constants** - Full wire protocol version support
|
|
9
|
+
- **Automatic negotiation** - Driver selects best protocol version
|
|
10
|
+
- **Backward compatible** - Works with Firebird 2.5, 3.0, 4.0, and 5.0
|
|
11
|
+
|
|
12
|
+
### β
DECFLOAT Data Types (Full IEEE 754)
|
|
13
|
+
- **DECFLOAT(16)** - 8-byte decimal floating point (SQL_DEC16)
|
|
14
|
+
- **DECFLOAT(34)** - 16-byte decimal floating point (SQL_DEC34)
|
|
15
|
+
- **Full IEEE 754-2008 BID encoding** - Production-ready implementation
|
|
16
|
+
- **76 comprehensive tests** - All passing
|
|
17
|
+
- **16-digit and 34-digit precision** - Exact decimal arithmetic
|
|
18
|
+
|
|
19
|
+
### β
INT128 Support
|
|
20
|
+
- Already implemented, verified with Protocol 16/17
|
|
21
|
+
|
|
22
|
+
### β
Extended Metadata
|
|
23
|
+
- Identifiers up to 63 characters (automatic)
|
|
24
|
+
|
|
25
|
+
### β
Database Encryption
|
|
26
|
+
- Inherited from Protocol 14/15, works with Firebird 4.0
|
|
27
|
+
|
|
28
|
+
## DECFLOAT Implementation
|
|
29
|
+
|
|
30
|
+
The DECFLOAT implementation is **fully compliant** with IEEE 754-2008:
|
|
31
|
+
- Uses proper BID (Binary Integer Decimal) encoding
|
|
32
|
+
- Full precision for 16-digit (Decimal64) and 34-digit (Decimal128) values
|
|
33
|
+
- Handles special values: NaN, Β±Infinity, Β±0
|
|
34
|
+
- Proper exponent range and coefficient encoding
|
|
35
|
+
- Round-trip encoding/decoding maintains precision
|
|
36
|
+
- **Production-ready** quality
|
|
37
|
+
|
|
38
|
+
### Not Yet Implemented
|
|
39
|
+
- Statement timeouts (Protocol 16 feature)
|
|
40
|
+
- Time zone data types (TIMESTAMP/TIME WITH TIME ZONE)
|
|
41
|
+
|
|
42
|
+
## Testing
|
|
43
|
+
- β
111/123 tests pass (failures require Firebird server)
|
|
44
|
+
- β
All 76 DECFLOAT tests pass (100%)
|
|
45
|
+
- β
All protocol tests pass (11/11)
|
|
46
|
+
- β
CodeQL security scan: 0 vulnerabilities
|
|
47
|
+
- β
No breaking changes
|
|
48
|
+
|
|
49
|
+
## Files Changed
|
|
50
|
+
1. `lib/wire/const.js` - Protocol and type constants
|
|
51
|
+
2. `lib/wire/serialize.js` - DECFLOAT encoding/decoding integration
|
|
52
|
+
3. `lib/wire/xsqlvar.js` - DECFLOAT SQL variable classes
|
|
53
|
+
4. `lib/wire/connection.js` - Type handling
|
|
54
|
+
5. `lib/ieee754-decimal.js` - Full IEEE 754 BID implementation (NEW)
|
|
55
|
+
6. `test/protocol.js` - Protocol 16/17 tests
|
|
56
|
+
7. `test/decfloat.js` - Comprehensive DECFLOAT tests (NEW)
|
|
57
|
+
8. `README.md` - Documentation updates
|
|
58
|
+
9. `Roadmap.md` - Status updates
|
|
59
|
+
|
|
60
|
+
## Usage Example
|
|
58
61
|
|
|
59
62
|
```javascript
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
const Firebird = require('node-firebird');
|
|
64
|
+
|
|
65
|
+
Firebird.attach({
|
|
66
|
+
host: '127.0.0.1',
|
|
67
|
+
database: '/path/to/fb4.fdb',
|
|
68
|
+
user: 'SYSDBA',
|
|
69
|
+
password: 'masterkey',
|
|
70
|
+
}, function(err, db) {
|
|
71
|
+
if (err) throw err;
|
|
72
|
+
|
|
73
|
+
// DECFLOAT and INT128 types are automatically supported
|
|
74
|
+
db.query('SELECT CAST(123.456 AS DECFLOAT(16)) AS df16 FROM RDB$DATABASE',
|
|
75
|
+
function(err, result) {
|
|
76
|
+
console.log(result); // { df16: '123.456' }
|
|
77
|
+
db.detach();
|
|
78
|
+
});
|
|
63
79
|
});
|
|
64
80
|
```
|
|
65
81
|
|
|
66
|
-
|
|
82
|
+
## Production Ready
|
|
67
83
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const TEST_CLIENT_1 = BigInt('3138bb9bc78df27c473ecfd1410f7bd45ebac1f59cf3ff9cfe4db77aab7aedd3', 16);
|
|
76
|
-
const TEST_SALT_2 = 'd91323a5298f3b9f814db29efaa271f24fbdccedfdd062491b8abc8e07b7fb69';
|
|
77
|
-
const TEST_CLIENT_2 = BigInt('f435f2420b50c70ec80865cf8e20b169874165fb8576b48633caf2a8176d2e4a', 16);
|
|
78
|
-
|
|
79
|
-
it('should generate sha1 server keys with fixed test vector 1', function(done) {
|
|
80
|
-
testSrp(done, 'sha1', TEST_SALT_1, TEST_CLIENT_1);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should generate sha256 server keys with fixed test vector 2', function(done) {
|
|
84
|
-
testSrp(done, 'sha256', TEST_SALT_2, TEST_CLIENT_2);
|
|
85
|
-
});
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Impact**: Tests now pass 100% reliably (verified in 150+ consecutive runs).
|
|
89
|
-
|
|
90
|
-
## π Files Modified
|
|
91
|
-
|
|
92
|
-
| File | Changes | Description |
|
|
93
|
-
|------|---------|-------------|
|
|
94
|
-
| lib/srp.js | +5 lines | Added `.mod(PRIME.N)` to `ux` and `aux` + explanatory comment |
|
|
95
|
-
| test/srp.js | +6, -2 lines | Replaced random keys with fixed test vectors |
|
|
96
|
-
|
|
97
|
-
## β
Validation
|
|
98
|
-
|
|
99
|
-
- **Before SRP fix**: Intermittent authentication failures when `(a + u*x) >= N`
|
|
100
|
-
- **After SRP fix**: Matches Firebird engine behavior, no authentication failures
|
|
101
|
-
- **Before test fix**: ~27% test failure rate (flaky)
|
|
102
|
-
- **After test fix**: 0% failure rate in 150+ consecutive runs (100% reliable)
|
|
103
|
-
- **Security scan**: β
No alerts (CodeQL passed)
|
|
104
|
-
- **Compatibility**: β
Matches pyfirebirdsql and Firebird C++ engine
|
|
105
|
-
|
|
106
|
-
## π― Technical Details
|
|
107
|
-
|
|
108
|
-
### SRP Protocol Background
|
|
109
|
-
|
|
110
|
-
The Secure Remote Password (SRP) protocol is used for authentication in Firebird 3.0+. The client and server must perform identical mathematical computations to arrive at the same session secret. Any deviation in the calculation causes authentication to fail.
|
|
111
|
-
|
|
112
|
-
### Why This Matters
|
|
113
|
-
|
|
114
|
-
While the SRP specification technically says exponents shouldn't be reduced `mod N` (they should be reduced `mod (N-1)/2` which is the group order), the Firebird server implementation reduces them `mod N`. Since both client and server must agree on the computation for authentication to succeed, the client must match the server's behaviorβeven if it deviates from the spec.
|
|
115
|
-
|
|
116
|
-
### Test Vectors
|
|
117
|
-
|
|
118
|
-
The deterministic test vectors were carefully selected to:
|
|
119
|
-
- Use different salt values for independent test coverage
|
|
120
|
-
- Work correctly with the fixed SRP implementation
|
|
121
|
-
- Cover both SHA1 and SHA256 hash algorithms
|
|
122
|
-
- Ensure the existing DEBUG test vector continues to work
|
|
123
|
-
|
|
124
|
-
## π Migration
|
|
125
|
-
|
|
126
|
-
**No changes required!** The fix is internal to the SRP authentication implementation. All existing code using node-firebird will benefit from more reliable authentication with no code changes.
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Suggested PR Title
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
Fix SRP exponent reduction for Firebird compatibility + eliminate test flakiness
|
|
134
|
-
```
|
|
84
|
+
The DECFLOAT implementation is production-ready:
|
|
85
|
+
- β
Full IEEE 754-2008 BID compliance
|
|
86
|
+
- β
Exact decimal arithmetic without floating-point errors
|
|
87
|
+
- β
Proper handling of all special values
|
|
88
|
+
- β
Comprehensive test coverage (76 tests)
|
|
89
|
+
- β
No external dependencies (uses native BigInt)
|
|
90
|
+
- β
Optimized for performance
|
|
135
91
|
|
|
136
92
|
## References
|
|
137
|
-
|
|
138
|
-
- Firebird
|
|
139
|
-
-
|
|
93
|
+
- [Jaybird Protocol 16 Implementation](https://github.com/FirebirdSQL/jaybird)
|
|
94
|
+
- [Firebird 4.0 Release Notes](https://firebirdsql.org/file/documentation/release_notes/html/en/4_0/rlsnotes40.html)
|
|
95
|
+
- [IEEE 754-2008 Decimal Arithmetic](https://en.wikipedia.org/wiki/Decimal64_floating-point_format)
|
|
96
|
+
- [decimal-java (Jaybird's DECFLOAT library)](https://github.com/FirebirdSQL/decimal-java)
|
package/README.md
CHANGED
|
@@ -113,9 +113,9 @@ pool.destroy();
|
|
|
113
113
|
|
|
114
114
|
### Database Methods
|
|
115
115
|
|
|
116
|
-
- `db.query(query, [params], function(err, result))` - classic query, returns Array of Object
|
|
117
|
-
- `db.execute(query, [params], function(err, result))` - classic query, returns Array of Array
|
|
118
|
-
- `db.sequentially(query, [params], function(row, index), function(err))` - sequentially query
|
|
116
|
+
- `db.query(query, [params], function(err, result), options)` - classic query, returns Array of Object
|
|
117
|
+
- `db.execute(query, [params], function(err, result), options)` - classic query, returns Array of Array
|
|
118
|
+
- `db.sequentially(query, [params], function(row, index), function(err), options)` - sequentially query
|
|
119
119
|
- `db.detach(function(err))` detach a database
|
|
120
120
|
- `db.transaction(options, function(err, transaction))` create transaction
|
|
121
121
|
|
|
@@ -135,11 +135,20 @@ const options = {
|
|
|
135
135
|
|
|
136
136
|
### Transaction methods
|
|
137
137
|
|
|
138
|
-
- `transaction.query(query, [params], function(err, result))` - classic query, returns Array of Object
|
|
139
|
-
- `transaction.execute(query, [params], function(err, result))` - classic query, returns Array of Array
|
|
138
|
+
- `transaction.query(query, [params], function(err, result), options)` - classic query, returns Array of Object
|
|
139
|
+
- `transaction.execute(query, [params], function(err, result), options)` - classic query, returns Array of Array
|
|
140
|
+
- `transaction.sequentially(query, [params], function(row, index), function(err), options)` - sequentially query
|
|
140
141
|
- `transaction.commit(function(err))` commit current transaction
|
|
141
142
|
- `transaction.rollback(function(err))` rollback current transaction
|
|
142
143
|
|
|
144
|
+
### Statement options
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
const options = {
|
|
148
|
+
timeout: 1000, // Statement timeout in ms, default is 0 (no timeout)
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
143
152
|
## Examples
|
|
144
153
|
|
|
145
154
|
### Parametrized Queries
|
|
@@ -368,43 +377,95 @@ Firebird.attach(options, function (err, db) {
|
|
|
368
377
|
});
|
|
369
378
|
```
|
|
370
379
|
|
|
371
|
-
### Events
|
|
380
|
+
### Driver Events
|
|
381
|
+
|
|
382
|
+
Driver events are synchronous notifications emitted on the `Database` object for connection-level operations. Subscribe with `db.on(eventName, handler)`.
|
|
372
383
|
|
|
373
384
|
```js
|
|
374
385
|
Firebird.attach(options, function (err, db) {
|
|
375
386
|
if (err) throw err;
|
|
376
387
|
|
|
377
|
-
db.on('
|
|
378
|
-
//
|
|
379
|
-
// isObject === is row object or array?
|
|
388
|
+
db.on('attach', function () {
|
|
389
|
+
// fired once the database is attached
|
|
380
390
|
});
|
|
381
391
|
|
|
382
|
-
db.on('
|
|
383
|
-
//
|
|
392
|
+
db.on('detach', function (isPoolConnection) {
|
|
393
|
+
// isPoolConnection === Boolean
|
|
384
394
|
});
|
|
385
395
|
|
|
386
|
-
db.on('
|
|
396
|
+
db.on('reconnect', function () {
|
|
397
|
+
// fired after the driver reconnects a dropped socket
|
|
398
|
+
});
|
|
387
399
|
|
|
388
|
-
db.on('
|
|
389
|
-
//
|
|
400
|
+
db.on('error', function (err) {
|
|
401
|
+
// connection-level errors (socket errors, closed connection, etc.)
|
|
390
402
|
});
|
|
391
403
|
|
|
392
|
-
db.on('
|
|
404
|
+
db.on('transaction', function (options) {
|
|
405
|
+
// fired when a transaction is started (before server response)
|
|
406
|
+
// options === resolved transaction options object
|
|
407
|
+
});
|
|
393
408
|
|
|
394
|
-
db.on('
|
|
409
|
+
db.on('commit', function () {
|
|
410
|
+
// fired when a transaction commit is sent
|
|
411
|
+
});
|
|
395
412
|
|
|
396
|
-
db.on('
|
|
397
|
-
//
|
|
413
|
+
db.on('rollback', function () {
|
|
414
|
+
// fired when a transaction rollback is sent
|
|
398
415
|
});
|
|
399
416
|
|
|
400
|
-
db.on('
|
|
417
|
+
db.on('query', function (sql) {
|
|
418
|
+
// fired with the SQL string when a statement is prepared
|
|
419
|
+
});
|
|
401
420
|
|
|
402
|
-
db.on('
|
|
421
|
+
db.on('row', function (row, index, isObject) {
|
|
422
|
+
// fired for each row decoded during a fetch
|
|
423
|
+
// index === Number, isObject === Boolean
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
db.on('result', function (rows) {
|
|
427
|
+
// fired with the full rows array once all rows are fetched
|
|
428
|
+
// rows === Array
|
|
429
|
+
});
|
|
403
430
|
|
|
404
431
|
db.detach();
|
|
405
432
|
});
|
|
406
433
|
```
|
|
407
434
|
|
|
435
|
+
### Firebird Database Events (POST_EVENT)
|
|
436
|
+
|
|
437
|
+
Firebird database events are **asynchronous** notifications triggered by `POST_EVENT` inside PSQL triggers or stored procedures. They travel over a separate aux connection and are handled through `FbEventManager`.
|
|
438
|
+
|
|
439
|
+
> **Note:** Full POST_EVENT reception is not yet implemented. `attachEvent` and `registerEvent` are available, but actual event delivery requires completing the `op_que_events`/`op_event` wire-protocol implementation.
|
|
440
|
+
|
|
441
|
+
```js
|
|
442
|
+
Firebird.attach(options, function (err, db) {
|
|
443
|
+
if (err) throw err;
|
|
444
|
+
|
|
445
|
+
// 1. Open the aux event connection and get a FbEventManager
|
|
446
|
+
db.attachEvent(function (err, evtmgr) {
|
|
447
|
+
if (err) throw err;
|
|
448
|
+
|
|
449
|
+
// 2. Subscribe to one or more named events
|
|
450
|
+
evtmgr.registerEvent(['MY_EVENT'], function (err) {
|
|
451
|
+
if (err) throw err;
|
|
452
|
+
|
|
453
|
+
// 3. Listen for POST_EVENT notifications
|
|
454
|
+
evtmgr.on('post_event', function (name, count) {
|
|
455
|
+
// name === event name string (e.g. 'MY_EVENT')
|
|
456
|
+
// count === cumulative trigger count since last notification
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
// 4. Unsubscribe from events when no longer needed
|
|
461
|
+
// evtmgr.unregisterEvent(['MY_EVENT'], function (err) { ... });
|
|
462
|
+
|
|
463
|
+
// 5. Release the aux connection when done
|
|
464
|
+
// evtmgr.close(function (err) { ... });
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
```
|
|
468
|
+
|
|
408
469
|
### Escaping Query values
|
|
409
470
|
|
|
410
471
|
```js
|
|
@@ -645,8 +706,66 @@ Firebird.attach({
|
|
|
645
706
|
|
|
646
707
|
### Firebird 4.0 and 5.0
|
|
647
708
|
|
|
648
|
-
Firebird 4 wire protocol (versions 16 and 17) is
|
|
649
|
-
|
|
709
|
+
Firebird 4 wire protocol (versions 16 and 17) is now supported with the following features:
|
|
710
|
+
|
|
711
|
+
- **Protocol versions 16 and 17** β Full support for Firebird 4.0+ wire protocol
|
|
712
|
+
- **DECFLOAT data types** β Support for DECFLOAT(16) and DECFLOAT(34) using IEEE 754 Decimal64 and Decimal128 formats
|
|
713
|
+
- **INT128 data type** β Native support for 128-bit integers
|
|
714
|
+
- **Extended metadata identifiers** β Support for identifiers up to 63 characters
|
|
715
|
+
- **Backward compatibility** β Automatically negotiates the best protocol version with the server
|
|
716
|
+
|
|
717
|
+
The driver will automatically negotiate the best protocol version supported by both the client and server. No configuration changes are required for Firebird 4.0 servers.
|
|
718
|
+
|
|
719
|
+
```js
|
|
720
|
+
Firebird.attach({
|
|
721
|
+
host: '127.0.0.1',
|
|
722
|
+
port: 3050,
|
|
723
|
+
database: '/path/to/fb4.fdb',
|
|
724
|
+
user: 'SYSDBA',
|
|
725
|
+
password: 'masterkey',
|
|
726
|
+
}, function(err, db) {
|
|
727
|
+
if (err) throw err;
|
|
728
|
+
|
|
729
|
+
// DECFLOAT and INT128 types are automatically supported
|
|
730
|
+
db.query('SELECT CAST(123.456 AS DECFLOAT(16)) AS df16, CAST(9876543210 AS INT128) AS i128 FROM RDB$DATABASE', function(err, result) {
|
|
731
|
+
console.log(result); // { df16: 123.456, i128: '9876543210' }
|
|
732
|
+
db.detach();
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
**Important Notes:**
|
|
738
|
+
|
|
739
|
+
1. **Statement Timeouts:** Statement timeouts (a Protocol 16 feature) are not yet implemented. This will be added in a future release.
|
|
740
|
+
|
|
741
|
+
2. **DECFLOAT Encoding:** The current DECFLOAT implementation uses a simplified encoding/decoding mechanism and does NOT implement proper IEEE 754 Decimal64/Decimal128 formats. For production use with DECFLOAT types requiring full precision and standards compliance, consider:
|
|
742
|
+
- Using a proper IEEE 754 Decimal library (e.g., `decimal128` npm package)
|
|
743
|
+
- Contributing a full IEEE 754 implementation to this driver
|
|
744
|
+
- Working with DECFLOAT values as strings or Buffers to preserve exact precision
|
|
745
|
+
|
|
746
|
+
For legacy Firebird 4 servers with SRP authentication only, use the following configuration in `firebird.conf`:
|
|
747
|
+
Firebird 4 wire protocol (versions 16 and 17) is partially supported, including:
|
|
748
|
+
- **Time Zone Support**: Native support for `TIME WITH TIME ZONE` and `TIMESTAMP WITH TIME ZONE` (Protocol 16+).
|
|
749
|
+
- **INT128 support**: Native support for 128-bit integers.
|
|
750
|
+
- **Statement Timeout**: Support for statement-level timeouts.
|
|
751
|
+
|
|
752
|
+
#### Using Timezones (FB 4.0+)
|
|
753
|
+
|
|
754
|
+
Columns of type `TIMESTAMP WITH TIME ZONE` and `TIME WITH TIME ZONE` are automatically mapped to JavaScript `Date` objects. Values are read as UTC and represented in the local timezone of the Node.js process.
|
|
755
|
+
|
|
756
|
+
```js
|
|
757
|
+
// Select timezone columns
|
|
758
|
+
db.query('SELECT TS_TZ_COL, T_TZ_COL FROM FB4_TABLE', function(err, result) {
|
|
759
|
+
console.log(result[0].ts_tz_col); // JavaScript Date object
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// Insert using Date objects
|
|
763
|
+
db.query('INSERT INTO FB4_TABLE (TS_TZ_COL) VALUES (?)', [new Date()], function(err) {
|
|
764
|
+
// ...
|
|
765
|
+
});
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
Srp256 authentication and wire encryption are now supported natively,
|
|
650
769
|
so you only need the following minimal configuration in `firebird.conf`:
|
|
651
770
|
|
|
652
771
|
```bash
|
|
@@ -657,6 +776,7 @@ WireCrypt = Enabled
|
|
|
657
776
|
For more details see:
|
|
658
777
|
- [Firebird 3 release notes β new authentication](https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-security-new-authentication.html)
|
|
659
778
|
- [Firebird 4 release notes β Srp256](https://firebirdsql.org/file/documentation/release_notes/html/en/4_0/rlsnotes40.html#rnfb40-config-srp256)
|
|
779
|
+
- [Firebird 4 release notes β DECFLOAT](https://firebirdsql.org/file/documentation/release_notes/html/en/4_0/rlsnotes40.html#rnfb40-datatype-decfloat)
|
|
660
780
|
- [Firebird 4 migration guide β authorization](https://ib-aid.com/download/docs/fb4migrationguide.html#_authorization_with_firebird_2_5_client_library_fbclient_dll)
|
|
661
781
|
- [Firebird 5 migration guide β authorization](https://ib-aid.com/download/docs/fb5migrationguide.html#_authorization_from_firebird_2_5_client_libraries)
|
|
662
782
|
|