ADR-0008: Datasource isolation from projectJSON
- Status: Accepted (2026-08-02)
- Decision makers: Project maintainers
Context
Legacy implementation wrote JDBC connections (url/username/password) into projectJSON.profile.dbs, causing: version snapshots/shares/exports carrying secrets; conflict with global /ncnb/dataSources.
Decision
- Single source of truth for connections: table
data_sources+ API/ncnb/dataSources; UI entry is database config page (/databaseConfig) and in-designer datasource settings (same API). profile.dbsstores no DB secrets: no longer writeproperties(url/username/password/driver). Strip on legacy load; force-clear secrets before save.- Project keeps binding only:
profile.defaultDataSourceId= current project default datasource id (maps todata_sources.id). - Runtime resolution: connection params from in-memory dataSources list (versionStore.dbs) by id; without JDBC, snapshot channel still works (
SNAPSHOT_DB).
Consequences
- Positive: share/version JSON no longer naturally contains passwords; config separated from model lifecycle
- Migration: on open legacy project strip
profile.dbs.*.properties; ifdefaultDBexists backfilldefaultDataSourceId - UI: designer "Export DDL" dropdown must
refreshDataSources()(/ncnb/dataSources), must not readprofile.dbs - Follow-up: on ERD import do not merge counterparty
profile.dbssecrets; optional one-click "import to dataSources"