URI Connection Strings
  • 01 Dec 2023
  • 1 Minute to read
  • Dark
    Light

URI Connection Strings

  • Dark
    Light

Article Summary

Connection Strings

Below is a list of connection strings for use when connecting a database using a SQLAlchemy URI.

Select linked database name for more connection details / instructions.

DatabaseConnection String
Amazon Athenaawsathena+pandas://<AWS Access Key ID>:<AWS Secret Access Key>@athena.<Region Name>.amazonaws.com/<Database Name>?s3_staging_dir=s3://<S3 Bucket>/&work_group=<Work Group>
Amazon Redshift redshift+psycopg2://<Username>:<Password>@<AWS Endpoint>:<Port-default-5439>/<Database Name>?sslmode=verify-ca

To support Spectrum tables, please use this alternative driver: redshift+spectrum://<Username>:<Password>@<AWS Endpoint>:<Port-default-5439>/<Database Name>?sslmode=verify-ca
Apache Drilldrill+sadrill://<Username>:<Password>@<host>:<port>/<storage_plugin>?use_ssl=True
Apache Druiddruid+https://<Username>:<password>@<Host>:<Port-default-8082>/druid/v2/sql
Apache Hivehive://<Host>:<Port-default-10000>/<catalog>/<schema>
Apache Impalaimpala://<Host>:<Port-default>/<Database Name>?use_ssl=True
Apache Kylinkylin://<Host>:<Port-default>/<Database Name>?is_ssl=True
Apache Pinotpinot+https://pinot-broker.<Host>:<Port-default>/query?server=https://pinot-controller.<Host>:<Port-default>/
Apache Spark SQLjdbc+hive://
Aurora PostgreSQL (Data API)postgresql+auroradataapi://<AWS Access ID>:<AWS Secret Key>@/<Database Name>
Azure Synapsemssql+pyodbc://<Username>:<Password>@<Host>:<Port>/<DatabaseName>?driver=ODBC+Driver+17+for+SQL+Server

If you face an error, try including autocommit=True (might be required by your database):
mssql+pyodbc://<Username>:<Password>@<Host>:<Port>/<DatabaseName>?autocommit=True&driver=ODBC+Driver+17+for+SQL+Server
ClickHouseclickhousedb+connect://<Username>:<Password>@<Host>/<Database Name>?secure=true
CockroachDBcockroachdb://<Username>:<Password>@<Host>/<Database Name>?sslmode=require
Databricks Hivedatabricks+pyhive://token:<token>@<host>:443
Dremiodremio://<Username>:<Password>@<Host>:<Port>/<Database Name>/?SSL=1

To connect using a Personal Access Token (PAT):
dremio://$token:<Personal Access Token>@sql.dremio.cloud:443/<Project ID>;SSL=1
Elasticsearch (SQL API)elasticsearch+https://<Username>:<Password>@<Host>:<Port>/
Firebirdfirebird+fdb://<Username>:<Password>@<Host>:<Port-default:3050>/<path to db>/db.fdb
Fireboltfirebolt://<Username>:<Password>@<Host>/<Database Name>
Google BigQuerybigquery://<Project ID>
Google Sheetsgsheets://
Hanahana://<Host>?encrypt=True
IBM Db2db2+ibm_db://<Host>/?Security=ssl
Microsoft SQL Servermssql+pymssql://<Username>:<Password>@<Host>:<Port-default:1433>/<Database Name>
MySQLmysql+mysqlconnector://<UserName>:<Password>@<Host>/<Database Name>
PostgreSQLpostgresql://<UserName>:<Password>@<Host>/<Database Name>?sslmode=require
Prestopresto://<UserName>:<Password>@<Host>:<Port>/<Catalog>/<Schema>?protocol=https
Rocksetrockset://apikey:<Your API Key>@api.<Rockset Region>.rockset.com
Snowflakesnowflake://<Username>:<Password>@<Account>/<Database>?role=<Role>&warehouse=<Warehouse>
Teradatateradata://
Trinotrino://<Username>:<Password>@<Host>:<Port>/<Catalog>
Verticavertica+vertica_python://<UserName>:<Password>@<Host>/<Database Name>?ssl=1

Was this article helpful?

What's Next