pinia-orm icon indicating copy to clipboard operation
pinia-orm copied to clipboard

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

Pinia ORM logo

Artwork from Pinia

pinia-orm

npm version npm downloads Github Actions CI Coverage License

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) 8.2 KB 16.7 KB 12.6 KB
Relations (hasMany, belongsTo, morphOne, hasManyBy, hasOne) βœ… βœ… βœ…
Relations (morphTo, morphMany, belongsToMany) βœ… βœ… ❌
Relations (morphToMany, morphedByMany, hasManyThrough) ❌ βœ… ❌
Mutators βœ… βœ… ❌
Casts βœ… ❌ ❌
Decorators βœ… ❌ βœ…
Single Table Inheritance βœ… βœ… ❌
Lifecycle Hooks βœ… βœ… ❌
Aggregates ❌ βœ… ❌
Query (orHas, doesntHave, orDoesntHave, whereHas, orWhereHas, groupBy) βœ… ❌ ❌

Help me keep working on this project πŸ’š

Platinum Sponsors

Gold Sponsors

Silver Sponsors

Bronze Sponsors

tintin10q

Lovely Sponsors

Sven Hue


FAQ

A few notes about the project and possible questions:

Q: Does it work with the same models as vuex-orm?

A: Yes, this code is based on their work

Roadmap

to v 1.0.0

  • [x] Get it work with minimal breaking changes
  • [ ] Code clean up
  • [x] Documentation
  • [x] Tests

πŸ’» Development

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

Special thanks

I wan to thank Kia King Ishii and their contributors for all their awesome work with vuex-orm

License

Made with ❀️

Published under MIT License.