Registry / database / hydro-vue-orm

hydro-vue-orm

JSON →
library0.0.2jsnpmunverified

A reactive ORM library for Vue 3 that uses Vue's reactivity system to synchronize data across components and pages. Current version 0.0.2, early stage with frequent releases. Key differentiators: stores data as class instances, uses WeakRef for automatic memory management, and provides decorators for data transformation and reactivity.

npm install hydro-vue-orm
INSTALL
IMPORT
SIG · HYDRO-VUE-ORM
H
hydro-vue-orm
databasejavascriptv0.0.2
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 'hydro-vue-orm'
import { Entity } from 'hydro-vue-orm' (incorrect path, but no common mistake)
Decorator for class definition.
Repository
import { Repository } from 'hydro-vue-orm'
Used for CRUD operations on entities.
Reactive
import { Reactive } from 'hydro-vue-orm'
Type helper for reactive entity instances.
defineSchema
import { defineSchema } from 'hydro-vue-orm'
Used to transform nested data into reactive entities.

Shows how to define an entity class, insert reactive entities, update via Repository, and transform nested data with defineSchema.

import { Entity, Repository, defineSchema } from 'hydro-vue-orm' import { reactive } from 'vue' @Entity() class UserModel { id: number name: string age: number get userInfo() { return `${this.name} (${this.age})` } } // Insert a reactive entity const user = Repository(UserModel).insert({ id: 1, name: 'Alice', age: 30 }) as Reactive<UserModel> // Update all entities matching condition Repository(UserModel).where({ id: 1 }).update(u => { u.name = 'Bob' }) // Transform nested data const data = { book: { author: { id: 2, name: 'Charlie', age: 25 } } } const schema = defineSchema({ book: { author: UserModel } }) transform(data) console.log(data.book.author) // Reactive UserModel instance
Debug
Known issues
gotchaDecorators (@Entity, @get, @set, @types) require TypeScript experimentalDecorators enabled unless using defineSchema instead.
fix
Enable 'experimentalDecorators' in tsconfig.json, or skip decorators and use defineSchema/Repository directly.
affects: >=0.0.1
breakingThe library is in early development (v0.0.2); APIs may change without notice.
fix
Pin exact version and monitor repository for breaking changes.
affects: >=0.0.1 <0.1.0
gotchaRepository uses WeakRef internally; do not expect immediate garbage collection or rely on finalization timing.
fix
Understand that WeakRef semantics are non-deterministic; do not depend on immediate cleanup.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'hydro-vue-orm' or its corresponding type declarations.
Package not installed or TypeScript cannot locate types.
fix
npm install hydro-vue-orm; ensure tsconfig includes types (e.g., "types": ["hydro-vue-orm"]) or import directly.
Unexpected token @ - decorators are not valid in this context.
TypeScript decorators require experimentalDecorators compiler option.
fix
Add "experimentalDecorators": true to tsconfig.json compilerOptions.
Repository(UserModel).insert() returns an object but not a class instance?
Forgetting to define the class with @Entity() or not using the class as a constructor.
fix
Ensure the class is decorated with @Entity() and that you pass the class itself to Repository.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
vuerequiredRequired for reactivity system (peer dependency)
mittrequiredEvent emitter used internally for cross-component communication (peer dependency)
Agent activity
4 hits · last 30 days
node
4
Resources
hydro-vue-orm — npm install hydro-vue-orm · libregistry