Skip to content

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

License

Notifications You must be signed in to change notification settings

who-jonson/pinia-orm

This branch is 2 commits ahead of, 85 commits behind CodeDredd/pinia-orm:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

605b845 Β· Jul 5, 2024
Jun 16, 2024
Jul 4, 2024
Jun 22, 2024
Jul 4, 2024
Jun 17, 2024
May 8, 2024
Jan 30, 2022
Sep 17, 2023
Sep 17, 2023
Jul 7, 2022
Aug 20, 2022
Mar 22, 2023
Sep 22, 2023
Jul 7, 2022
Jul 4, 2024
Jul 4, 2024
May 3, 2024
May 5, 2024
Apr 4, 2023
Jan 30, 2022
Feb 10, 2022

Repository files navigation

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.

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 88.4%
  • Vue 5.7%
  • JavaScript 4.2%
  • HTML 1.4%
  • Other 0.3%