Skip to main content

sqlalchemy-firebirdsql

SQLAlchemy dialect for Firebird using pyfirebirdsql .

It based on sqlalchemy-firebird , thanks.

Requirements

It is difficult to support many versions, so I target newer versions.

  • Firebird 4.0+

  • SQLAlchemy 2.0+

  • Python 3.11+

Installation

pip install sqlalchemy_firebirdsql

Connection strings

A SQLAlchemy URL has the shape dialect+driver://username:password@host:port/database. For this dialect:

firebirdsql+syn://user:password@host:port/path/to/db[?key=value&key=value...]

For async:

firebirdsql+asyn://user:password@host:port/path/to/db[?key=value&key=value...]

The bare firebirdsql:// scheme defaults to the synchronous (syn) driver.

Examples

Local server, default port:

firebirdsql+syn://sysdba:masterkey@localhost//home/me/databases/my_project.fdb

Remote server on port 3050:

firebirdsql+syn://sysdba:masterkey@example.com:3050//srv/databases/my_project.fdb

Usage

Synchronous

from sqlalchemy import create_engine, text

engine = create_engine(
    "firebirdsql+syn://sysdba:masterkey@localhost//home/me/databases/my_project.fdb",
    echo=True,
)

with engine.connect() as conn:
    result = conn.execute(text("select 1 from rdb$database"))
    print(result.scalar())

Asynchronous

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

engine = create_async_engine(
    "firebirdsql+asyn://sysdba:masterkey@localhost//home/me/databases/my_project.fdb",
    echo=True,
)

async def main():
    async with engine.connect() as conn:
        result = await conn.execute(text("select 1 from rdb$database"))
        print(result.scalar())

asyncio.run(main())

How to test

git clone git@github.com:nakagami/sqlalchemy_firebirdsql.git
cd sqlalchemy_firebirdsql
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
prepare-test-environment
pip install pytest

Metadata

Release files for sqlalchemy-firebirdsql 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy-firebirdsql 0.2.0
File Size Uploaded
sqlalchemy_firebirdsql-0.2.0.tar.gz 54.1 kB Details

Release files / sqlalchemy_firebirdsql-0.2.0.tar.gz

Download URL sqlalchemy_firebirdsql-0.2.0.tar.gz
Size 54.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dc00bcd81f7d22fd963175da8cc01d793ca0138efe10372e748f8514515f5760
BLAKE2b-256 checksum
How to use checksums
8cc0266ff72ff093d58c78813b0c5cb7896e9008493ebc2b8b48831b03c88f80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page