Oninit® 4gl2everywhere — Migrate Off Informix Without Rewriting Your 4GL Portfolio
You inherited a stack of compiled Informix 4GL applications that have worked for years. The pressure to migrate off Informix — cost, support, vendor lock-in — never quite outweighs the cost of rewriting all of them. 4gl2everywhere lets you decouple the two decisions.
What runs through the bridge
Stock c4gl-compiled binaries connect to the bridge as if it were an Informix server. The bridge speaks the SQLI token stream — SQ_LOGIN_ASC, SQ_PROTOCOLS, SQ_DBOPEN, SQ_PREPARE, SQ_BIND, SQ_EXECUTE, SQ_NFETCH, SQ_CMMTWORK, SQ_RBWORK, SQ_DISCONNECT — and replies in the canonical SQ_DONE / SQ_ERR / SQ_TUPLE shapes the 4GL runtime expects.
SQL translation you can inspect
Each statement is parsed into an abstract syntax tree, lowered to a dialect-independent IR, and rewritten per target backend before execution. The pipeline is open: every stage is a separate translation unit, the AST/IR shape is visible at each step, and SQL trace files record the per-session statement stream for debugging. No opaque rewrite rules.
Per-backend semantics handled
The pluggable backend interface translates the Informix verbs into each target's native equivalent. SQ_DBOPEN — the 4GL DATABASE name statement — becomes SET search_path on PostgreSQL, mysql_select_db on MySQL, and ALTER SESSION SET CURRENT_SCHEMA on Oracle. Bind, fetch, begin, commit, and rollback dispatch through a uniform vtable that lets each backend handle its own dialect quirks behind the same interface.
Operational discipline
One pthread per session, configurable max_sessions per listener, and SQLCODE -746 with the canonical IFXBRIDGE:CONNECTION_LIMIT error when the cap is hit. SIGPIPE is ignored, no exit() runs in session threads, broken sessions cannot crash the listener. SIGTERM and SIGINT trigger graceful drain — stop accepting, finish in-flight sessions, exit cleanly. SIGHUP reloads logging and SQL trace settings without dropping sessions.
Multi-listener deployments
A single bridge process runs multiple listeners on different ports, each with its own backend, DSN, max-sessions cap, and optional log / sqltrace overrides. Per-listener overrides fall back to the global block field-by-field, so cross-cutting changes are one-line edits and per-listener exceptions are explicit.
SQL trace
Per-session SQL trace files under a configurable directory, with filename_pattern tokens (%p pid, %t timestamp, %s session id) so trace files are sortable per session. Each request emits a one-line summary — token name and byte count — suitable for both real-time tail and later forensics.
It runs as a normal Linux service. It speaks the protocol the 4GL binary already speaks. It tells you exactly what SQL it translated.