Registry / database / oracle-sql-lib-engine

oracle-sql-lib-engine

JSON →
library0.0.33jsnpmunverified

A Node.js library (v0.0.33) that manages Oracle SQL/PLSQL files as modules and services, built on node-oracledb. It provides a centralized way to configure, execute, and monitor SQL queries via HTTP endpoints, with support for connection pooling, parameter binding, concurrency limiting, and hot deployment. Designed for teams that want to decouple SQL logic from application code and enable frontend developers to write backend database queries directly. The package is in early development (pre-1.0), with a focus on ease of debugging and zero-downtime updates. Releases are frequent but breaking changes may occur.

npm install oracle-sql-lib-engine
INSTALL
IMPORT
SIG · ORACLE-SQL-LIB-ENG
O
oracle-sql-lib-engine
databasejavascriptv0.0.33
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import osql from 'oracle-sql-lib-engine'
✗ const osql = require('oracle-sql-lib-engine')
Package is ESM-only; CommonJS require() will fail.
createPool
✓ import { createPool } from 'oracle-sql-lib-engine'
✗ const { createPool } = require('oracle-sql-lib-engine')
Named export; ESM only.
startServer
✓ import { startServer } from 'oracle-sql-lib-engine'
✗ import startServer from 'oracle-sql-lib-engine'
startServer is a named export, not the default.

Initializes an Oracle connection pool and starts an HTTP server that serves SQL queries defined in service configuration files.

import osql from 'oracle-sql-lib-engine'; import oracledb from 'oracledb'; // Create a pool (must be done before startServer) await osql.createPool({ poolAlias: 'task', user: process.env.DB_USER ?? 'scott', password: process.env.DB_PASSWORD ?? 'tiger', connectString: process.env.DB_CONNECT_STRING ?? 'localhost:1521/XE' }); // Start HTTP server (default port 3000) const server = await osql.startServer({ port: 3000, servicesDir: './services' // directory containing SQL service configs }); console.log('Server running on port 3000'); // Then define a service file in ./services/example.js: // exports.path = '/api/users'; // exports.sqltext = 'SELECT * FROM users WHERE id = :id'; // exports.pool = 'task';
Debug
Known issues
gotchaRequires Oracle Instant Client installed on the system. Without it, node-oracledb will fail to connect.
fix
Install Oracle Instant Client (18, 12, or 11.2) and configure library path (e.g., LD_LIBRARY_PATH on Linux, PATH on Windows).
affects: >=0.0.1
gotchaORA-24408: could not generate unique server group name. This happens if /etc/hosts does not have an entry for your hostname pointing to 127.0.0.1.
fix
Add '127.0.0.1 <hostname>' to /etc/hosts.
affects: >=0.0.1
gotchaJavaScript number precision is limited to 53 bits. Numbers with more than 15 decimal digits will lose precision when returned from Oracle.
fix
Use string representations or BigInt for high-precision numeric columns.
affects: >=0.0.1
breakingPackage is ESM-only. Using require() will throw a runtime error.
fix
Use import syntax or set type: 'module' in package.json.
affects: >=0.0.1
Errors
Common errors & fixes
Error: ORA-24408: could not generate unique server group name
/etc/hosts missing entry for local hostname pointing to 127.0.0.1
fix
Add '127.0.0.1 <your-hostname>' to /etc/hosts
Error: DPI-1047: Cannot locate a 64-bit Oracle Client library
Oracle Instant Client not installed or library path not set
fix
Install Oracle Instant Client and set LD_LIBRARY_PATH (Linux) or PATH (Windows) to the client directory
TypeError: osql.createPool is not a function
Using require() instead of import
fix
Use import osql from 'oracle-sql-lib-engine' instead of require
Upgrade
Version history
0.0.33latest on npm
Audit
Dependencies
oracledbrequiredRequired runtime dependency for Oracle database connectivity. The package wraps node-oracledb functionality and expects it to be installed in the consumer project.
Agent activity
8 hits · last 30 days
node
6
Resources
oracle-sql-lib-engine — npm install oracle-sql-lib-engine · libregistry