Ryan Malloy f546f951c8 Phase 6.f: BYTE/TEXT/BLOB/CLOB protocol research (deferred to Phase 8+)
Empirical and source-level investigation of the LOB type families.
Findings:

* BYTE/TEXT (type 11/12) cannot be inserted via SQL literals — even
  dbaccess with `INSERT INTO t VALUES (1, "0x...")` returns -617
  "A blob data type must be supplied within this context". The server
  requires a binary BBIND wire path. Hard restriction.

* BYTE/TEXT wire protocol: SQ_BIND sends a 56-byte descriptor as the
  inline placeholder, then a separate SQ_BBIND (41) PDU declares blob
  count, then chunked SQ_BLOB (39) tags stream the actual bytes (max
  1024 bytes/chunk per JDBC's sendStreamBlob).

* BLOB/CLOB (type 101/102) are even more involved — smart-LOBs use an
  LO_OPEN/LO_READ/LO_WRITE/LO_CLOSE session protocol against sbspace,
  with locators carried inline in SQ_TUPLE.

* Server-side setup confirmed working: blobspace1 + sbspace1 + logged
  database (testdb) are now available in the dev container for future
  Phase 8/9 implementation.

Both LOB families require materially more state-machine work than the
single-PDU codec types (DECIMAL/DATETIME/INTERVAL). Splitting into
Phase 8 (BYTE/TEXT) and Phase 9 (BLOB/CLOB) lets each get focused
attention rather than half-implementing both.

The SQ_BBIND, SQ_BLOB, SQ_FETCHBLOB, SQ_SBBIND, SQ_FILE_READ,
SQ_FILE_WRITE constants are already declared in _messages.py from
Phase 1 scaffolding — protocol layer is ready when implementation
lands.

For users who need binary data <32K today: LVARCHAR via str encoded
with iso-8859-1 is a viable interim path.
2026-05-04 12:37:46 -06:00

informix-db

Pure-Python driver for IBM Informix IDS, speaking the SQLI wire protocol over raw sockets. No IBM Client SDK. No JVM. No native libraries.

Status

🟢 Phase 1 complete. connect() / close() work end-to-end against a real Informix server. Cursor / execute / fetch land in Phase 2.

To our knowledge this is the first pure-socket Informix driver in any language — every other Informix driver (IfxPy, the legacy informixdb, ODBC bridges, Perl DBD::Informix) wraps either IBM's CSDK or the JDBC JAR.

Quick start

import informix_db

with informix_db.connect(
    host="127.0.0.1", port=9088,
    user="informix", password="in4mix",
    database="sysmaster", server="informix",
) as conn:
    # cursor() / execute() / fetchone() arrive in Phase 2
    pass

Test against the official Informix dev container

docker compose -f tests/docker-compose.yml up -d   # IBM Developer Edition, pinned by digest
uv sync --extra dev
uv run pytest                  # 34 unit tests (no Docker needed)
uv run pytest -m integration   # 6 integration tests (needs the container)

Phase 0 artifacts (still useful — they ARE the public reference)

License

MIT.

Description
Pure-Python driver for IBM Informix IDS — speaks the SQLI wire protocol over a raw socket. No CSDK, no JVM, no native libraries.
https://informix-db.warehack.ing
Readme MIT 716 KiB
Languages
Python 85.6%
MDX 8.1%
CSS 2.1%
Java 1.7%
Astro 1%
Other 1.4%