Configuration & env flags
Environment variables
Section titled “Environment variables”| Variable | Default | Effect |
|---|---|---|
IFX_BUFFERED_READER | 1 | Enable connection-scoped read buffer (Phase 39). Set to 0 to disable. |
IFX_DEBUG_WIRE | unset | When set to a truthy value, log wire-level PDU framing to stderr. Verbose; for debugging only. |
IFX_PROTOCOL_TRACE | unset | When set to a path, write annotated wire captures to the file. |
IFX_DISABLE_PIPELINE | unset | Disables pipelined executemany (Phase 33). Use only to A/B-measure. |
INFORMIXSERVER | — | Read by connect() if server= is not provided. |
Environment variables are read at connection construction. Changing them at runtime doesn’t affect existing connections.
Connection arguments
Section titled “Connection arguments”Full keyword list for informix_db.connect():
| Arg | Type | Default | Notes |
|---|---|---|---|
host | str | required | TCP host. |
port | int | 9088 | TCP port. 9089 is the typical TLS listener. |
user | str | required | |
password | str | required | |
database | str | None | required | None logs in without selecting a DB. |
server | str | required | DBSERVERNAME, not hostname. |
autocommit | bool | False | |
connect_timeout | float | None | None | TCP+login timeout. |
read_timeout | float | None | None | Per-read timeout. |
keepalive | bool | False | SO_KEEPALIVE. |
client_locale | str | "en_US.8859-1" | See SQL ↔ Python types for codec mapping. |
env | dict[str, str] | None | None | Server-side session env. |
tls | bool | ssl.SSLContext | False | See Connect with TLS. |
Pool tunables
Section titled “Pool tunables”| Arg | Default | Effect |
|---|---|---|
min_size | 1 | Connections to pre-warm at create time. |
max_size | 10 | Hard cap. |
acquire_timeout | 30.0 | Raise PoolTimeout after this many seconds. |
max_idle | 600.0 | Close connections idle longer than this (seconds). |
health_check | True | Validate idle connections before returning from the pool. |
All other connection arguments are forwarded to each pool-created connection.
Server-side session env
Section titled “Server-side session env”The env={} parameter of connect() sets server session variables sent in the login PDU:
informix_db.connect( ..., env={ "OPT_GOAL": "-1", # optimize for first-row return "OPTOFC": "1", # auto-free cursors at fetch-close "IFX_AUTOFREE": "1", },)CLIENT_LOCALE is set automatically from client_locale= — don’t put it in env=.