Skip to content

Commit 6a07672

Browse files
committed
docs(spec,driver-turso): the forced-replica D3 entry names the two doors; the README lists the sync-key refusals
The new D3 entry's surface named the driver's TursoConfigSchema mirror among the surfaces that refuse a forced mode 'replica' with no syncUrl. The mirror declares no mode key and strips an authored one, so it cannot see a forced mode: it carries the arm's text for parity only. The surface now names the two doors (the spec contract and the constructor) and says what the mirror does. registry.ts regenerated by gen:migration-registry. The driver README's list of constructor refusals named only the url refusals; it now also names the three sync-key refusals (syncUrl under a forced remote mode, sync with no syncUrl, a forced replica with no syncUrl). Text only. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N8TPEsoJxPsdSdNKGnNGEN
1 parent 7bb7b3a commit 6a07672

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎packages/drivers/driver-turso/README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ no embedded replica for a remote url anyway. For a remote database, drop
223223
no local engine, so its url is not judged here: `@libsql/client` refuses a
224224
url it cannot open when the driver connects.
225225

226+
The constructor also refuses (`VALIDATION_ERROR` / 400) three sync settings
227+
that nothing would honour, each with the message `@objectstack/spec`'s
228+
`TursoConfigSchema` gives at authoring:
229+
230+
- `syncUrl` under a forced `mode: 'remote'`, where the remote client never
231+
receives it. For a remote database, drop `syncUrl` (and `sync`);
232+
- `sync` with no `syncUrl` (or an empty one), in any mode, where nothing reads
233+
it. Set `syncUrl`, or remove `sync`;
234+
- a forced `mode: 'replica'` with no `syncUrl` (or an empty one), which would
235+
never sync and would run as a plain local database. Name the remote in
236+
`syncUrl` beside the `file:` url, or drop `mode` for a local database.
237+
226238
You can also force a specific mode:
227239

228240
```typescript

‎packages/spec/src/migrations/entries/semantic/18.turso-config-forced-replica-without-sync-url-refused.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ export const entry: SemanticMigration = {
1313
// No backticks in `surface` — build-upgrade-guide renders it inside a code
1414
// span already, and a nested backtick would close it.
1515
surface:
16-
'data.TursoConfig (a turso / libsql datasource.config), the published TursoConfigSchema mirror '
17-
+ 'of @objectstack/driver-turso, and the TursoDriver constructor — mode replica with no syncUrl '
18-
+ '(or an empty one) is now refused, on mode',
16+
'data.TursoConfig (a turso / libsql datasource.config) and the TursoDriver constructor of '
17+
+ '@objectstack/driver-turso — mode replica with no syncUrl (or an empty one) is now refused, on '
18+
+ 'mode at authoring and at construction. The published TursoConfigSchema mirror of '
19+
+ '@objectstack/driver-turso carries the same text for parity but declares no mode key and strips '
20+
+ 'an authored one, so it cannot see a forced mode and still accepts the config as a local file',
1921
replacement:
2022
'the configuration the author meant. An embedded replica names the remote it replicates from: '
2123
+ 'keep the file: url and set syncUrl to the libsql or https Turso endpoint, for example url '

‎packages/spec/src/migrations/registry.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16071,9 +16071,11 @@ const step18: MigrationStep = {
1607116071
// No backticks in `surface` — build-upgrade-guide renders it inside a code
1607216072
// span already, and a nested backtick would close it.
1607316073
surface:
16074-
'data.TursoConfig (a turso / libsql datasource.config), the published TursoConfigSchema mirror '
16075-
+ 'of @objectstack/driver-turso, and the TursoDriver constructor — mode replica with no syncUrl '
16076-
+ '(or an empty one) is now refused, on mode',
16074+
'data.TursoConfig (a turso / libsql datasource.config) and the TursoDriver constructor of '
16075+
+ '@objectstack/driver-turso — mode replica with no syncUrl (or an empty one) is now refused, on '
16076+
+ 'mode at authoring and at construction. The published TursoConfigSchema mirror of '
16077+
+ '@objectstack/driver-turso carries the same text for parity but declares no mode key and strips '
16078+
+ 'an authored one, so it cannot see a forced mode and still accepts the config as a local file',
1607716079
replacement:
1607816080
'the configuration the author meant. An embedded replica names the remote it replicates from: '
1607916081
+ 'keep the file: url and set syncUrl to the libsql or https Turso endpoint, for example url '

0 commit comments

Comments
 (0)