recon_gen.common.datasource
Shared QuickSight DataSource builder (M.4.4).
Migrated from apps/payment_recon/datasets.py when the PR app deleted —
build_datasource is app-agnostic infrastructure that the harness, the
demo CLI, and any future apps all need to construct a DataSource model
from a Postgres URL.
Lives under common/ because it has no PR-specific dependencies and
all callers (harness’s per-test datasource, recon-gen demo apply,
manual deploy scripts) consume it equally.
Functions
|
Build a QuickSight DataSource from |
- recon_gen.common.datasource.build_datasource(cfg)[source]
Build a QuickSight DataSource from
cfg.demo_database_url.Dispatches on
cfg.dialect:Postgres:
Type="POSTGRESQL"+PostgreSqlParameters(port defaults 5432, database defaultspostgres).Oracle:
Type="ORACLE"+OracleParameters(port defaults 1521,Databasecarries the service name / SID — accepted by QuickSight’s create-data-source for either Easy Connect or SQLAlchemy-style URLs).SQLite: not supported by AWS QuickSight as a datasource type. The SQLite dialect is the integrator’s local-iteration storage for the X.2 self-hosted renderer (X.3.e), not a deployable QuickSight backend. Calling
build_datasourceagainst a SQLite config raisesValueErrorwith a pointer to the local-loop docs.
The DataSource ID derives from
cfg.prefixed("demo-datasource")(i.e.<deployment_name>-demo-datasource) so each per-deploydeployment_namegets its own unique ID — per-test harness + multi-tenant deploys are isolated. Credentials come from the parsed URL; SSL is enabled by default; principal_arns from cfg become QS Permissions.Raises ValueError if
cfg.demo_database_urlis unset, or if the dialect is SQLite (QuickSight has no SQLite datasource type).- Return type:
- Parameters:
cfg (Config)