Oninit Logo
The Down System Specialists
+1-913-732-8892
+44-2081-337529
Partnerships Contact
Overview
Output Modes
HTML JSON PDF
Try It
Convert SQL
Download
Download
Reference
Glossary

Oninit® QueryLens — Overview

QueryLens is a Unix-style command-line tool that reads an Informix dbschema dump from standard input and emits a rendered, cross-referenced view of the schema. A single binary, no daemon, no library, no GUI — designed to compose with shell pipelines and make rules:

dbschema -d mydb -ss | sql2html -h "mydb schema" -s -2 > mydb.html
gunzip -c sysmaster.gz | sql2html --json > sysmaster.json
gunzip -c sysmaster.gz | sql2html --pdf sysmaster.pdf -h "sysmaster"

What it produces

One binary, three output modes — selected per-invocation by a flag, mutually exclusive on a single run. All three are driven by the same parser and the same in-memory object registry, so the anchor scheme used in the HTML output, the anchor field in the JSON output, and the named destinations in the PDF output all match verbatim. Anything that knows one knows the others.

ModeFlagDetail
HTML --html (default) Syntax-highlighted, hyperlinked schema rendered to stdout. The default mode — emits a fragment for embedding, or a full document with -h.
JSON -j, --json Machine-readable dump of every registered object plus a flat list of resolved cross-references. The contract for downstream tooling.
PDF -p, --pdf <path> Bookmarked PDF: cover, hyperlinked summary, syntax-highlighted source body, two-level outline tree. PDF anchors match the HTML scheme so external link generators work unchanged.

How parsing works

The schema is treated as a stream of SQL/SPL tokens. Each CREATE statement registers a named object — table, view, index, trigger, routine, UDT, synonym, aggregate — into an in-memory object list. References to those objects elsewhere in the input (column types referencing UDTs, foreign-key targets, EXECUTE PROCEDURE calls, view source tables) are resolved against the list and rendered as cross-links in the HTML and PDF outputs, and as structured references entries in the JSON output.

Two-pass mode (-2) re-parses the input after the first pass completes so forward references resolve cleanly — references that appear before the corresponding CREATE in the source. In single-pass mode such references fall through as plain text.

Command-line flags

FlagDetail
--html(default) Emit HTML to stdout.
-j, --jsonEmit JSON to stdout.
-p, --pdf <out>Emit PDF to <out>. A path is required because PDF is binary.
-h <title>(HTML / PDF) Document title for the wrapper / cover page. Persisted as source.title in the JSON.
-s(HTML) Emit summary section. PDF always includes summary; JSON has the object list instead.
-t <n>Tab-stop width for source rendering.
-2Two-pass parse for forward references. Applies to all output modes.
-d, -i, -oDefault dbname, dbserver, owner applied to objects without explicit qualifiers.

Exit codes

CodeDetail
0Success.
1Unrecognized flag, mutually-exclusive output modes, or missing required argument.
2I/O error reading stdin or writing the output file.

The parser itself never aborts on malformed SQL; unrecognized constructs are skipped one token at a time so the rest of the input still produces useful output.

To discuss how Oninit ® can assist please call on +1-913-732-8892 or alternatively just send an email specifying your requirements.


You get all this for free.. think about what you get if you pay us