Skip to content

API surface

The top-level surface of informix_db and informix_db.aio. For full PEP 249 details, see the standard’s DB-API 2.0 spec.

import informix_db
informix_db.connect(...) -> Connection
informix_db.create_pool(...) -> Pool
informix_db.apilevel # "2.0"
informix_db.threadsafety # 1
informix_db.paramstyle # "numeric"
from informix_db import aio
await aio.connect(...) -> aio.Connection
await aio.create_pool(...) -> aio.Pool
informix_db.connect(
*,
host: str,
port: int = 9088,
user: str,
password: str,
database: str | None,
server: str, # DBSERVERNAME (not hostname)
autocommit: bool = False,
connect_timeout: float | None = None,
read_timeout: float | None = None,
keepalive: bool = False,
client_locale: str = "en_US.8859-1",
env: dict[str, str] | None = None,
tls: bool | ssl.SSLContext = False,
) -> Connection
Method / propertyDescription
cursor()Returns a new Cursor.
commit()Commits the current transaction.
rollback()Rolls back the current transaction.
close()Closes the connection. Idempotent.
transaction()Context manager — commits on success, rolls back on exception.
fast_path_call(routine, *args)Direct UDF/SPL invocation, bypassing PREPARE/EXECUTE/FETCH.
encodingResolved Python codec for client_locale.
autocommitRead-only after connect; set via connect(autocommit=...).
closedTrue after close().
Method / propertyDescription
execute(sql, params=())Prepare + execute. Returns the cursor.
executemany(sql, seq_of_params)Pipelined batch execute.
fetchone()One row tuple, or None.
fetchmany(size=arraysize)List of row tuples.
fetchall()All remaining rows.
scroll(value, mode="relative")Scrollable cursor positioning.
read_blob_column(sql, params)Read a BLOB column → bytes.
write_blob_column(sql, blob_data, params)Write a BLOB column.
read_clob_column(sql, params)Read a CLOB column → str.
write_clob_column(sql, clob_data, params)Write a CLOB column.
close()Closes the cursor + releases server resources.
descriptionSequence of column descriptors per PEP 249.
rowcountAffected row count for DML; -1 for SELECT.
arraysizeDefault fetchmany() size.
lastrowidServer-assigned key for the last single-row INSERT.
MethodDescription
connection()Context manager yielding a connection from the pool.
close()Closes all idle connections; waits for in-use to return.
closedTrue after close().
sizeCurrent pool size.
idle_countConnections currently idle in the pool.

aio.Pool is identical except its connection() is an async context manager and close() is async.

Error
├── Warning
└── DatabaseError
├── InterfaceError
├── DataError
├── OperationalError
│ └── PoolTimeout
├── IntegrityError
├── InternalError
├── ProgrammingError
└── NotSupportedError

See Exceptions & error codes for the SQLCODE → exception mapping.