feat(app-showcase): add an end-to-end external datasource + federated object example (#2111)#2139
Merged
Merged
Conversation
… object example (#2111) A code-defined EXTERNAL datasource (ADR-0015) over a second, read-only SQLite file — no external server required, so `os dev` just works. Demonstrates the full federation path the runtime datasource-admin UI exposes. - src/datasources/showcase-external.datasource.ts — schemaMode:'external', read-only, onMismatch:'warn' (a fixture hiccup never bricks the showcase boot). Includes a commented Postgres+secret variant for the masked-secret widget. - src/objects/external/{customer,order}.object.ts — federated objects whose names (showcase_ext_customer/order) deliberately differ from their remote tables (customers/orders), bound via external.remoteName — exercises the remote-table remap fixed in the companion driver change. - src/datasources/external-fixture.ts — the onEnable hook: idempotently provisions the fixture sqlite (tables + seed rows), registers a live read-only driver under the datasource name, and registers the federated objects' read metadata (DDL-free, via ql.syncObjectSchema). - objectstack.config.ts wires the datasource + objects + onEnable; package.json adds @objectstack/driver-sql; README documents the flow and the Setup → Datasources sync UI; test/external-datasource.test.ts smoke-asserts the binding. Depends on the ADR-0015 federation read-path fix (honoring external.remoteName). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…fication `objectstack verify` probe-inserts into every object; a read-only external object (ADR-0015) correctly rejects the insert via the write gate, which verify reported as a create-failed runtime failure (breaking the Dogfood Regression Gate once the showcase gained federated objects). deriveCrudCases now marks external objects that aren't fully write-opted-in (datasource.external.allowWrites && object.external.writable) as `blocked`/skipped. Adds derive.test.ts covering the skip + the write-opted-in and managed pass-through cases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 1 changed package(s). ✅ |
xuyushun441-sys
added a commit
that referenced
this pull request
Jun 22, 2026
…le, credentials, visibility, query completeness) (#2162) Consolidates the runtime gaps surfaced while implementing ADR-0015 federation (#2138 read path, #2149 columnMap, #2139 example+verify, #2157 visibility) into a single forward decision: one DatasourceConnectionService that auto-connects declared datasources as queryable engine drivers (no onEnable bridge), backward- compatible opt-in gating (existing managed apps unchanged), credential resolution at connect, native-analytics remote-table awareness, and columnMap/field.columnName reconciliation. Status: Proposed; decisions D1-D8 with a phased rollout. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2111.
What
A runnable, self-contained example of the ADR-0015 external datasource → federated objects flow in
app-showcase, with no external server —os devjust works.src/datasources/showcase-external.datasource.ts— a second, read-only SQLite datasource (schemaMode:'external',onMismatch:'warn'so a fixture hiccup never bricks the showcase boot). Includes a commented Postgres+secretvariant for the masked-secret widget.src/objects/external/{customer,order}.object.ts— federated objects whose names (showcase_ext_customer/order) deliberately differ from their remote tables (customers/orders), bound viaexternal.remoteName.src/datasources/external-fixture.ts— the stackonEnablehook: idempotently provisions the fixture SQLite, registers a live read-only driver under the datasource name, and registers the federated objects' read metadata (ql.syncObjectSchema).test/external-datasource.test.tssmoke test.Builds on the ADR-0015 federation read-path fix (#2138), which makes
external.remoteNamehonored by queries.Verified live (
os dev)GET /api/v1/data/showcase_ext_customer→ 200, 3 rows (queried live from external tablecustomers).GET /api/v1/data/showcase_ext_order→ 200, 4 rows.?region=EU/?region=APACfilters push down to the remote table correctly.os devboots zero-config; the external SQLite fixture is auto-provisioned.Known follow-up (not this PR)
In the dev config-load path, a code-defined datasource is not yet surfaced by
GET /api/v1/datasources/GET /api/v1/meta/datasource(the admin list reads persisted records;getMetaItemsdoesn't surface in-memory registrations). This affects any code-defined datasource (e.g. app-crm), and is tracked separately. The federation read path itself works end-to-end.🤖 Generated with Claude Code