Skip to content

Commit 1034f5f

Browse files
os-billclaude
andauthored
docs(configure): federation ships today, and defineDatasource() exists (#252)
`configure/data-sources.mdx` told readers that in-product external datasource federation was a roadmap item and that no `defineDatasource()` helper existed. Both claims are stale at the source: - All four "planned, not yet shipped" bullets are shipped on objectstack `origin/main` (`SchemaModeSchema`, `external` on `ObjectSchema`, the `datasource/{introspect,validate,list-tables}` CLI, the boot/write gates and the runtime Sync wizard — ADR-0062 R1/R5c/R6/R7). - ADR-0015's own status line reads "Accepted", not "Proposed". - `export function defineDatasource` is live in `packages/spec/src/data/datasource.zod.ts` and re-exported from both `@objectstack/spec` and `@objectstack/spec/data`. The Roadmap section becomes a short pointer to the framework guide that owns this surface rather than a second description of it — the mirror follows, it does not lead. The `defineDatasource()` note names the helper as available without implying the plain-object form stopped working; it has not. Claude-Session: https://claude.ai/code/session_01ChPQM8jamxLUfUAxwFpJ8S Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8e665c7 commit 1034f5f

1 file changed

Lines changed: 16 additions & 20 deletions

File tree

‎content/docs/configure/data-sources.mdx‎

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,14 @@ export default defineStack({
8585
});
8686
```
8787

88-
> There is **no** `defineDatasource()` helper. A datasource is just a
89-
> `Datasource` object you place in the `datasources` array — exactly like
90-
> the `examples/app-crm` stack does in the framework repo.
88+
> **A `defineDatasource()` helper is also available.** The plain
89+
> `Datasource` object above is a valid datasource — it is exactly what the
90+
> `examples/app-crm` stack does in the framework repo — and
91+
> `defineDatasource()`, exported from `@objectstack/spec` (and
92+
> `@objectstack/spec/data`), takes the same config and runs the
93+
> `DatasourceSchema` validation at the point of declaration, so a bad field
94+
> is reported where you wrote it. The framework's own federation guide uses
95+
> it.
9196
9297
## Binding objects to a datasource
9398

@@ -229,26 +234,17 @@ configuration that backs the `default` datasource.
229234
- **Scope with permissions.** Object- and field-level permissions apply
230235
to connected data exactly as they do to native objects.
231236

232-
## Roadmap: in-product External Datasource Federation
237+
## In-product external datasource federation
233238

234239
The flow above — connect a database, model objects, generate them with a
235-
coding agent — works today with shipped building blocks. A richer,
236-
**turn-key federation** experience is in active design under
240+
coding agent — is the general path. The **turn-key federation** flow on top
241+
of it, specified in
237242
[ADR-0015](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0015-external-datasource-federation.md)
238-
(status: *Proposed*). Planned, **not yet shipped**:
239-
240-
- A `schemaMode` (`managed` / `external` / `validate-only`) so ObjectOS
241-
can bind to tables it does **not** own without trying to migrate them.
242-
- An `external` binding sub-record on objects mapping object fields to
243-
existing columns.
244-
- An `os datasource introspect` / `validate` CLI to import a schema and
245-
scaffold objects in one step.
246-
- Boot-time and write-time **safety gates** for externally-owned schemas,
247-
plus a Studio wizard for the whole flow.
248-
249-
Until those land, prefer the documented path: declare the datasource,
250-
bind objects (generated or hand-written), and verify against a
251-
non-production copy first.
243+
(status: *Accepted*), **ships today**: bind objects to tables ObjectOS does
244+
not own, with validation gates around them.
245+
246+
It is documented once, with the framework docs that own the surface —
247+
[External Datasources (Federation)](https://docs.objectstack.ai/docs/data-modeling/external-datasources).
252248

253249
## Where to go next
254250

0 commit comments

Comments
 (0)