@superheld/summae-knex 0.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/README.md +25 -0
- package/dist/index.cjs +688 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +161 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.js +670 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @superheld/summae-knex
|
|
2
|
+
|
|
3
|
+
Datenbank-Adapter (Node) für [`@superheld/summae-core`](../core) — persistiert
|
|
4
|
+
Mandanten in das **geteilte `summae_*`-Schema** der PHP-Referenz, via Knex
|
|
5
|
+
(Query-/Schema-Builder) + better-sqlite3 (SQLite) bzw. pg (Postgres). Damit können
|
|
6
|
+
PHP- und Node-Packages denselben Datenbestand teilen (SF-15).
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @superheld/summae-core @superheld/summae-knex better-sqlite3
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { Currency, TenantOperations, UuidV7IdGenerator, SystemClock } from '@superheld/summae-core';
|
|
14
|
+
import { SyncDb, installSchema, DatabaseTenantFactory } from '@superheld/summae-knex';
|
|
15
|
+
|
|
16
|
+
const db = new SyncDb('buchhaltung.sqlite'); // Datei oder ':memory:'
|
|
17
|
+
installSchema(db); // einmalig: summae_*-Tabellen anlegen
|
|
18
|
+
|
|
19
|
+
const clock = new SystemClock();
|
|
20
|
+
const tenant = DatabaseTenantFactory.build(db, 'Muster GmbH', Currency.of('EUR'), clock, new UuidV7IdGenerator(clock));
|
|
21
|
+
const ops = new TenantOperations(tenant);
|
|
22
|
+
// ops.execute('post', …) / ops.project('trialBalance', …) — persistiert in die DB
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Vollständige API, Konfiguration und Datenformat: **[zentrales Handbuch](https://github.com/Superheld/summae/blob/main/docs/handbuch/README.md)**.
|