SQLAlchemy is one of the most widely used object-relational mapping tools in the Python community. This Python SQL toolkit and Object Relational Mapper gives application developers the full power and flexibility of SQL. The FairCom DB SQL Python interface provides support for this technology. To use this support you will need to install Python 2.7 or 3.0 or higher, SQLAlchemy 1.0, and the FairCom DB SQL Python driver.
If you have an existing application that uses SQLAlchemy, simply install the FairCom DB SQL dialect for SQLAlchemy (as shown in Installing the FairCom DB SQLAlchemy Dialect) to begin taking advantage of the FairCom DB database.
For developers planning a new application and considering SQLAlchemy for its toolkit of SQL abstractions, the FairCom SQLAlchemy support allows you to take advantage of this powerful style of programming.
The FairCom Python interface supports the following versions of SQLAlchemy and Python:
For more about the FairCom Python interface, see the ReadMe provided in the \sdk\sql.python folder (\Driver\sql.python for FairCom RTG).
For more about SQLAlchemy, see their website, https://www.sqlalchemy.org/
Installing the FairCom DB SQLAlchemy Dialect
This package contains the FairCom DB SQL dialect for SQLAlchemy. The dialect enables using FairCom DB SQL with SQLAlchemy, the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. More details are available at SQLAlchemy.org.
Note: This driver was specifically developed and tested on SQLAlchemy 1.0.19 with both Python 2.7 and Python 3.5-3.9. It supports SQLAlchemy 1.0 and higher and Python 2.7 and Python 3.0 forward.
Installation
Reminder: setuptools and wheel are prerequisites before SQLAlchemy can be installed on Linux. If you do not have them installed, execute the following before installing SQLAlchemy:
pip install setuptools
pip install wheel
<faircom>\drivers\python.sql.sqlalchemy
Windows:
pip install sqlalchemy
python setup.py install
Linux:
pip3 install sqlalchemy
python3 setup.py install
If any steps have permission problems, use sudo to run that command.
If step 4 produces the following error, you will need to update your setuptools package:
setuptools_scm.version.SetuptoolsOutdatedWarning: your setuptools is too old (<12)
Un-install the old version of the Python setuptools package and install a later version, as follows:
After updating setuptools, try step 4 again.
SQL Enhancements
In FairCom DB Python, the following SQL enhancements have been implemented in the Cursor class:
The following enhancements have been implemented in Connection class: