Amazon Redshift client (PostgreSQL-compatible) with SSH tunnel support.
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();$1, $2 placeholdersRedshiftWarehouseClient extends PostgresClient<CreateRedshiftCredentials>:
| Aspect | PostgreSQL | Redshift |
|---|---|---|
| Default Port | 5432 | 5439 |
| Workload | OLTP | OLAP (columnar) |
| SQL Builder | PostgresSqlBuilder | RedshiftSqlBuilder (same syntax) |
| CA Certs | General SSL | AWS Redshift CA bundle |
Same as PostgreSQL - see PostgreSQL Client
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...',
});import { RedshiftSqlBuilder } from '@lightdash/warehouses';
const builder = new RedshiftSqlBuilder();
builder.getAdapterType(); // 'redshift'
// All other methods inherited from PostgresSqlBuilderIdentical to PostgreSQL except:
type: 'redshift'ra3Node: true for RA3 optimizationspg librarygetAllTables() returns BASE TABLEs only