• Stars
    star
    443
  • Rank 98,504 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.

Pinia ORM banner

npm version npm downloads Github Actions CI Coverage License

Welcome to pinia-orm

Intuitive, type safe and flexible ORM for Pinia based on Vuex ORM Next

Migration from vuex-orm

You want to migrate from vuex to pinia and with it vuex-orm to pinia-orm but you don't know yet? Well maybe this table will help you to decide. This comparison is just about facts and current state.

Features [email protected] @vuex-orm/[email protected] @vuex-orm/[email protected]
Bundle Size (Min + GZIP) 9.9 KB 16.7 KB 12.6 KB
Relations (hasMany, belongsTo, morphOne, hasManyBy, hasOne, morphTo) โœ… โœ… โœ…
Relations (morphMany, belongsToMany, hasManyThrough) โœ… โœ… โŒ
Relations (morphToMany, morphedByMany) โŒ โœ… โŒ
Mutators โœ… โœ… โŒ
Casts โœ… โŒ โŒ
Decorators โœ… โŒ โœ…
Single Table Inheritance โœ… โœ… โŒ
Lifecycle Hooks โœ… โœ… โŒ
Aggregates โœ… โœ… โŒ
Query (orHas, doesntHave, orDoesntHave, whereHas, orWhereHas, groupBy) โœ… โŒ โŒ
Collection Helpers โœ… (โœ…) can use pinia-orm helpers too (โœ…) can use pinia-orm helpers too
Hidden Fields โœ… โŒ โŒ
Metadata field โœ… โŒ โŒ
Caching of queries with gc โœ… (โœ…) with plugin โŒ

If you decide to migrate then there are some breaking changes. A guide how to migrate will be written. Small overview:

  • Fields are by default null
  • Renamed some functions aligning more with laravel naming
  • Code is based on vuex-orm-next and not on vuex-orm !

Help me keep working on this project ๐Ÿ’š


๐Ÿ’ป Development

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Build normalizr package: pnpm build
  • Run interactive tests using cd packages/pinia-orm && pnpm test:ui

Credits

Related projects

License

Made with โค๏ธ

Published under MIT License.