Skip to content

Add Amazon Redshift connector #161

Description

@luca-martial

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

  • Builds, type-checks, tests, and dead-code pass
  • Same KtxScanConnector surface and capabilities as Postgres, mock-pool
    tests in the postgres/connector.test.ts shape
  • Auth: password and IAM (provisioned and serverless)
  • Query history reads SYS_QUERY_HISTORY behind context.queryHistory
  • Docs in docs-site/content/docs/integrations/primary-sources.mdx with
    password and IAM examples

Suggested phasing: PR 1 connector, PR 2 query history.

Metadata

Metadata

Labels

area:connectorspackages/connector-* and packages/cli/src/context/ingest/adapters/*help wantedExtra attention is neededreward:tier-3Hoodie tier — major or repeat contributor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions