--- id: ibm-db-sa version: "0.4.4" license: Apache-2.0 license_treatment: permissive maintenance: active --- # ibm-db-sa — SQLAlchemy support for IBM Data Servers License: permissive · Maintenance: active · Downloads: 473.1K/mo ## What it is and what it does IBM_DB_SA is a SQLAlchemy dialect that bridges Python applications to IBM DB2 databases. It translates SQLAlchemy's ORM queries and expression language into DB2-compatible SQL, handling connection management, schema reflection, and type mapping. The adapter supports both TCP/IP and local socket connections and includes built-in logging for debugging connection, reflection, and SQL execution issues. The package integrates with ibm_db, the underlying DB2 driver, and works with SQLAlchemy versions 0.7.3 through 2.0.x. It supports DB2 on Linux, Unix, Windows, Cloud, ZOS, and iSeries platforms. Developers use it to write database code in Python without writing raw DB2 SQL, leveraging SQLAlchemy's portability and ORM features. Use it for: - Build a web application using SQLAlchemy ORM that persists data to an existing IBM DB2 database without writing raw SQL. - Migrate application logic from another database to DB2 by swapping the connection string and dialect. - Debug connection and SQL execution issues in a DB2-backed application using the built-in logging parameter. - Reflect DB2 schema metadata into Python objects to auto-generate ORM models from an existing database. - Write data integration scripts that read from DB2 and transform records using SQLAlchemy's query API. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. SQLAlchemy dialect adapter that enables Python applications to connect to and query IBM DB2 databases using SQLAlchemy's ORM and query interface. Yes. The adapter is actively maintained, has no known vulnerabilities, installs with low friction, and is the standard way to use SQLAlchemy with DB2. Install it if you need SQLAlchemy ORM support for IBM DB2 databases. The main constraint is that ibm_db must be installed separately and DB2 has some known SQL limitations (documented in the package) that may affect complex queries. ## Install pip install ibm-db-sa uv add ibm-db-sa poetry add ibm-db-sa ## Installing ibm-db-sa Before you install: Low friction installation via pip with only two runtime dependencies (sqlalchemy and ibm_db). Repository is actively maintained with recent commits and no known vulnerabilities. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install ibm_db_sa from sqlalchemy import create_engine engine = create_engine("db2+ibm_db://user:pass@host:port/database") connection = engine.connect() result = connection.execute("SELECT * FROM table") Requires ibm_db driver 1.0.1 or higher installed separately; SQLAlchemy version between 0.7.3 and 2.0.x; Python 3.8 or newer. Verify before relying: - Whether the adapter supports all SQLAlchemy 2.0.x features or has compatibility gaps with newer versions. - Performance characteristics and connection pooling behavior under high concurrency. - Whether logging to file paths with special characters works reliably on all platforms. ## Package facts - License: Apache-2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 473.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sqlalchemy db2 adapter, ibm db2 python orm, sqlalchemy ibm data servers, db2 database driver sqlalchemy, ibm db2 connection pool, sqlalchemy dialect db2, sqlalchemy-dialect, db2-driver, orm-adapter [View on SkillFed](https://skillfed.io/packages/ibm-db-sa) · [View on PyPI](https://pypi.org/project/ibm-db-sa/)