Registry / database / pckg-orm

pckg-orm

JSON →
library0.0.5jsnpmunverified

A simple JavaScript ORM designed to work with the pckg framework. Version 0.0.5, early development. Provides entity/record/repository pattern for CRUD operations, supports REST APIs and HTTPQL queries. Key differentiator: lightweight, minimalistic, closely tied to pckg ecosystem. Not suitable for production use outside pckg.

npm install pckg-orm
INSTALL
IMPORT
SIG · PCKG-ORM
P
pckg-orm
databasejavascriptv0.0.5
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.

Entity
import { Entity } from 'pckg-orm/src/orm'
import { Entity } from 'pckg-orm'
Must use subpath import from src/orm; package has no default export.
Record
import { Record } from 'pckg-orm/src/orm'
const Record = require('pckg-orm').Record
ESM-only package; requires import syntax.
Entity
import { Entity } from 'pckg-orm/src/orm'
import Entity from 'pckg-orm/src/orm'
Entity is a named export, not default.

Defines Record and Entity classes for a 'countries' resource, then fetches the first 10 European countries.

import { Entity, Record } from 'pckg-orm/src/orm'; class Country extends Record { constructor(props) { super(props); this.$entity = Countries; } } class Countries extends Entity { constructor(repository) { super(repository); this.$record = Country; this.$path = 'countries'; } } const countries = new Countries(); countries.where('continent', 'EU').limit(10).all().then(rows => console.log(rows));
Debug
Known issues
breakingImport paths use 'pckg-orm/src/orm' instead of package root.
fix
Use correct subpath import: import { Entity } from 'pckg-orm/src/orm'
affects: <=0.0.5
gotchaRequiring the package with CommonJS will fail (ESM-only).
fix
Use import syntax or .mjs extension.
affects: <1.0.0
deprecatedPackage is in early development (v0.0.5) and API may change without notice.
fix
Lock version and expect breaking changes.
affects: >=0.0.0
gotchaEntity and Record must be extended; they are abstract-like classes.
fix
Create subclasses as shown in the README.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'pckg-orm' or its corresponding type declarations.
Missing TypeScript declarations; package has no types.
fix
Create a custom declaration file or use // @ts-ignore.
ERR_MODULE_NOT_FOUND: Unable to import 'pckg-orm'
Import uses package root instead of subpath.
fix
Use 'pckg-orm/src/orm' in the import path.
Uncaught TypeError: Class extends value undefined is not a constructor or null
Forgot to import Entity/Record from the correct path.
fix
Ensure import: import { Entity, Record } from 'pckg-orm/src/orm'
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pckg-orm — npm install pckg-orm · libregistry