sqlalchemy-firebird


Namesqlalchemy-firebird JSON
Version 2.1 PyPI version JSON
download
home_page
SummaryFirebird for SQLAlchemy
upload_time2024-01-09 21:21:30
maintainer
docs_urlNone
authorF.D.Castel
requires_python!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7
licenseCopyright 2005-2023 SQLAlchemy authors and contributors <see AUTHORS file>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords sqlalchemy firebird fdb firebird-driver
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sqlalchemy-firebird
###################

An external SQLAlchemy dialect for Firebird
===========================================
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
.. image:: https://github.com/pauldex/sqlalchemy-firebird/workflows/sqlalchemy-firebird/badge.svg
    :target: https://github.com/pauldex/sqlalchemy-firebird

----

Those who want to use the open source `Firebird <https://firebirdsql.org/en/start/>`_ database server with `Python <https://www.python.org>`_ using `SQLAlchemy <https://www.sqlalchemy.org>`_ need to provide a dialect that SQLAlchemy can use to communicate to the database, because Firebird is not among the included dialects.

This package provides a Firebird dialect for SQLAlchemy using the Python Database API 2.0 compliant support provided from  either `firebird-driver <https://firebird-driver.readthedocs.io/en/latest>`_ or `fdb <https://fdb.readthedocs.io/en/latest>`_.

----

**Installation**

The pip command to install the sqlalchemy-firebird package is::

    pip install sqlalchemy-firebird

If you are using Python 3.8+, installing sqlalchemy-firebird will automatically install SQLAlchemy 2.0+ and firebird-driver.  This configuration can be used to access Firebird server versions 3 and up.  If you need to access a Firebird version 2.5 server, just install fdb using pip::

    pip install fdb

If you are using a version of Python less than 3.8, SQLAlchemy 1.4+ and fdb are automatically installed, which can only be used for Firebird server versions 2.5.9 and 3.0+.

----

**Getting Started**

The first thing you need when connecting your application to the database using SQLAlchemy is an engine object, obtained by calling *create_engine* with the appropriate parameters.  This can be a connection string (also known as a database uniform resource identifier/locator, *dburi* or *dburl* for short), or the URL object returned by calling *create* from sqlalchemy.engine.URL.

The following information is needed to make the connection string:

- <driver_name> - which driver to use; 'firebird' to use firebird-driver, or 'fdb' to use the fdb driver
- <username> - Firebird default is 'sysdba'
- <password> - Firebird default is 'masterkey'
- <host> - the location of the database server
- <port> - Firebird default is '3050'
- <database_path> - location of the database file
- <charset> - character set used by the database file, Firebird default is UTF8
- <client_library_path> - path to the firebird client library file.  Linux needs 'libfbclient.so', Windows uses fblient.dll.  This is only needed when using the embedded server or a remotely installed server.

Connection Strings

A typical connection string for SQLAlchemy is *dialect+driver://username:password@host:port/database*.

The template for a Firebird connection string looks like this (using the information listed above):
::

    firebird+<driver_name>://<username>:<password>@<host>:<port>/<database_path>[?charset=UTF8&key=value&key=value...]

Note the only differences between the Linux and Windows versions of the following example configuration strings is that the Linux paths begin with '//home/testuser' while the Windows paths begin with 'c:/':


- The simplest configuration string is for the Firebird server installed locally using the default port.

::

    [Linux]
    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)
    firebird+fdb://sysdba:masterkey@localhost///home/testuser/projects/databases/my_project.fdb
    # Use the firebird-driver driver (Python 3.8+, Firebird server 3.0 or greater)
    firebird+firebird://sysdba:masterkey@localhost///home/testuser/projects/databases/my_project.fdb

    [Windows]
    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)
    firebird+fdb://sysdba:masterkey@localhost/c:/projects/databases/my_project.fdb
    # Use the firebird-driver driver (Python 3.8+, Firebird server 3.0 or greater)
    firebird+firebird://sysdba:masterkey@localhost/c:/projects/databases/my_project.fdb

- Firebird server installed remotely using port 3040 and specifying the character set to use

