node-firebird 2.4.0 → 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.
- package/README.md +37 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,20 +13,6 @@
|
|
|
13
13
|
- [Firebird on Twitter](https://twitter.com/firebirdsql/)
|
|
14
14
|
- [Firebird on Facebook](https://www.facebook.com/FirebirdSQL)
|
|
15
15
|
|
|
16
|
-
## Changelog for version v0.2.x
|
|
17
|
-
|
|
18
|
-
- added auto-reconnect
|
|
19
|
-
- added [sequentially selects](https://github.com/hgourvest/node-firebird/wiki/What-is-sequentially-selects)
|
|
20
|
-
- events for connection (attach, detach, row, result, transaction, commit, rollback, error, etc.)
|
|
21
|
-
- performance improvements
|
|
22
|
-
- supports inserting/updating buffers and streams
|
|
23
|
-
- reading blobs (sequentially)
|
|
24
|
-
- pooling
|
|
25
|
-
- `database.detach()` waits for last command
|
|
26
|
-
- better unit-test
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
16
|
- [Firebird documentation](https://firebirdsql.org/en/documentation/)
|
|
31
17
|
- [Firebird limits and data types](https://firebirdsql.org/en/firebird-technical-specifications/)
|
|
32
18
|
|
|
@@ -36,6 +22,10 @@
|
|
|
36
22
|
npm install node-firebird
|
|
37
23
|
```
|
|
38
24
|
|
|
25
|
+
The driver is pure JavaScript at runtime — no native addons and no runtime
|
|
26
|
+
dependencies. Node.js 20 or newer is supported (CI runs on Node 20, 22, 24
|
|
27
|
+
and 26 against Firebird 3, 4, 5 and 6).
|
|
28
|
+
|
|
39
29
|
## Usage
|
|
40
30
|
|
|
41
31
|
```js
|
|
@@ -50,21 +40,47 @@ import * as Firebird from 'node-firebird';
|
|
|
50
40
|
import type { Options, Database } from 'node-firebird';
|
|
51
41
|
```
|
|
52
42
|
|
|
53
|
-
###
|
|
43
|
+
### Developing the driver
|
|
44
|
+
|
|
45
|
+
Since v2.4.0 the driver is written in TypeScript and compiled with the native
|
|
46
|
+
TypeScript 7 compiler (`tsc`). The published package ships both the compiled
|
|
47
|
+
output and the sources.
|
|
48
|
+
|
|
49
|
+
**Requirements**
|
|
50
|
+
|
|
51
|
+
- Node.js >= 20 (CI matrix: 20, 22, 24, 26)
|
|
52
|
+
- npm (TypeScript 7 and all tooling are installed as devDependencies — no
|
|
53
|
+
global installs needed)
|
|
54
|
+
- a Firebird server on `127.0.0.1:3050` with `SYSDBA`/`masterkey` for the
|
|
55
|
+
integration tests (CI tests against Firebird 3, 4, 5 and 6-snapshot); the
|
|
56
|
+
unit tests under `test/unit/` run without a server
|
|
57
|
+
|
|
58
|
+
The quickest way to get a test server is Docker:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
docker run -d --name firebird -p 3050:3050 \
|
|
62
|
+
-e FIREBIRD_ROOT_PASSWORD=masterkey \
|
|
63
|
+
firebirdsql/firebird:5
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Layout**
|
|
67
|
+
|
|
68
|
+
- `src/` — the TypeScript sources; this is what you edit
|
|
69
|
+
- `lib/` — compiled CommonJS + generated `.d.ts` declarations; build output,
|
|
70
|
+
gitignored — never edit it by hand
|
|
71
|
+
- `test/` — vitest suite (integration tests at the top level, server-free
|
|
72
|
+
tests in `test/unit/`)
|
|
54
73
|
|
|
55
|
-
|
|
56
|
-
`.d.ts`) by the native TypeScript 7 compiler:
|
|
74
|
+
**Workflow**
|
|
57
75
|
|
|
58
76
|
```bash
|
|
59
77
|
npm install # installs deps and builds lib/ via the prepare script
|
|
60
78
|
npm run build # compile src/ -> lib/
|
|
61
|
-
npm run typecheck # type-check sources and
|
|
79
|
+
npm run typecheck # type-check sources and tests without emitting
|
|
80
|
+
npm run lint # oxlint
|
|
62
81
|
npm test # build + run the vitest suite (unit + integration)
|
|
63
82
|
```
|
|
64
83
|
|
|
65
|
-
The integration tests expect a Firebird server on `127.0.0.1:3050`
|
|
66
|
-
(SYSDBA/masterkey); the unit tests under `test/unit/` run without a server.
|
|
67
|
-
|
|
68
84
|
### Methods
|
|
69
85
|
|
|
70
86
|
- `Firebird.escape(value) -> return {String}` - prevent for SQL Injections
|