Registry / database / jv-noorm

jv-noorm

JSON →
library0.0.63jsnpmunverified

JV NoORM is a lightweight database access library for MariaDB and PostgreSQL that lets you write raw SQL queries without the overhead of an ORM. It provides a thin abstraction over mysql2 and pg, offering connection pooling, transaction control, and a built-in migration system with script execution. The package includes CLI tools for generating TypeScript interfaces from your database schema. Current stable version is 0.0.63, experimental and released as needed. It differentiates from ORMs by giving developers full control over query performance and SQL syntax, while still providing convenient helpers for migrations and schema generation. Supports ESM only, requires Node.js 16+.

npm install jv-noorm
INSTALL
IMPORT
SIG · JV-NOORM
J
jv-noorm
databasejavascriptv0.0.63
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.

createMigration
import { createMigration } from 'jv-noorm'
const createMigration = require('jv-noorm').createMigration
ESM-only package; CommonJS require will not work
deploy
import { deploy } from 'jv-noorm'
import { deploy as runDeploy } from 'jv-noorm'
Named import, not default.
generate
import { generate } from 'jv-noorm'
import generate from 'jv-noorm'
generate is a named export, not default.

Shows how to create a migration script and deploy it to the database.

import { deploy, createMigration, generate } from 'jv-noorm'; import dotenv from 'dotenv'; dotenv.config(); async function runMigrations() { await createMigration('add_users_table'); await deploy(); console.log('Migrations done'); } runMigrations().catch(console.error);
Debug
Known issues
breakingOnly ESM imports are supported; CommonJS require() will fail.
fix
Use import syntax and set "type": "module" in package.json.
affects: >=0.0.0
deprecatedThe environment variable DATABASE_URL for connection string may change in future versions.
fix
Use DB_TYPE, DB_HOST, etc. or check release notes for updates.
affects: >=0.0.0
gotchaMust install either mysql2 or pg as a peer dependency depending on the database type.
fix
npm install mysql2 for MariaDB/MySQL, or pg for PostgreSQL.
affects: >=0.0.0
gotchaThe migration scripts must have a .sql extension and be placed in the SCRIPTS_FOLDER directory.
fix
Ensure SCRIPTS_FOLDER is set and contains .sql files with semicolons between statements.
affects: >=0.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Replace require with import, or use dynamic import().
Cannot find module 'mysql2'
Missing peer dependency for MariaDB/MySQL.
fix
npm install mysql2
Cannot find module 'pg'
Missing peer dependency for PostgreSQL.
fix
npm install pg
DB_TYPE not set
Environment variable DB_TYPE is not configured.
fix
Set DB_TYPE to 'MariaDB' or 'PostgreSQL' in .env file.
Upgrade
Version history
0.0.63latest on npm
Audit
Dependencies
mysql2optionalMariaDB/MySQL driver (optional if using PostgreSQL)
pgoptionalPostgreSQL driver (optional if using MariaDB)
dotenvoptionalLoad environment variables from .env file
Agent activity
8 hits · last 30 days
node
8
Resources
jv-noorm — npm install jv-noorm · libregistry