@ddd-ts-kit/knex 0.113.1 → 0.114.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.fr.md +6 -6
- package/README.md +5 -5
- package/package.json +10 -10
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:c6d56ebe67625a45 -->
|
|
3
3
|
|
|
4
4
|
# @ddd-ts-kit/knex
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ vivent dans l'`infrastructure/` de chaque contexte, et l'unité de travail est c
|
|
|
28
28
|
`UnitOfWork` dans lequel le bus de commandes exécute chaque commande, et au `KnexContext` par
|
|
29
29
|
lequel chaque adaptateur atteint la base de données.
|
|
30
30
|
|
|
31
|
-

|
|
32
32
|
|
|
33
33
|
Plutôt que de faire descendre une transaction le long des appels, ce qui met un type knex dans
|
|
34
34
|
chaque signature, du gestionnaire (handler) à l'adaptateur, et fait de son oubli un bogue
|
|
@@ -397,7 +397,7 @@ autre ligne détient sous une contrainte d'unicité (un e-mail) est refusée par
|
|
|
397
397
|
`optimisticUpdate` lève `UniqueViolationError` (code `CONFLICT`, 409), pas une mise à jour
|
|
398
398
|
perdue ; sur MySQL, qui n'a pas de cible de conflit et dont `INSERT IGNORE` écarte aussi cette ligne, l'utilitaire demande si une ligne détient la clé quand rien n'a été écrit, et lève `UniqueViolationError` quand aucune ne la détient. Deux premiers enregistrements d'un même agrégat faits en même temps (une requête livrée deux fois) ne sont pas refusés pour la valeur unique qu'ils écrivent tous les deux : sur PostgreSQL, une cible de conflit sur la clé seule les laisse se rencontrer d'abord sur l'autre index unique, si bien que l'utilitaire insère par une instruction qui passe sur toute valeur unique, et seulement quand elle n'a rien écrit par une seconde qui nomme la clé. Celui qui a perdu n'écrit aucune ligne, une `ConcurrencyError`.
|
|
399
399
|
|
|
400
|
-

|
|
401
401
|
|
|
402
402
|
Le second écrivain est refusé au lieu d'écraser le premier en silence. Rien ne le retente pour
|
|
403
403
|
vous : l'appelant reçoit la `ConcurrencyError` et décide s'il recharge la facture.
|
|
@@ -627,7 +627,7 @@ base de données :
|
|
|
627
627
|
Ce que le curseur apporte, sur des factures triées par montant, quand une ligne est insérée entre
|
|
628
628
|
deux pages :
|
|
629
629
|
|
|
630
|
-

