@niscorp/strata 0.1.8 → 0.1.9
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/CHANGELOG.md +8 -0
- package/DESIGN.md +6 -3
- package/README.md +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @niscorp/strata
|
|
2
2
|
|
|
3
|
+
## 0.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2a44642: The docs say a run with nothing pending ends at its first read only without a `guard` or `dryRun`, that a pool without `transaction` is refused for those too, and that moss's boot now checks its sequences rather than running them.
|
|
8
|
+
|
|
9
|
+
**What to change:** nothing. Documentation only.
|
|
10
|
+
|
|
3
11
|
## 0.1.8
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/DESIGN.md
CHANGED
|
@@ -43,7 +43,7 @@ production boot can require that a deploy step migrated first.
|
|
|
43
43
|
|
|
44
44
|
**Read first, then one transaction, one lock.** A run reads the ledger before
|
|
45
45
|
anything else; with problems it refuses, in verify mode or with nothing pending
|
|
46
|
-
it ends there — a read that a role without DDL rights can make. Otherwise it
|
|
46
|
+
and no guard or dry run it ends there — a read that a role without DDL rights can make. Otherwise it
|
|
47
47
|
opens one transaction, sets its own statement timeout, takes
|
|
48
48
|
`pg_advisory_xact_lock` on the ledger's name, sets its lock timeout, creates
|
|
49
49
|
the ledger if needed, reads it again, plans and applies. Postgres DDL is
|
|
@@ -71,7 +71,10 @@ caught in CI rather than by a refusing production boot.
|
|
|
71
71
|
moss's server now runs `nisc.moss` (integrations, their actions, the generation
|
|
72
72
|
pointer), `nisc.moss.sessions` (when the deployment uses moss's credential) and
|
|
73
73
|
the vex cache's sequence in one run, **before** introspection — as the tables
|
|
74
|
-
it replaced were.
|
|
74
|
+
it replaced were. (Since then that run only checks them, refusing the boot
|
|
75
|
+
while anything is pending, unless the runtime sets `migrations: 'apply'`;
|
|
76
|
+
`nisc migrate` applies them.) Two consequences, named rather than discovered
|
|
77
|
+
later:
|
|
75
78
|
|
|
76
79
|
- The generation table used to be created *after* introspection; it is now
|
|
77
80
|
created before, and `strata_ledger` is a new table. Both enter the
|
|
@@ -88,7 +91,7 @@ it replaced were. Two consequences, named rather than discovered later:
|
|
|
88
91
|
`initIntegrations` and `initSessions` have gone from what moss exports: the
|
|
89
92
|
integration tables are part of `MOSS_SEQUENCE`, and the sessions table is
|
|
90
93
|
made where a deployment keeps moss's stored sessions (`session:
|
|
91
|
-
'sessions'`); `
|
|
94
|
+
'sessions'`); `migrateTables` applies both and `createServer` checks them. The other two
|
|
92
95
|
are as they were, and the tide store is tide's own,
|
|
93
96
|
`@niscorp/tide/postgres`.)
|
|
94
97
|
|
package/README.md
CHANGED
|
@@ -54,8 +54,9 @@ ledgered run, and the server checks them at boot.
|
|
|
54
54
|
and two statements on one line, or a `;` followed by a trailing comment, stay
|
|
55
55
|
one step. Write those as their own steps.
|
|
56
56
|
- **A run reads before it writes.** The ledger is read first; a database with
|
|
57
|
-
nothing pending is answered from that read
|
|
58
|
-
so an app whose database role cannot
|
|
57
|
+
nothing pending, run without `guard` or `dryRun`, is answered from that read
|
|
58
|
+
— no lock, no DDL, no transaction — so an app whose database role cannot
|
|
59
|
+
change tables can still check them.
|
|
59
60
|
- **A run is one transaction** under an advisory lock. A step throws, nothing
|
|
60
61
|
from the run happened — Postgres DDL is transactional. Two processes migrating
|
|
61
62
|
at once serialize; the second finds the work done.
|
|
@@ -102,8 +103,8 @@ ledgered run, and the server checks them at boot.
|
|
|
102
103
|
|
|
103
104
|
The pool is structural — `{ query, transaction }`, the shape vex's PGlite pool
|
|
104
105
|
and a wrapped `pg` pool already have. A pool without `transaction` is refused
|
|
105
|
-
(`NO_TRANSACTION`) when it has something to apply
|
|
106
|
-
not at all. `query` and
|
|
106
|
+
(`NO_TRANSACTION`) when it has something to apply, or a `guard` or `dryRun`:
|
|
107
|
+
a run must land whole or not at all. `query` and
|
|
107
108
|
`transaction` are called on the object that has them, so a driver's own object
|
|
108
109
|
whose methods reach for `this` — a PGlite, a `pg` client handed through as the
|
|
109
110
|
transaction — works as it is.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/strata",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Migrations for nisc — one ledger for the tables a database holds and the documents stored in them, applied in order, recorded once, refused when edited.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|