::

    [Linux]
    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)
    firebird+fdb://sysdba:masterkey@localhost:3040///home/testuser/databases/my_project.fdb?charset=UTF8&fb_library_name=//home/testuser/dbclient/lib/libfbclient.so
    # Use the firebird-driver driver (Python 3.8+)
    firebird+firebird://sysdba:masterkey@localhost:3040///home/testuser/databases/my_project.fdb?charset=UTF8&fb_client_library=//home/testuser/dbclient/lib/libfbclient.so

    [Windows]
    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)
    firebird+fdb://sysdba:masterkey@localhost:3040/c:/projects/databases/my_project.fdb?charset=UTF8&fb_library_name=c:/projects/dbclient/fbclient.dll
    # Use the firebird-driver driver (Python 3.8+)
    firebird+firebird://sysdba:masterkey@localhost:3040/c:/projects/databases/my_project.fdb?charset=UTF8&fb_client_library=c:/projects/dbclient/fbclient.dll

- Firebird embedded server specifying the character set to use

::

    [Linux]
    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)
    firebird+fdb://sysdba@///home/testuser/databases/my_project.fdb?charset=UTF8&fb_library_name=//home/testuser/dbserver/lib/libfbclient.so
    # Use the firebird-driver driver (Python 3.8+)
    firebird+firebird://sysdba@///home/testuser/databases/my_project.fdb?charset=UTF8&fb_client_library=//home/testuser/dbserver/lib/libfbclient.so

    [Windows]
    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)
    firebird+fdb://sysdba@/c:/projects/databases/my_project.fdb?charset=UTF8&fb_library_name=c:/projects/dbserver/fbclient.dll
    # Use the firebird-driver driver (Python 3.8+)
    firebird+firebird://sysdba@/c:/projects/databases/my_project.fdb?charset=UTF8&fb_client_library=c:/projects/dbserver/fbclient.dll


----

**How to use**

For example, to connect to an embedded Firebird server using firebird-driver on Windows:

::

    db_uri = "firebird+firebird://sysdba@/c:/projects/databases/my_project.fdb?charset=UTF8&fb_client_library=c:/projects/databases/fb40_svr/fbclient.dll"
    from sqlalchemy import create_engine
    engine = create_engine(db_uri, echo=True)
    
    # force the engine to connect, revealing any problems with the connection string
    with engine.begin():
        pass

Connecting to different types of Firebird servers, databases, or drivers is done simply by changing the db_uri string
used in the call to create_engine.

----

**Code of Conduct**

As with SQLAlchemy, sqlalchemy-firebird places great emphasis on polite, thoughtful, and
constructive communication between users and developers.
We use the SQLAlchemy `Code of Conduct <http://www.sqlalchemy.org/codeofconduct.html>`_.

----

**License**

