Skip to main content

Sqlalchemy adapter for Firebolt

Project description

SQLAlchemy and Firebolt


Unit tests Code quality checks Firebolt Security Scan Integration tests Coverage

The Firebolt dialect for SQLAlchemy. firebolt-sqlalchemy uses Firebolt's Python SDK which implements PEP 249.


Requires Python >=3.7.

pip install firebolt-sqlalchemy


Connection strings use the following structure:


engine_name is optional. If omitted, Firebolt will use the default engine for the database.

account_name is optional. If omitted a default account will be used for connection.



If a different account name is required, it can be specified in the connection string


To override the API URL (e.g. for dev testing):

export FIREBOLT_BASE_URL=<your_url>

If your password contains % or / characters they need to be sanitised as per

my_pass = "0920%/2"
import urllib.parse
new_pass = urllib.parse.quote_plus(my_pass)

Quick Start

import urllib.parse
from sqlalchemy import create_engine

password = urllib.parse.quote_plus("your_password_here")
engine = create_engine("firebolt://email@domain:" + password + "@sample_database/sample_engine")
connection = engine.connect()

connection.execute("CREATE FACT TABLE example(dummy int) PRIMARY INDEX dummy")
connection.execute("INSERT INTO example(dummy) VALUES (11)")
result = connection.execute("SELECT * FROM example")
for item in result.fetchall():

AsyncIO extension

import urllib.parse
from sqlalchemy import text
from sqlalchemy.ext.asyncio import create_async_engine

password = urllib.parse.quote_plus("your_password_here")
engine = create_async_engine("asyncio+firebolt://email@domain:" + password + "@sample_database/sample_engine")

async with engine.connect() as conn:

    await conn.execute(
        text(f"INSERT INTO example(dummy) VALUES (11)")

    result = await conn.execute(
        text(f"SELECT * FROM example")

await engine.dispose()


  1. Transactions are not supported since Firebolt database does not support them at this time.
  2. Parametrised calls to execute and executemany are not implemented.



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firebolt_sqlalchemy-0.9.1.tar.gz (11.4 kB view hashes)

Uploaded source

Built Distribution

firebolt_sqlalchemy-0.9.1-py3-none-any.whl (12.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page