Scope
Read-only Amazon Redshift connector: schema introspection, table/column
sampling, read-only query execution, and (phase 2) query-history ingestion.
Key design
- Where it lives. Connectors are modules inside
packages/cli, not
packages/connector-* packages (that layout was retired; the leftover folders
on disk are stale build output). Add packages/cli/src/connectors/redshift/,
modeled on packages/cli/src/connectors/postgres/ (Redshift uses the Postgres
wire protocol and the same pg driver). Register 'redshift' starting from
KtxConnectionDriver in context/scan/types.ts; the typed driverRegistrations
record in context/connections/drivers.ts will compile-error you through the
rest (dialect factory, driver-schemas.ts, sql-analysis dialect map, setup
wizard).
- Reuse, don't copy. Extract the shared Postgres-wire plumbing (pool,
read-only enforcement, param prep, env:/file: resolution) so postgres
and redshift share one implementation. Fork only the Redshift-specific parts.
- Introspection. Use
SVV_TABLES / SVV_COLUMNS / SVV_TABLE_INFO (not
pg_catalog, which misses external/late-binding tables and has stale row
counts). Redshift has no TABLESAMPLE and no pg_stats, and declared PK/FK
are unenforced hints.
- Auth. Password (same as Postgres) and IAM. IAM mints temporary credentials
via the AWS SDK and differs by deployment: redshift:GetClusterCredentials
(provisioned) vs redshift-serverless:GetCredentials (serverless). Refresh on
expiry; load the AWS SDK only on the IAM path.
- Query history (phase 2). Lives in the historic-sql ingest adapter as a
per-dialect reader (redshift-query-history-reader.ts) modeled on the
Snowflake/BigQuery readers, not in the connector. Read SYS_QUERY_HISTORY,
not STL_QUERY / SVL_QLOG (legacy, truncated, absent on serverless).
Acceptance criteria
Suggested phasing: PR 1 connector, PR 2 query history.
Scope
Read-only Amazon Redshift connector: schema introspection, table/column
sampling, read-only query execution, and (phase 2) query-history ingestion.
Key design
packages/cli, notpackages/connector-*packages (that layout was retired; the leftover folderson disk are stale build output). Add
packages/cli/src/connectors/redshift/,modeled on
packages/cli/src/connectors/postgres/(Redshift uses the Postgreswire protocol and the same
pgdriver). Register'redshift'starting fromKtxConnectionDriverincontext/scan/types.ts; the typeddriverRegistrationsrecord in
context/connections/drivers.tswill compile-error you through therest (dialect factory,
driver-schemas.ts,sql-analysisdialect map, setupwizard).
read-only enforcement, param prep,
env:/file:resolution) sopostgresand
redshiftshare one implementation. Fork only the Redshift-specific parts.SVV_TABLES/SVV_COLUMNS/SVV_TABLE_INFO(notpg_catalog, which misses external/late-binding tables and has stale rowcounts). Redshift has no
TABLESAMPLEand nopg_stats, and declared PK/FKare unenforced hints.
via the AWS SDK and differs by deployment:
redshift:GetClusterCredentials(provisioned) vs
redshift-serverless:GetCredentials(serverless). Refresh onexpiry; load the AWS SDK only on the IAM path.
per-dialect reader (
redshift-query-history-reader.ts) modeled on theSnowflake/BigQuery readers, not in the connector. Read
SYS_QUERY_HISTORY,not
STL_QUERY/SVL_QLOG(legacy, truncated, absent on serverless).Acceptance criteria
dead-codepassKtxScanConnectorsurface and capabilities as Postgres, mock-pooltests in the
postgres/connector.test.tsshapeSYS_QUERY_HISTORYbehindcontext.queryHistorydocs-site/content/docs/integrations/primary-sources.mdxwithpassword and IAM examples
Suggested phasing: PR 1 connector, PR 2 query history.