|
|
631
631
|
|
|
632
632
|
## Isolation des tenants
|
|
633
633
|
|
|
@@ -635,7 +635,7 @@ Quatre stratégies, choisies par projet ([Multitenance](../../docs/concepts/mult
|
|
|
635
635
|
dit quand chacune convient). Chacune est prouvée ici par `tenantIsolationContract` de
|
|
636
636
|
`@ddd-ts-kit/testing/contracts`, sur PGlite et sur PostgreSQL.
|
|
637
637
|
|
|
638
|
-

|
|
639
639
|
|
|
640
640
|
**Tables partagées.** Une table par agrégat, une colonne `tenant_id`, et chaque instruction
|
|
641
641
|
restreinte par le kit plutôt que par une condition écrite à la main :
|
|
@@ -903,7 +903,7 @@ La vie d'un enregistrement dans la table `outbox`. Le relais de `@ddd-ts-kit/eve
|
|
|
903
903
|
par `claimBatch`, `markPublished` et `markFailed` ; `retryDead`, `purgePublished` et `stats` sont
|
|
904
904
|
appelés par un opérateur ou par un job planifié, jamais par le relais :
|
|
905
905
|
|
|
906
|
-

|
|
907
907
|
|
|
908
908
|
## Event store
|
|
909
909
|
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ ports and the application its query ports; the adapters written with this packag
|
|
|
25
25
|
the hinge: `createKnexUnitOfWork(db)` answers the `UnitOfWork` the command bus runs every
|
|
26
26
|
command in, and the `KnexContext` every adapter reaches the database through.
|
|
27
27
|
|
|
28
|
-

|
|
29
29
|
|
|
30
30
|
Instead of handing a transaction down the calls, which puts a knex type in every signature from
|
|
31
31
|
the handler to the adapter and makes forgetting it a silent bug, the adapter asks the context
|
|
@@ -381,7 +381,7 @@ ignores a conflict on `conflict` alone (the id): a row that takes a value anothe
|
|
|
381
381
|
under a unique constraint (an email) is refused by the database, and `optimisticUpdate` raises
|
|
382
382
|
`UniqueViolationError` (code `CONFLICT`, 409), not a lost update; on MySQL, which has no conflict target and whose `INSERT IGNORE` skips that row too, the helper asks whether a row holds the key when nothing was written, and raises `UniqueViolationError` when none does. Two first saves of one aggregate made at once (a request delivered twice) are not refused for the unique value they both write: on PostgreSQL a conflict target on the key alone lets them meet on the other unique index first, so the helper inserts with a statement that skips on any unique value, and only when it wrote nothing with a second one that names the key. The one that lost writes no row, a `ConcurrencyError`.
|
|
383
383
|
|
|
384
|
-

|
|
385
385
|
|
|
386
386
|
The second writer is refused instead of silently overwriting the first. Nothing retries it for
|
|
387
387
|
you: the caller receives the `ConcurrencyError` and decides whether to load the invoice again.
|
|
@@ -602,7 +602,7 @@ The rules these examples hold, and that the tests of this package check on a rea
|
|
|
602
602
|
|
|
603
603
|
What the cursor buys, on invoices sorted by amount, when a row is inserted between two pages:
|
|
604
604
|
|
|
605
|
-

|
|
606
606
|
|
|
607
607
|
## Tenant isolation
|
|
608
608
|
|
|
@@ -610,7 +610,7 @@ Four strategies, chosen per project ([Multitenancy](../../docs/concepts/multiten
|
|
|
610
610
|
when each fits). Every one of them is proven here by `tenantIsolationContract` of
|
|
611
611
|
`@ddd-ts-kit/testing/contracts`, on PGlite and on PostgreSQL.
|
|
612
612
|
|
|
613
|
-

|
|
614
614
|
|
|
615
615
|
**Shared tables.** One table per aggregate, a `tenant_id` column, and every statement confined
|
|
616
616
|
by the kit instead of by a condition written by hand:
|
|
@@ -864,7 +864,7 @@ The life of one record in the `outbox` table. The relay of `@ddd-ts-kit/events`
|
|
|
864
864
|
`claimBatch`, `markPublished` and `markFailed`; `retryDead`, `purgePublished` and `stats` are
|
|
865
865
|
called by an operator or a scheduled job, never by the relay:
|
|
866
866
|
|
|
867
|
-

|
|
868
868
|
|
|
869
869
|
## Event store
|
|
870
870
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/knex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.114.1",
|
|
4
4
|
"description": "Knex adapters for the kernel ports: unit of work, transactional outbox store, processed-event store, PostgreSQL event store, background job store, process store.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/
|
|
20
|
+
"url": "git+https://github.com/ddd-ts-kit/ddd-ts-kit.git",
|
|
21
21
|
"directory": "packages/knex"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://
|
|
24
|
-
"bugs": "https://github.com/
|
|
23
|
+
"homepage": "https://ddd-ts-kit.github.io/ddd-ts-kit/packages/knex/",
|
|
24
|
+
"bugs": "https://github.com/ddd-ts-kit/ddd-ts-kit/issues",
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public",
|
|
27
27
|
"provenance": true
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@ddd-ts-kit/kernel": "0.
|
|
45
|
-
"@ddd-ts-kit/events": "0.
|
|
46
|
-
"@ddd-ts-kit/scheduling": "0.
|
|
44
|
+
"@ddd-ts-kit/kernel": "0.114.1",
|
|
45
|
+
"@ddd-ts-kit/events": "0.114.1",
|
|
46
|
+
"@ddd-ts-kit/scheduling": "0.114.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"knex": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"knex": "^3.3.0",
|
|
53
|
-
"@ddd-ts-kit/testing": "0.
|
|
53
|
+
"@ddd-ts-kit/testing": "0.114.1",
|
|
54
54
|
"pg": "^8.23.1",
|
|
55
55
|
"@types/pg": "^8.23.1",
|
|
56
|
-
"@electric-sql/pglite": "0.5.
|
|
57
|
-
"@electric-sql/pglite-socket": "0.2.
|
|
56
|
+
"@electric-sql/pglite": "0.5.16",
|
|
57
|
+
"@electric-sql/pglite-socket": "0.2.19",
|
|
58
58
|
"better-sqlite3": "^12.11.1"
|
|
59
59
|
}
|
|
60
60
|
}
|