{"id":22402,"library":"sqlalchemy-ibmi","title":"SQLAlchemy IBM i (Db2)","description":"Provides SQLAlchemy dialects for Db2 on IBM i (AS/400), enabling ORM and core SQL access. Current version 0.9.3, supporting Python >=3.6.2. Maintained as part of the IBM i open source ecosystem.","status":"active","version":"0.9.3","language":"python","source_language":"en","source_url":"https://github.com/IBM/sqlalchemy-ibmi","tags":["sqlalchemy","db2","ibmi","as400","database","odbc"],"install":[{"cmd":"pip install sqlalchemy-ibmi","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Core dependency for ORM and engine","package":"sqlalchemy","optional":false},{"reason":"Default DB-API driver for IBM i (non-optional via pip extras)","package":"pyodbc","optional":true}],"imports":[{"note":"The library registers itself as a SQLAlchemy dialect; you never import sqlalchemy_ibmi directly. Use the ibmi:// URL scheme.","wrong":"import sqlalchemy_ibmi\nengine = sqlalchemy_ibmi.connect()","symbol":"ibmi","correct":"from sqlalchemy import create_engine\nengine = create_engine('ibmi://user:password@host/database')"}],"quickstart":{"code":"from sqlalchemy import create_engine\nengine = create_engine('ibmi://user:password@host/database')\nwith engine.connect() as conn:\n    result = conn.execute(\"SELECT * FROM SYSIBM.SYSDUMMY1\")\n    print(result.fetchone())","lang":"python","description":"Minimal working example: connect to IBM i via ibmi:// URL and run a query."},"warnings":[{"fix":"pip install sqlalchemy-ibmi[pyodbc]","message":"The default driver is pyodbc. If pyodbc is not installed, you will get an ImportError about 'ibmi_db_api'. Install sqlalchemy-ibmi with the 'pyodbc' extra: pip install sqlalchemy-ibmi[pyodbc]","severity":"gotcha","affected_versions":"all"},{"fix":"Use create_engine with future=True: create_engine('ibmi://...', future=True) or simply upgrade to latest.","message":"SQLAlchemy 2.0 changed the future import pattern. sqlalchemy-ibmi <0.9.x may not support SQLAlchemy 2.0 fully. Ensure you are on 0.9.3 and use SQLAlchemy 2.0 compatible code.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Switch to ibmi://user:password@host/database","message":"The old connection string format with pyodbc:// is being deprecated. Prefer ibmi://.","severity":"deprecated","affected_versions":"<0.9.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install sqlalchemy-ibmi>=0.9.0","cause":"The sqlalchemy-ibmi package is not installed, or the version is too old to register the dialect.","error":"sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:ibmi"},{"fix":"pip install sqlalchemy-ibmi[pyodbc] (installs pyodbc) or install an alternative driver like itoolkit.","cause":"Missing DB-API driver. pyodbc is the recommended driver but not installed or not found.","error":"ModuleNotFoundError: No module named 'ibmi_db_api'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}