
Description
Pinia ORM is a plugin for Pinia, the Vue store library, that adds object-relational mapping to your stores. It normalizes relational data and lets you query it with a Laravel-style query builder, with where, whereLike, whereHas, orderBy, groupBy, aggregates, updateOrCreate and firstOrCreate. It supports the common relations, including hasOne, hasMany, belongsTo, belongsToMany, hasManyThrough and the morph relations. Models are defined with standard ECMAScript decorators for type-safe definitions. The library also supports single table inheritance, lifecycle hooks, mutators, casts, hidden fields and query caching. A Nuxt module works with Nuxt 3 and 4, and an axios plugin is included. The README lists the requirements: the 2.x line needs Pinia 3 or later, Node 22.12 or later and TypeScript 5.2 or later, while 1.x works with Pinia 2.x. The docs include a comparison with vuex-orm and a migration guide. The repository is public on GitHub.…
Highlights
- Normalized relational data in Pinia stores
- Laravel-style query builder with aggregates
- Common and morph relations between models
- Standard ECMAScript decorators for model definitions
- First-class Nuxt module for Nuxt 3 and 4
- Single table inheritance and query caching
Ratings & Reviews
No ratings yet
Be the first to rate pinia-orm.
People also visit
pinia-orm FAQ
What is pinia-orm?
A plugin that lets you query Pinia stores like an ORM, with normalized relational data and a query builder.
Which versions do I need?
The 2.x line needs Pinia 3 or later, Node 22.12 or later and TypeScript 5.2 or later. The 1.x line works with Pinia 2.x and Node 14 or later.
Does it work with Nuxt?
Yes. It has a first-class Nuxt module for Nuxt 3 and 4.
How is it different from vuex-orm?
The README includes a comparison with vuex-orm, along with a migration guide for people moving over.
Is it open source?
Yes. The repository is public on GitHub at CodeDredd/pinia-orm.
What are the best pinia-orm alternatives?
Popular alternatives to pinia-orm include pinia, PrimeVue and vue-final-modal. See all pinia-orm alternatives














