SQLAlchemy adapter for IBM i
The IBM i SQLAlchemy adapter provides a SQLAlchemy interface to Db2 for IBM i.
Please note that this project is still under active development. Please report any bugs in the issue tracker :rotating_light:
import sqlalchemy as sa
# see documentation for available connection options
# pass connection options in url query string, eg.
# engine = sa.create_engine("ibmi://user:pass@host?autocommit=true&timeout=10"
# find usage of create_engine database urls here
# https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
# this is the base connection which connects to *LOCAL on the host
engine = sa.create_engine("ibmi://user:pass@host")
cnxn = engine.connect()
metadata = sa.MetaData()
table = sa.Table('table_name', metadata, autoload=True, autoload_with=engine)
query = sa.select([table])
result = cnxn.execute(query)
result = result.fetchall()
# print first entry
print(result[0])
Installation
pip install sqlalchemy-ibmi
Feature Support
- SQLAlchemy ORM - Python object based automatically constructed SQL
- SQLAlchemy Core - schema-centric SQL Expression Language
Documentation
The documentation for the SQLAlchemy adapter for IBM i can be found at: https://sqlalchemy-ibmi.readthedocs.io/en/latest/
Known Limitations
- Non-standard SQL queries are not supported. e.g. "SELECT ? FROM TAB1"
- For updations involving primary/foreign key references, the entries should be made in correct order. Integrity check is always on and thus the primary keys referenced by the foreign keys in the referencing tables should always exist in the parent table.
- Unique key which contains nullable column not supported
- UPDATE CASCADE for foreign keys not supported
- DEFERRABLE INITIALLY deferred not supported
- Subquery in ON clause of LEFT OUTER JOIN not supported
Contributing to the IBM i SQLAlchemy adapter
Please read the contribution guidelines.
The developer sign-off should include the reference to the DCO in remarks(example below):
DCO 1.1 Signed-off-by: Random J Developer <random@developer.org>
Releasing a New Version
# checkout and pull the latest code from master
git checkout master
git pull
# bump to a release version (a tag and commit are made)
bumpversion release
# To skip a release candidate
bumpversion --no-tag --no-commit release
bumpversion --allow-dirty release
# bump to the new dev version (a commit is made)
bumpversion --no-tag patch
# push the new tag and commits
git push origin master --tags
License
Credits
- ibm_db_sa for SQLAlchemy was first produced by IBM Inc., targeting version 0.4.
- The library was ported for version 0.6 and 0.7 by Jaimy Azle.
- Port for version 0.8 and modernization of test suite by Mike Bayer.
- Port for sqlalchemy-ibmi by Naveen Ram/Kevin Adler.
Metadata
Release files for crazy-ibmi 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crazy_ibmi-0.10.0.tar.gz | 29.3 kB | Without provenance | Details for crazy_ibmi-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crazy_ibmi-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for crazy_ibmi-0.10.0-py3-none-any.whl |
Total release size: 51.6 kB
Release files / crazy_ibmi-0.10.0.tar.gz
| Download URL | crazy_ibmi-0.10.0.tar.gz |
|---|---|
| Size | 29.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
169fc8da3e71b961d7c4bffe76422cea1963af403b12f6fd3ac8c8356f64f559
|
|
BLAKE2b-256 checksum How to use checksums |
215815a29a537ca92433e736fcc491a11068cde99f410cefb6fa52dba8731a43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.5 Linux/5.10.102.1-microsoft-standard-WSL2
|
Release files / crazy_ibmi-0.10.0-py3-none-any.whl
| Download URL | crazy_ibmi-0.10.0-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68061ae4bff7adfd50d4dfeebb99e87e71056af3f2da30573acc3c08ec255d4e
|
|
BLAKE2b-256 checksum How to use checksums |
955697c3f9bce113b90d6947a47a46a4ba8d6f409cb059482b546bcb81782797
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.5 Linux/5.10.102.1-microsoft-standard-WSL2
|
Security for crazy-ibmi 0.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.