Skip to main content

@sqb/oracle-dialect

SQB's dialect plugin for Oracle Database — teaches @sqb/builder how to render Oracle's SQL syntax, including version-dependent pagination: a rownum-wrapped subquery when dialectVersion is omitted or < 12, and real FETCH FIRST ... ROWS ONLY syntax for dialectVersion >= 12. See Generating SQL per dialect for dialectVersion itself.

In SELECT and DELETE queries, a Date-valued Param is bound as a 'yyyy-mm-dd hh24:mi:ss' string wrapped in TO_DATE(:name, 'yyyy-mm-dd hh24:mi:ss') (since v6.0.9; earlier versions used TO_TIMESTAMP with a millisecond format). Milliseconds are dropped. The change was made because queries comparing date columns ran very slowly with TO_TIMESTAMP.

Exports​

Apart from a version constant (this package's own version string, e.g. "6.3.0"), this package exports nothing. Its entire effect is a side effect of importing it: it constructs an internal OracleSerializer (not exported) and registers it with SerializerRegistry for dialect: 'oracle'.

import '@sqb/oracle-dialect';

@sqb/oracle (the connection adapter) imports this package internally as part of its own entry point, so you don't need to import it yourself when using @sqb/oracle — only when using @sqb/builder standalone (no @sqb/connect/adapter) and you still want .generate({ dialect: 'oracle' }) to render Oracle SQL.

See also​