Registry / database / entgamers-database

entgamers-database

JSON →
library0.0.27jsnpmunverified

EntGamers Database (v0.0.27) is a lightweight library for unifying sessions and database management across EntGamers projects. It provides a consistent API for connection handling, session storage, and basic CRUD operations, with TypeScript support. Intended for internal use within the EntGamers ecosystem, it wraps common database drivers and session stores into a single abstraction. The library is in early active development (pre-1.0), with frequent updates. Differentiators include seamless integration with EntGamers-specific project patterns and a minimal footprint.

npm install entgamers-database
INSTALL
IMPORT
SIG · ENTGAMERS-DATABASE
E
entgamers-database
databasejavascriptv0.0.27
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.

EntGamersDatabase
import { EntGamersDatabase } from 'entgamers-database'
const EntGamersDatabase = require('entgamers-database').EntGamersDatabase
Default export not available; named export required. CommonJS require works only with .default or destructuring.
Session
import { Session } from 'entgamers-database'
import { Session as MySession } from 'entgamers-database'
Session is a class; can be renamed but not default imported.
DatabaseConfig
import type { DatabaseConfig } from 'entgamers-database'
import { DatabaseConfig } from 'entgamers-database'
TypeScript type-only export for runtime-safe usage.

Connects to a database, creates a session, saves it, and disconnects using the unified API.

import { EntGamersDatabase, Session } from 'entgamers-database'; const db = new EntGamersDatabase({ host: process.env.DB_HOST ?? 'localhost', port: parseInt(process.env.DB_PORT ?? '5432'), user: process.env.DB_USER ?? 'user', password: process.env.DB_PASS ?? '', database: process.env.DB_NAME ?? 'entgamers' }); async function run() { await db.connect(); const session = new Session(db, { userId: '123', data: {} }); await session.save(); console.log('Session saved'); await db.disconnect(); } run().catch(console.error);
Debug
Known issues
breakingAPI _ heavily in flux; minor version bumps may introduce backward-incompatible changes.
fix
Pin version and review changelog before upgrading.
affects: >=0.0.1 <1.0.0
gotchaSession class requires an active database connection; constructing without calling connect() throws.
fix
Always await db.connect() before creating Session instances.
affects: >=0.0.1
gotchaDatabaseConfig does not support all driver options; only basic PostgreSQL config is documented.
fix
Check source for additional config properties or use raw driver if needed.
affects: >=0.0.1
deprecatedOlder import paths like 'entgamers-database/session' may stop working; use root exports.
fix
Import all from 'entgamers-database' directly.
affects: >=0.0.20
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'connect')
Creating EntGamersDatabase instance without proper config or async initialization.
fix
Ensure config object is complete and db.connect() is awaited before operations.
Module not found: Can't resolve 'entgamers-database'
Attempting to import in a frontend build without proper bundling or missing package.
fix
Install with npm/pnpm/yarn and ensure package.json includes 'entgamers-database' in dependencies.
Property 'save' does not exist on type 'Session'
TypeScript strict mode or outdated type definitions.
fix
Update library to latest version; if persists, use type assertion: (session as any).save().
Upgrade
Version history
0.0.27latest on npm
Audit
Dependencies
typescriptoptionalTypeScript declarations are bundled; project expects TypeScript environment
Agent activity
5 hits · last 30 days
node
4
Resources
entgamers-database — npm install entgamers-database · libregistry