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 — HTML output

HTML is the default output mode — no flag required, or --html to be explicit. The schema is rendered as a syntax-highlighted, hyperlinked view of the source, with an optional summary section listing every registered object by category.

sql2html < schema.sql > schema.frag.html
sql2html -h "Production schema" -s -2 < schema.sql > schema.html

Document structure

With -h <title>, the output is a self-contained HTML document:

<HTML>
<HEAD><TITLE>{title}</TITLE></HEAD>
<BODY>
<H1>{title}</H1>
{summary if -s}
<H3>Source</H3>
<pre>{syntax-highlighted body}</pre>
</BODY>
</HTML>

Without -h, the surrounding tags are omitted and only the inner fragment is emitted. This is intentional — it lets the output be embedded in a larger page (the project's own distribution pages do exactly this).

Summary section

When -s is set, one <H4> heading is emitted per non-empty category, in this fixed order:

OrderCategoryType tag
1User Defined Typesudt
2Tablestable
3Synonymssyn
4Viewsview
5Routinesudr
6Aggregatesuda

Under each heading every registered object of that type is emitted as <A HREF="#...">name</A>, one per line. Indexes, triggers, and constraints are not in the summary but are still anchored in the source body and reachable by direct URL fragment.

Anchors and cross-references

For each CREATE statement the creating keyword (the word TABLE in CREATE TABLE foo, the word VIEW in CREATE VIEW, and so on) is wrapped in a named anchor:

Object classAnchor
Permanent object<A NAME="{type}_{name}">CREATE</A>
Temporary table<A NAME="{type}_{name}_{line}">...</A> — line number disambiguates re-used names

Each resolved reference replaces its referencing token with a hyperlink back to the corresponding anchor — <A HREF="#table_systables">systables</A> or, for temp tables, <A HREF="#temp_x_42">x</A> (matched to the most recent prior declaration). The same anchor scheme is used by the JSON and PDF outputs, so links generated from one format reach the others unchanged.

Syntax highlighting

The source body is wrapped in <pre> with per-token-class colour applied via <font color="...">. Whitespace and column position are preserved using the lexer's whitespace fields so the rendered source visually matches the input.

Token classColour
TOK_SQL_WORD, TOK_SPL_WORD, TOK_SQL_OPnavy
TOK_SQL_DATATYPEteal
TOK_LIT_NUMBERmagenta
TOK_LIT_STRINGred
TOK_COMMENTgreen
TOK_COLLECTIONblue
TOK_OPT_DIRECTIVEgray
TOK_OPT_COMMENTsilver
(default — identifiers)black

Example

A rendered run against the bundled sysmaster.gz fixture is available as sysmaster.html (produced by an earlier variant; current source emits the structure described above).

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