Registry / database / ocurupos.database.api

ocurupos.database.api

JSON →
library0.2.129jsnpmunverified

A lightweight JavaScript library for connecting to and interacting with the OcuruPOS database system. Version 0.2.129 provides basic CRUD operations and query capabilities tailored for point-of-sale data management. The package is in early development with frequent releases but lacks comprehensive documentation. Designed specifically for OcuruPOS ecosystem integration, it is not a general-purpose database client.

npm install ocurupos.database.api
INSTALL
IMPORT
SIG · OCURUPOS.DATABASE.
O
ocurupos.database.api
databasejavascriptv0.2.129
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 Database from 'ocurupos.database.api'
✗ const Database = require('ocurupos.database.api')
Package may support both CJS and ESM; check module type.
connect
✓ import { connect } from 'ocurupos.database.api'
✗ import connect from 'ocurupos.database.api'
Named export, not default.
query
✓ import { query } from 'ocurupos.database.api'
✗ import { Query } from 'ocurupos.database.api'
Function export is lowercase.

Connects to the OcuruPOS database, runs a query to fetch products, and logs results.

import { connect, query } from 'ocurupos.database.api'; async function main() { const db = await connect({ host: 'localhost', port: 5432 }); const result = await query(db, 'SELECT * FROM products LIMIT 10'); console.log(result); await db.close(); } main().catch(console.error);
Debug
Known issues
breakingThe connect() function signature changed in v0.2.0: first argument is now an object, not separate parameters.
fix
Use connect({ host, port, user, password }) instead of connect(host, port, user, password).
affects: >=0.2.0
deprecatedThe method db.execute() is deprecated as of v0.2.100, use query() instead.
fix
Replace db.execute(sql) with query(db, sql).
affects: >=0.2.100
gotchaThe library does not support connection pooling; opening multiple connections may lead to resource exhaustion.
fix
Reuse a single connection or implement a connection pool externally.
affects: all
Errors
Common errors & fixes
TypeError: db.close is not a function
The close method is not available on the connection object in older versions.
fix
Upgrade to version >=0.2.50 or use 'end' method: await db.end();
Module not found: Error: Can't resolve 'ocurupos.database.api'
Package name contains dots; certain module bundlers may misinterpret it.
fix
Use exact string in import: import ... from 'ocurupos.database.api'; Ensure the package is installed.
Error: connect ECONNREFUSED ::1:5432
Default host is localhost; IPv6 resolution may fail if service listens on IPv4 only.
fix
Explicitly set host to '127.0.0.1' in connection options.
Upgrade
Version history
0.2.129latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources