Skip to main content

Firebird database backend for Django 5.0+

Project description

django-firebird

Firebird database backend for Django.

This package provides a Django database backend for Firebird, supporting versions 2.5, 3.0, 4.0, and 5.0+. It uses the firebird-driver library for connectivity.

Features

Feature Firebird 2.5 Firebird 3.0+ Firebird 4.0+ Firebird 5.0+
Basic ORM operations Yes Yes Yes Yes
Migrations Yes Yes Yes Yes
inspectdb command Yes Yes Yes Yes
Native BOOLEAN No Yes Yes Yes
Window functions No Yes Yes Yes
FILTER clause No Yes Yes Yes
Timezone support No No Yes Yes
SKIP LOCKED No No No Yes

Requirements

  • Python 3.11+
  • Django 5.0, 5.1, or 6.0
  • firebird-driver 1.10.0+
  • Firebird Server 2.5+

Installation

pip install django-firebird

Configuration

Configure your Django DATABASES setting:

DATABASES = {
    'default': {
        'ENGINE': 'django_firebird',
        'NAME': '/path/to/database.fdb',
        'USER': 'SYSDBA',
        'PASSWORD': 'masterkey',
    }
}

Remote Database

For remote connections, specify HOST and optionally PORT:

DATABASES = {
    'default': {
        'ENGINE': 'django_firebird',
        'NAME': '/path/to/database.fdb',
        'USER': 'SYSDBA',
        'PASSWORD': 'masterkey',
        'HOST': 'localhost',
        'PORT': '3050',
    }
}

Connection Options

Option Description Default
charset Character set for connection UTF8
fb_client_library Path to Firebird client library System default
DATABASES = {
    'default': {
        'ENGINE': 'django_firebird',
        'NAME': '/path/to/database.fdb',
        'USER': 'SYSDBA',
        'PASSWORD': 'masterkey',
        'OPTIONS': {
            'charset': 'UTF8',
            'fb_client_library': '/usr/lib/libfbclient.so',
        },
    }
}

Timezone Support (Firebird 4.0+)

DATABASES = {
    'default': {
        'ENGINE': 'django_firebird',
        'NAME': '/path/to/database.fdb',
        'USER': 'SYSDBA',
        'PASSWORD': 'masterkey',
        'TIME_ZONE': 'America/New_York',
    }
}

Notes on Django Fields

  • AutoField/BigAutoField: Uses Firebird generators (sequences) with triggers
  • BooleanField: Uses native BOOLEAN in Firebird 3.0+, SMALLINT in 2.5
  • TextField: Uses BLOB SUB_TYPE TEXT
  • JSONField: Not supported (Firebird has no native JSON type)
  • UUIDField: Uses CHAR(36) storage

Known Limitations

  • No JSON support: Firebird does not have a native JSON data type
  • No DISTINCT ON: Use other approaches for similar functionality
  • Single-row RETURNING: Bulk inserts with RETURNING not supported
  • DDL auto-commit: Schema changes cannot be rolled back within a transaction
  • Identifier length: 31 characters max in Firebird < 4.0, 63 in 4.0+

Using inspectdb

To inspect an existing Firebird database:

python manage.py inspectdb

For better results with foreign key ordering, use the enhanced command:

python manage.py inspectdb_firebird

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

Acknowledgments

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

django_firebird_backend-0.1.1.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_firebird_backend-0.1.1-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file django_firebird_backend-0.1.1.tar.gz.

File metadata

  • Download URL: django_firebird_backend-0.1.1.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_firebird_backend-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5395d9d8eac9cfa6fc75be9acfdefa88834b0db493a1e3bbde6ed9fe54546410
MD5 8b9b93eafc5024e87b86845addcd4ca4
BLAKE2b-256 81dd50392239ba540f524ff416f574a1e414b19d03b9c71ba9a9a6bb20d2ffba

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_firebird_backend-0.1.1.tar.gz:

Publisher: release.yml on joseanoxp/django-firebird-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_firebird_backend-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_firebird_backend-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 203ff1df6df8dffc6c671427100fa62dee2b49164d5adc3181b4ff2d617dab85
MD5 42e9b35908a2a44b7618972174392790
BLAKE2b-256 51934b61f89b2629a535054ad68d6ae449404a99509306cdbfc607b01c0bab76

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_firebird_backend-0.1.1-py3-none-any.whl:

Publisher: release.yml on joseanoxp/django-firebird-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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