Registry / database / oly-orm

oly-orm

JSON →
library1.0.0jsnpmunverified

oly-orm is an ORM for TypeScript that integrates with the oly dependency injection framework, providing decorator-based entity definitions and repository patterns. Current stable version is 1.0.0. It uses SQLite in-memory by default and supports common database operations through repositories. Differentiators include tight integration with oly's IoC container and minimal boilerplate compared to TypeORM. Release cadence is low; package appears to be in maintenance mode.

npm install oly-orm
INSTALL
IMPORT
SIG · OLY-ORM
O
oly-orm
databasejavascriptv1.0.0
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.

id
import { id } from 'oly-orm'
import { Id } from 'oly-orm'
Decorator names are lowercase, import as named exports
column
import { column } from 'oly-orm'
import { Column } from 'oly-orm'
Use lowercase 'column', not uppercase
Repository
import { Repository } from 'oly-orm'
import Repository from 'oly-orm'
Repository is a named export, not default

Shows how to define an entity with decorators, create a repository, and perform an insert and findAll operation.

import { Kernel } from 'oly'; import { id, column, Repository } from 'oly-orm'; class Article { @id() id?: number; @column() title!: string; } class ArticleRepository extends Repository.of(Article) {} async function main() { const k = Kernel.create({ DATABASE_URL: ':memory:' }); const a = k.get(ArticleRepository); await k.start(); await a.insert({ title: 'Hello' }); console.log(await a.findAll()); } main().catch(console.error);
Debug
Known issues
breakingoly-orm v1.0.0 requires oly ^0.15.1; incompatible with newer oly versions.
fix
Downgrade oly to 0.15.1 or upgrade oly-orm if a newer version exists.
affects: >=1.0.0
deprecatedoly-orm appears unmaintained; last release 1.0.0 in 2019. Consider using TypeORM or MikroORM.
fix
Migrate to a supported ORM like TypeORM.
affects: >=1.0.0
gotchaImporting from 'oly-orm' requires both decorators and Kernel from 'oly'. Missing Kernel initialization leads to runtime errors.
fix
Ensure you create a Kernel with appropriate config before using repositories.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find name 'id'. Did you mean 'Id'?
IDecorator is often capitalized by mistake; correct import is lowercase 'id'.
fix
Replace import { Id } with import { id } from 'oly-orm'.
Cannot find name 'Repository'.
Repository is not imported correctly; forgetting to import or using default import.
fix
Use import { Repository } from 'oly-orm'.
TypeError: Class extends value undefined is not a constructor or null
Repository.of(Article) returns a class but it may not be called correctly if Repository is not properly imported.
fix
Ensure Repository is imported as a named export and that Article class is defined before extension.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
olyrequiredoly-orm requires the oly kernel for dependency injection and lifecycle management
Agent activity
6 hits · last 30 days
node
6
Resources
oly-orm — npm install oly-orm · libregistry