Kysely over the pool, typed by DB; set by start().
The server's major version (19, 21, 23…), known after start().
ProtectedconnectOpens a standalone connection (for migrations); tests replace it.
ProtectedcreateCreates the pool; tests replace it with a fake one.
Runs a statement: rows, rowsAffected and outBinds. Binds by name may
give a type by name: { id: { dir: 'returning', type: 'number' } } for
RETURNING id INTO :id, { dir: 'out', type: 'string' } for a PL/SQL
OUT parameter, { type: 'clob', val: text } for a long IN value.
Outside a transaction it commits on its own; inside transaction() it
runs in the transaction.
Optionalbinds: BOptionaloptions: StatementOptionsRuns a DML statement once per row of binds (a bulk insert), in one round
trip. bindDefs names types (clob to load CLOBs) and out binds.
Optionaloptions: ExecuteManyOptionsA page of a query's rows and its counts: SQL with params by name, or a
function of the filters and orders; offset/limit or page/pageSize.
const page = await oracle.list({
query: (filters, orders) => usuariosQuery(filters, orders), // { sql, params }
filters, orders, totalFilters: {},
offset: c.req.query('start'), limit: c.req.query('length'),
rows: Usuario,
}); // { rows, total, filtered, offset, limit, pages }
Optionalstatement: StatementOptionsThe first row of a query, or a NoRowsError (NOT_FOUND: web-kit answers 404).
Optionalbinds: OracleBindsOptionaloptions: QueryOptions<T>Adds a callback for every statement, commit and rollback, besides the others (a tracer and a logger each keep their own); returns what removes it. See OnQueryHook.
SELECT 1 FROM DUAL for readiness checks: true or false within
pingTimeout (default 5 s), never throws. A ping still waiting for a
connection is shared by the next ones instead of queueing more.
The rows of a query, decoded by options.rows when given.
Optionalbinds: OracleBindsOptionaloptions: QueryOptions<T>The first row of a query (fetching only that one), or undefined.
Optionalbinds: OracleBindsOptionaloptions: QueryOptions<T>Applies the pending .sql migrations of dir (default ./migrations)
and returns their names. Needs start(). Its statements have no
callTimeout: building an index may take long.
Optionaloptions: MigrationOptionsRegister a callback for every statement and its binds (raw and Kysely); it may return a function called when the statement ends (see OnQueryHook). A throwing callback is ignored: observability never fails a query.
The rows of a query one at a time, fetched chunkSize (default 100) at a time.
Optionalbinds: OracleBindsRuns fn on one connection with autoCommit off, and commits when it
returns or rolls back when it throws (rethrowing its error). Inside it,
oracle.query(), oracle.execute(), oracle.db… also run in the
transaction (another connection could wait forever on its locks);
opening another transaction() throws.
Oracle Database for Iskra: a node-oracledb pool (Thin mode, no Oracle Client) in the app's process, typed queries with Kysely (
db), raw SQL with typed binds (query,execute), transactions, pagination and migrations. Configured byapp.config.oracle, or ORA_CONN, ORA_USER and ORA_PASSWORD; without either it does not start.