@abloatai/ablo 0.60.0 → 0.61.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.61.0
4
+
5
+ ### Existing database connections repair in place
6
+
7
+ `ablo connect apply` is now the single repeatable operation for both a new
8
+ database connection and an existing registration. A healthy connection is a
9
+ no-op. When a registration predates current publication, replica-identity,
10
+ grant, or row-level-security requirements, the same command reconciles those
11
+ database-owned invariants through the transient owner URL while preserving
12
+ Ablo's working scoped passwords.
13
+
14
+ If that repair means an earlier initial snapshot may have omitted rows, the
15
+ operation requests the required fresh snapshot and subsequent reruns report its
16
+ loading or ready state. Automation can select `--json` for stable lifecycle and
17
+ per-step codes instead of parsing human output. Credential rotation remains an
18
+ explicit operation for an actually incomplete or invalid role pair.
19
+
3
20
  ## 0.60.0
4
21
 
5
22
  ### Sessions are the connection boundary for people and agents
package/docs/cli.md CHANGED
@@ -136,6 +136,7 @@ branch-bound runtime credential before starting application code.
136
136
  | `ablo migrate` | **Direct Postgres**: provision just the synced models (plus the adapter's `ablo_outbox` / `ablo_idempotency`) in your own `DATABASE_URL`. Leaves your other tables alone. | `--dry-run`, `--output <file>`, `--schema`, `--export` |
137
137
  | `ablo pull` | **Direct Postgres**: generate `defineSchema(...)` from your existing tables (read-only, like `prisma db pull`). | `--out <path>`, `--app-schema <name>`, `--import <pkg>`, `--force` |
138
138
  | `ablo check` | **Direct Postgres**: verify your _existing_ tables fit the schema (read-only, no schema changes). | `--schema <path>`, `--export <name>`, `--app-schema <name>` |
139
+ | `ablo connect plan\|apply\|check\|rotate\|deregister` | **Direct Postgres**: register and maintain a database plane. Here `--schema` means the existing PostgreSQL namespace, never a TypeScript file. | `--url <postgres-url>`, `--schema <postgres-schema>`, `--env-file <path>`, `--yes` |
139
140
  | `ablo generate` | Emit TypeScript types from the schema. | `--out <path>`, `--schema`, `--export` |
140
141
  | `ablo docs` | Read these pages for the version you installed: offline, no network (see [`ablo docs`](#ablo-docs)). | `--json` |
141
142
 
@@ -132,6 +132,27 @@ npx ablo connect apply --env-file .env.local --yes
132
132
  The explicit flag makes the credential choice visible and loads both the
133
133
  branch-bound key and database URL. Shell environment variables take precedence.
134
134
 
135
+ ### Two schema flags, two ownership boundaries
136
+
137
+ `migrate` and `push` read your Ablo TypeScript contract. `connect apply` also
138
+ reads it to derive the mapped Postgres tables; `--tables` is an explicit
139
+ override:
140
+
141
+ ```bash
142
+ # TypeScript contract and export; app-schema selects its Postgres namespace.
143
+ npx ablo migrate --schema ablo/schema.ts --export schema --app-schema public
144
+
145
+ # Existing Postgres namespace only. Never pass ablo/schema.ts here.
146
+ npx ablo connect apply --schema public --yes
147
+
148
+ # Activate the TypeScript contract after the database is connected.
149
+ npx ablo push --schema ablo/schema.ts --export schema
150
+ ```
151
+
152
+ If the database uses its default namespace, omit `connect --schema`; it defaults
153
+ to `public`. Keep the three operations in this order in deployment automation:
154
+ expand tables, connect the database, then activate the hosted schema.
155
+
135
156
  ### One database, several projects
136
157
 
137
158
  Provider database URLs and Postgres schemas solve different isolation jobs:
@@ -190,13 +211,18 @@ npx ablo connect apply --url postgres://admin:...@host:5432/db --schema mail
190
211
  ```
191
212
 
192
213
  Pass an admin connection string with `--url` and select the application namespace
193
- with `--schema` (default `public`). It creates a per-binding publication, two
194
- per-binding scoped roles, and the grants, turns on logical decoding where it can, registers
195
- both scoped roles with Ablo, and proves the setup by reconnecting and reading back.
214
+ with `--schema` (default `public`). It inspects and reconciles a per-binding
215
+ publication, two per-binding scoped roles, grants, replica identity,
216
+ registration, and the initial snapshot. On an existing healthy registration it
217
+ is a no-op and preserves both passwords. A policy-only repair also preserves
218
+ them; credential rotation happens only through the explicit `connect rotate`
219
+ operation.
220
+
196
221
  The admin credential is used on this machine only and never persisted — nothing is
197
- written to your `.env`, which keeps holding only `ABLO_API_KEY`. Pass `--show-sql`
198
- to see every statement first, or drop `--apply` to print the SQL and run it
199
- yourself. Rotate the scoped passwords any time with `ablo connect rotate`.
222
+ written to your `.env`, which keeps holding only `ABLO_API_KEY`. Pass
223
+ `--show-sql` to see every statement first, `--json` for stable result and step
224
+ codes, or drop `--apply` to print the SQL and run it yourself. Rotate the scoped
225
+ passwords any time with `ablo connect rotate`.
200
226
 
201
227
  The rest of this page is what that command sets up, step by step, for when you want
202
228
  to run it by hand or review exactly what changes.
@@ -215,19 +241,20 @@ the row to be visible already, and touching application rows is neither necessar
215
241
  nor a safe bootstrap mechanism.
216
242
 
217
243
  If a connection was snapshotted with an older replication role whose row-level
218
- security hid historical rows, repair that role and request the load again without
219
- deregistering or rotating credentials:
244
+ security hid historical rows, rerun the same operation. It repairs the owned
245
+ policy and requests the necessary fresh load without deregistering or rotating
246
+ credentials:
220
247
 
221
248
  ```bash
222
- npx ablo connect rotate # reasserts BYPASSRLS and safely re-registers both roles
223
- npx ablo connect resnapshot # recreates only the slot; the load is asynchronous
224
- npx ablo connect check # repeat until the existing-row load is complete
249
+ npx ablo connect apply --url postgres://owner:...@host/db --yes --json
250
+ # Rerun the same command: loading becomes ready; a healthy rerun is a no-op.
225
251
  ```
226
252
 
227
- Use the same `resnapshot` step after adding an existing populated table to the
228
- publication. Following its future WAL changes is not enough to load rows written
229
- before publication membership; the snapshot coverage guard therefore refuses to
230
- record completion when even one mapped table is absent. Relation matching is
253
+ Rerun `connect apply` after adding an existing populated table to the contract.
254
+ Following its future WAL changes is not enough to load rows written before
255
+ publication membership, so reconciliation updates membership and requests the
256
+ fresh snapshot together. The snapshot coverage guard refuses to record
257
+ completion when even one mapped table is absent. Relation matching is
231
258
  schema-qualified using the DataSource's configured `schema` (default `public`):
232
259
  an identically named table in another Postgres schema neither counts as coverage
233
260
  nor enters the snapshot or WAL stream for your model.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abloatai/ablo",
3
- "version": "0.60.0",
3
+ "version": "0.61.0",
4
4
  "description": "The public Ablo SDK for coordinated reads, commits, claims, observation, and reactive applications.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -145,8 +145,8 @@
145
145
  "directory": "packages/ablo"
146
146
  },
147
147
  "dependencies": {
148
- "@abloatai/humans": "^0.60.0",
149
- "@abloatai/transaction": "^0.60.0",
148
+ "@abloatai/humans": "^0.61.0",
149
+ "@abloatai/transaction": "^0.61.0",
150
150
  "zod": "^4.4.3"
151
151
  },
152
152
  "peerDependencies": {