sqlalchemy-firebird is distributed under the `MIT license
<http://www.opensource.org/licenses/mit-license.php>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sqlalchemy-firebird",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7",
    "maintainer_email": "Paul Graves-DesLauriers <paul@dexmicro.com>",
    "keywords": "SQLAlchemy,Firebird,fdb,firebird-driver",
    "author": "F.D.Castel",
    "author_email": "Paul Graves-DesLauriers <paul@dexmicro.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/6d/0f5d5ec6d7e4516f37df01ba01b5b7c46db250ec5a700b9847359c765624/sqlalchemy-firebird-2.1.tar.gz",
    "platform": null,
    "description": "sqlalchemy-firebird\r\n###################\r\n\r\nAn external SQLAlchemy dialect for Firebird\r\n===========================================\r\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\r\n    :target: https://github.com/psf/black\r\n.. image:: https://github.com/pauldex/sqlalchemy-firebird/workflows/sqlalchemy-firebird/badge.svg\r\n    :target: https://github.com/pauldex/sqlalchemy-firebird\r\n\r\n----\r\n\r\nThose who want to use the open source `Firebird <https://firebirdsql.org/en/start/>`_ database server with `Python <https://www.python.org>`_ using `SQLAlchemy <https://www.sqlalchemy.org>`_ need to provide a dialect that SQLAlchemy can use to communicate to the database, because Firebird is not among the included dialects.\r\n\r\nThis package provides a Firebird dialect for SQLAlchemy using the Python Database API 2.0 compliant support provided from  either `firebird-driver <https://firebird-driver.readthedocs.io/en/latest>`_ or `fdb <https://fdb.readthedocs.io/en/latest>`_.\r\n\r\n----\r\n\r\n**Installation**\r\n\r\nThe pip command to install the sqlalchemy-firebird package is::\r\n\r\n    pip install sqlalchemy-firebird\r\n\r\nIf you are using Python 3.8+, installing sqlalchemy-firebird will automatically install SQLAlchemy 2.0+ and firebird-driver.  This configuration can be used to access Firebird server versions 3 and up.  If you need to access a Firebird version 2.5 server, just install fdb using pip::\r\n\r\n    pip install fdb\r\n\r\nIf you are using a version of Python less than 3.8, SQLAlchemy 1.4+ and fdb are automatically installed, which can only be used for Firebird server versions 2.5.9 and 3.0+.\r\n\r\n----\r\n\r\n**Getting Started**\r\n\r\nThe first thing you need when connecting your application to the database using SQLAlchemy is an engine object, obtained by calling *create_engine* with the appropriate parameters.  This can be a connection string (also known as a database uniform resource identifier/locator, *dburi* or *dburl* for short), or the URL object returned by calling *create* from sqlalchemy.engine.URL.\r\n\r\nThe following information is needed to make the connection string:\r\n\r\n- <driver_name> - which driver to use; 'firebird' to use firebird-driver, or 'fdb' to use the fdb driver\r\n- <username> - Firebird default is 'sysdba'\r\n- <password> - Firebird default is 'masterkey'\r\n- <host> - the location of the database server\r\n- <port> - Firebird default is '3050'\r\n- <database_path> - location of the database file\r\n- <charset> - character set used by the database file, Firebird default is UTF8\r\n- <client_library_path> - path to the firebird client library file.  Linux needs 'libfbclient.so', Windows uses fblient.dll.  This is only needed when using the embedded server or a remotely installed server.\r\n\r\nConnection Strings\r\n\r\nA typical connection string for SQLAlchemy is *dialect+driver://username:password@host:port/database*.\r\n\r\nThe template for a Firebird connection string looks like this (using the information listed above):\r\n::\r\n\r\n    firebird+<driver_name>://<username>:<password>@<host>:<port>/<database_path>[?charset=UTF8&key=value&key=value...]\r\n\r\nNote the only differences between the Linux and Windows versions of the following example configuration strings is that the Linux paths begin with '//home/testuser' while the Windows paths begin with 'c:/':\r\n\r\n\r\n- The simplest configuration string is for the Firebird server installed locally using the default port.\r\n\r\n::\r\n\r\n    [Linux]\r\n    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)\r\n    firebird+fdb://sysdba:masterkey@localhost///home/testuser/projects/databases/my_project.fdb\r\n    # Use the firebird-driver driver (Python 3.8+, Firebird server 3.0 or greater)\r\n    firebird+firebird://sysdba:masterkey@localhost///home/testuser/projects/databases/my_project.fdb\r\n\r\n    [Windows]\r\n    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)\r\n    firebird+fdb://sysdba:masterkey@localhost/c:/projects/databases/my_project.fdb\r\n    # Use the firebird-driver driver (Python 3.8+, Firebird server 3.0 or greater)\r\n    firebird+firebird://sysdba:masterkey@localhost/c:/projects/databases/my_project.fdb\r\n\r\n- Firebird server installed remotely using port 3040 and specifying the character set to use\r\n\r\n::\r\n\r\n    [Linux]\r\n    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)\r\n    firebird+fdb://sysdba:masterkey@localhost:3040///home/testuser/databases/my_project.fdb?charset=UTF8&fb_library_name=//home/testuser/dbclient/lib/libfbclient.so\r\n    # Use the firebird-driver driver (Python 3.8+)\r\n    firebird+firebird://sysdba:masterkey@localhost:3040///home/testuser/databases/my_project.fdb?charset=UTF8&fb_client_library=//home/testuser/dbclient/lib/libfbclient.so\r\n\r\n    [Windows]\r\n    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)\r\n    firebird+fdb://sysdba:masterkey@localhost:3040/c:/projects/databases/my_project.fdb?charset=UTF8&fb_library_name=c:/projects/dbclient/fbclient.dll\r\n    # Use the firebird-driver driver (Python 3.8+)\r\n    firebird+firebird://sysdba:masterkey@localhost:3040/c:/projects/databases/my_project.fdb?charset=UTF8&fb_client_library=c:/projects/dbclient/fbclient.dll\r\n\r\n- Firebird embedded server specifying the character set to use\r\n\r\n::\r\n\r\n    [Linux]\r\n    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)\r\n    firebird+fdb://sysdba@///home/testuser/databases/my_project.fdb?charset=UTF8&fb_library_name=//home/testuser/dbserver/lib/libfbclient.so\r\n    # Use the firebird-driver driver (Python 3.8+)\r\n    firebird+firebird://sysdba@///home/testuser/databases/my_project.fdb?charset=UTF8&fb_client_library=//home/testuser/dbserver/lib/libfbclient.so\r\n\r\n    [Windows]\r\n    # Use the fdb driver (Python 3.6/3.7, or Firebird server 2.5.9)\r\n    firebird+fdb://sysdba@/c:/projects/databases/my_project.fdb?charset=UTF8&fb_library_name=c:/projects/dbserver/fbclient.dll\r\n    # Use the firebird-driver driver (Python 3.8+)\r\n    firebird+firebird://sysdba@/c:/projects/databases/my_project.fdb?charset=UTF8&fb_client_library=c:/projects/dbserver/fbclient.dll\r\n\r\n\r\n----\r\n\r\n**How to use**\r\n\r\nFor example, to connect to an embedded Firebird server using firebird-driver on Windows:\r\n\r\n::\r\n\r\n    db_uri = \"firebird+firebird://sysdba@/c:/projects/databases/my_project.fdb?charset=UTF8&fb_client_library=c:/projects/databases/fb40_svr/fbclient.dll\"\r\n    from sqlalchemy import create_engine\r\n    engine = create_engine(db_uri, echo=True)\r\n    \r\n    # force the engine to connect, revealing any problems with the connection string\r\n    with engine.begin():\r\n        pass\r\n\r\nConnecting to different types of Firebird servers, databases, or drivers is done simply by changing the db_uri string\r\nused in the call to create_engine.\r\n\r\n----\r\n\r\n**Code of Conduct**\r\n\r\nAs with SQLAlchemy, sqlalchemy-firebird places great emphasis on polite, thoughtful, and\r\nconstructive communication between users and developers.\r\nWe use the SQLAlchemy `Code of Conduct <http://www.sqlalchemy.org/codeofconduct.html>`_.\r\n\r\n----\r\n\r\n**License**\r\n\r\nsqlalchemy-firebird is distributed under the `MIT license\r\n<http://www.opensource.org/licenses/mit-license.php>`_.\r\n",
    "bugtrack_url": null,
    "license": "Copyright 2005-2023 SQLAlchemy authors and contributors <see AUTHORS file>.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Firebird for SQLAlchemy",
    "version": "2.1",
    "project_urls": {
        "Documentation": "https://github.com/pauldex/sqlalchemy-firebird/wiki",
        "Source": "https://github.com/pauldex/sqlalchemy-firebird",
        "Tracker": "https://github.com/pauldex/sqlalchemy-firebird/issues"
    },
    "split_keywords": [
        "sqlalchemy",
        "firebird",
        "fdb",
        "firebird-driver"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70e40e738f19fa5040b890f2fef7d43c15e169042c1991e31ba7a0a9569a740d",
                "md5": "e33970be83a516cce20cc78749a0875a",
                "sha256": "cd2010ac3c0f2bd425d4d68f259dc4e17c5fa5b32539a7e95196865d95e54317"
            },
            "downloads": -1,
            "filename": "sqlalchemy_firebird-2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e33970be83a516cce20cc78749a0875a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7",
            "size": 39785,
            "upload_time": "2024-01-09T21:21:28",
            "upload_time_iso_8601": "2024-01-09T21:21:28.239639Z",
            "url": "https://files.pythonhosted.org/packages/70/e4/0e738f19fa5040b890f2fef7d43c15e169042c1991e31ba7a0a9569a740d/sqlalchemy_firebird-2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "906d0f5d5ec6d7e4516f37df01ba01b5b7c46db250ec5a700b9847359c765624",
                "md5": "b2b222901478574824d3f8624012ccc4",
                "sha256": "ddb50ab02bbd6c7140947930dd0d4df07520b608881dee8ad022bc994cc8a95d"
            },
            "downloads": -1,
            "filename": "sqlalchemy-firebird-2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b2b222901478574824d3f8624012ccc4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7",
            "size": 54291,
            "upload_time": "2024-01-09T21:21:30",
            "upload_time_iso_8601": "2024-01-09T21:21:30.178174Z",
            "url": "https://files.pythonhosted.org/packages/90/6d/0f5d5ec6d7e4516f37df01ba01b5b7c46db250ec5a700b9847359c765624/sqlalchemy-firebird-2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-09 21:21:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pauldex",
    "github_project": "sqlalchemy-firebird",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "sqlalchemy-firebird"
}
        
Elapsed time: 0.16076s