Registry / database / shared-orm-library

shared-orm-library

JSON →
library1.0.17jsnpmunverified

A generic Sequelize ORM wrapper for relational databases (MySQL, PostgreSQL, MariaDB, etc.), defaulting to PostgreSQL. Current stable version is 1.0.17. Provides a simple interface to initialize Sequelize with environment-based configuration. Not actively maintained after initial release; lacks common ORM features like migrations, seeders, or built-in model definitions, making it less suitable for production compared to direct Sequelize usage or mature libraries like TypeORM/Prisma.

npm install shared-orm-library
INSTALL
IMPORT
SIG · SHARED-ORM-LIBRARY
S
shared-orm-library
databasejavascriptv1.0.17
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 db from 'shared-orm-library'
const db = require('shared-orm-library').default
Package exports a default export; using require with .default is not needed if using CommonJS, but if using ESM, use the import above. For CJS, const db = require('shared-orm-library') works.

Shows how to import the default export and run a raw query using the Sequelize instance.

import db from 'shared-orm-library'; // db is a configured Sequelize instance (defaults to PostgreSQL) // To use MySQL or MariaDB, set environment variables DB_DIALECT=mysql // Example: query all users const users = await db.query('SELECT * FROM users', { type: db.QueryTypes.SELECT }); console.log(users);
Debug
Known issues
gotchaPackage expects environment variables (DB_DIALECT, DB_HOST, etc.) to be set; no configuration object can be passed directly.
fix
Set environment variables before using the library, or fork the package to accept a config object.
affects: <=1.0.17
Errors
Common errors & fixes
Cannot read properties of undefined (reading 'QueryTypes')
Attempting to access db.QueryTypes before initialization; db is not initialized if environment variables are missing.
fix
Ensure DB_DIALECT, DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, DB_PORT are set in environment.
Upgrade
Version history
1.0.17latest on npm
Audit
Dependencies
sequelizerequiredCore ORM library; shared-orm-library is a thin wrapper around Sequelize
Agent activity
6 hits · last 30 days
node
4
Meta
2
Resources
shared-orm-library — npm install shared-orm-library · libregistry