Registry / database / nqm-iot-database-utils

nqm-iot-database-utils

JSON →
library0.7.2jsnpmunverified

Database utility functions for nqminds IoT platform, providing a SQLite-based implementation for creating datasets, adding and querying data with support for ndarray fields. Version 0.7.2 is the latest stable release. This package is specific to the nqm ecosystem and not intended for general database usage. It offers a promise-based API with functions like openDatabase, createDataset, addData, getData, and ndarray utilities. The package is outdated with no recent updates and limited documentation.

npm install nqm-iot-database-utils
INSTALL
IMPORT
SIG · NQM-IOT-DATABASE-U
N
nqm-iot-database-utils
databasejavascriptv0.7.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
const sqliteUtils = require('nqm-iot-database-utils');
import sqliteUtils from 'nqm-iot-database-utils';
Package is CommonJS only, no ESM support. Use require.
openDatabase
const { openDatabase } = require('nqm-iot-database-utils');
import { openDatabase } from 'nqm-iot-database-utils';
Use destructured require for individual functions.
getNdarrayMeta
const { getNdarrayMeta } = require('nqm-iot-database-utils');
import { getNdarrayMeta } from 'nqm-iot-database-utils';
Same as others, CommonJS only.

Demonstrates opening an in-memory SQLite database, creating a dataset with two numeric fields, inserting 100 documents, and querying with a filter and sort.

const sqliteUtils = require('nqm-iot-database-utils'); const TDX_SCHEMA = { "schema": { "dataSchema": { "prop1": { "__tdxType": ["number"] }, "prop2": { "__tdxType": ["number"] } }, "uniqueIndex": [] } }; let dbIter; const testData = []; sqliteUtils.openDatabase('', 'memory', 'w+') .then(db => { dbIter = db; return sqliteUtils.createDataset(db, TDX_SCHEMA); }) .then(() => { for (let idx = 0; idx < 100; idx++) { testData.push({ prop1: idx, prop2: 100 - idx - 1 }); } return sqliteUtils.addData(dbIter, testData); }) .then(() => { return sqliteUtils.getData(dbIter, { $and: [ { $or: [ { prop1: { $gte: 2, $lte: 5 } }, { prop1: { $gte: 92 } } ] }, { prop2: { $lte: 10 } } ] }, null, { sort: { prop1: 1, prop2: -1 } }); }) .then(result => console.log(result));
Debug
Known issues
breakingPackage is CommonJS-only and uses require. Attempting to import with ES6 import will fail.
fix
Use require() instead of import.
affects: all
deprecatedPackage has no recent updates; last version 0.7.2 is likely stale. No active maintenance.
fix
Consider migrating to a maintained alternative unless tied to nqm ecosystem.
affects: all
gotchaThe API uses a custom TDX schema format that may not be documented elsewhere.
fix
Refer to the package's own documentation or source code for schema definitions.
affects: all
gotchaopenDatabase returns a promise, but the database object is not a standard sqlite3 object; it's a custom wrapper.
fix
Use the provided methods (createDataset, addData, getData) instead of native sqlite3 operations.
affects: all
gotchaThe package uses Node.js engine >=10.0.0. It may not work with newer Node versions due to lack of maintenance.
fix
Ensure compatibility with your Node version; test before use.
affects: all
Errors
Common errors & fixes
Cannot find module 'nqm-iot-database-utils'
Module not installed or not in node_modules.
fix
Run 'npm install nqm-iot-database-utils' in your project.
sqliteUtils.openDatabase(...) is not a function
Incorrect import; using import instead of require.
fix
Use 'const sqliteUtils = require("nqm-iot-database-utils");'
TypeError: Cannot read property 'data' of undefined
Promise rejection not handled; database or dataset creation failed silently.
fix
Add .catch() to promise chain to handle errors.
Error: 'w+' flag not supported for in-memory database
In-memory databases are read-only by default with some sqlite3 bindings.
fix
Use 'memory' with 'r+' or omit the flag for in-memory databases.
Upgrade
Version history
0.7.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
nqm-iot-database-utils — npm install nqm-iot-database-utils · libregistry