or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

bigquery-client.mdclickhouse-client.mdcore-types.mdcredentials.mddatabricks-client.mdfactory-functions.mdindex.mdpostgres-client.mdredshift-client.mdsnowflake-client.mdsql-builders.mdssh-tunnel.mdtrino-client.md
tile.json

redshift-client.mddocs/

Redshift Client

Amazon Redshift client (PostgreSQL-compatible) with SSH tunnel support.

Quick Start

import { RedshiftWarehouseClient } from '@lightdash/warehouses';

const client = new RedshiftWarehouseClient({
  type: 'redshift',
  host: 'my-cluster.abc123.us-east-1.redshift.amazonaws.com',
  port: 5439,
  user: 'admin',
  password: 'mypassword',
  dbname: 'analytics',
  schema: 'public',
  sslmode: 'require',
});

await client.test();

Key Features

  • PostgreSQL Wire Protocol: Full PostgreSQL compatibility
  • AWS Redshift SSL: Built-in AWS CA certificates
  • SSH Tunnel: For private clusters
  • Streaming Cursors: Memory-efficient queries
  • Parameterized Queries: $1, $2 placeholders

Inherited from PostgreSQL

RedshiftWarehouseClient extends PostgresClient<CreateRedshiftCredentials>:

  • All PostgreSQL methods and features
  • Same SQL syntax and patterns
  • Same error handling

Key Differences from PostgreSQL

AspectPostgreSQLRedshift
Default Port54325439
WorkloadOLTPOLAP (columnar)
SQL BuilderPostgresSqlBuilderRedshiftSqlBuilder (same syntax)
CA CertsGeneral SSLAWS Redshift CA bundle

Common Patterns

Same as PostgreSQL - see PostgreSQL Client

With SSH Tunnel

const client = new RedshiftWarehouseClient({
  type: 'redshift',
  host: 'internal-redshift.local',
  port: 5439,
  user: 'dbuser',
  password: 'dbpass',
  dbname: 'warehouse',
  schema: 'public',
  sslmode: 'disable',
  useSshTunnel: true,
  sshTunnelHost: 'bastion.example.com',
  sshTunnelUser: 'sshuser',
  sshTunnelPrivateKey: '-----BEGIN RSA PRIVATE KEY-----\n...',
});

SQL Builder

import { RedshiftSqlBuilder } from '@lightdash/warehouses';

const builder = new RedshiftSqlBuilder();
builder.getAdapterType(); // 'redshift'
// All other methods inherited from PostgresSqlBuilder

Credentials

Identical to PostgreSQL except:

  • type: 'redshift'
  • Default port: 5439
  • Optional ra3Node: true for RA3 optimizations

Notes

  • Uses PostgreSQL pg library
  • Same type mappings as PostgreSQL
  • System schemas filtered automatically
  • Connection pooling built-in
  • getAllTables() returns BASE TABLEs only