Discover the latest updates.
Now pinia-orm has finally all functions and relations from vuex-orm/core
🎈
Also i added the support for pinia setup store syntax. 💯 So now you are getting even more flexibility.
I know the plugin system was still buggy. Either the types were wrong or the configs weren't working. It's finally doing well. But the plugin regestration changed. Since it haven't worked well yet it should be not a big breaking change.
You now need to register plugins that way:
- const piniaOrm = createORM()- piniaOrm().use(createPiniaOrmAxios({- axios,- }))+ const piniaOrm = createORM({+ plugins: [+ createPiniaOrmAxios({+ axios,+ }),+ ],+ })
You can now also use the pina setup syntax in pinia-orm. You only need to change your piniaOrm options
createPiniaORM({ pinia: { storeType: 'setupStore' } })
class User extends Model { static entity = 'users' static piniaOptions = { newData: ref('1'), } static piniaExtend = { persist: true, } @Attr(0) declare id: number @Str('') declare name: string @Str('') declare username: string }console.log(userRepo.piniaStore().newData) // 1
morphedByMany
as relation (#1897)belongsTo
& hasOne
with composite key (#1904)pivot
helper fields are not deleted or removed. (#1911)relation.getKey
with relation.getResolvedKey
(ad91ce6)bundler
(#1906)WeakCache
types for newest typescript version (dc9d711)Again some bug fixes from last release
belongsToMany
with inverse keys on same model are causing wrong saved data (#1860).find
returning type any
when using useRepo
(#1865)useSortBy
(#1882)Small bugfixes from 1.9.0 release
useRepo
with Repository are broken (#1848)This is possibly the second last minor release before pinia-orm v2, and so many bug fixes and some new nice features are inside! ✨
If you wonder why i skipped v1.8.0...well that happend because i now implemented an auto changelog gen and i didn't wanted to change my git history because of a simple mistake. 😄
Big thanks @dev1437 for his prework
First of all some type fixes were made so you shouldn't get any errors anymore. Along of this there some nice type support features now
with()
where()
There is now a edge channel so you don't have to wait to try out new merged commits. The edge builds are also made for the other packages axios
, normalizr
& nuxt
Update pinia-orm
dependency inside package.json
:
{ "devDependencies": {- "pinia-orm": "^1.0.0"+ "pinia-orm": "npm:pinia-orm-edge@latest" }}
Remove lockfile (package-lock.json
, yarn.lock
, or pnpm-lock.yaml
) and reinstall dependencies.
Update pinia-orm
dependency inside package.json
:
{ "devDependencies": {- "pinia-orm": "npm:pinia-orm-edge@latest"+ "pinia-orm": "^1.0.0" }}
Remove lockfile (package-lock.json
, yarn.lock
, or pnpm-lock.yaml
) and reinstall dependencies.
where(Not)Null
and (or)where(Not)In
(#1831)saving
, updating
hooks second param had wrong values (#1826)$isDirty()
in hooks on model had wrong state (4ecf93f)createORM()
had wrong type (#1830)delete
(#1838)Hotfix release for v1.7.1 which broke imports for old "dist"
a3c734e
)Hotfix release
This update is a huge one. I think the biggest change people always asked about is the axios plugin. It's fiinally there. But most importantly now you are able to extend pinia-orm like you want with the plugin system.
setModel
for Repository (d0cd5e6
)dcbc02e
)destroy
and onDelete
(#1671)pinaStore
instance was wrong on STI models (#1618)Uncaught TypeError: parent.$fields()[key] is undefied
when inserting nested data with polymorphic relationships (#1648)useRepo
was having the wrong type for repositories (be3c4f4
)25090ec
)4d1a21e
)7c5a23e
)be0ca45
)5284a7b
)43f0dcc
)$refresh()
is not working (#1125)519681c
)2caa97a
)new()
is not cached in the hydration cache (#1113)save()
results weren't cached in the hydration cache (#1113)new()
not to persist the model (#1107)blank
to linkd59ad1d
)morphToMany
relation (#1060)useRepo
(#1100)4ca4b8e
)1714d7a
)new
doesnt fire creating or created hook (#808)new
to api (#808)c41f89d
)hasManyThrough
relation (#678)$isDirty()
, $getOriginal()
and $refresh
. (#757)update
method (fb1694f
)@OnDelete
on same model attrs leads to undefined error (#754)onDelete
if hook returns false (3531a06
)JSON.stringfy()
for comparing objects (300482d
)piniaStore()
(a8628c8
)ce54b23
)sortBy
(#636)null
is casted in DateCast (#565)59d55c4
)whereIn
to support Set
as values (#537)DateCast
(#546)delete
and destroy
methods to api (#529)bb99b49
)throwError
(#529)record
field to saving hooks (#491)groupBy
(#482)09b9dcf
)82b9cc4
)40cf182
)Enjoy a stable and feature rich orm for pinia ! 🍍
_meta
field for models containing metadata (#240)(where)has
queries are not working with 1:1 relations (#342)vue-hako
since it breaks with new vueuse version (#343)mutator
to operation
(#240)get
requests (#272)Warning There are slight API changes with this release candidate.
groupBy
method to query (#213)nanoid
& uuid
(#215)useRepo
outside of setup()
(#228)set
method of casts is not called (#215)pinia-orm/dist/decorators
(#185)pinia-orm/dist/casts
(#215)string
, array
, number
and boolean
(#215)ac4dd70
)piniaOptions
, useDataStore
, useStoreActions
and piniaStore
(#204)lerna
to lerna-lite
for workspace supportnormalizr
package (#191 )normalizr
to @pinia-orm/normalizr
(#192)Please refer to CHANGELOG.md for details.
Warning There are slight API changes with this release candidate.
make
in repositories can create now multiple records (#133)retrieved
life cycle hook (#145)@pinia/nuxt
(#150)fluid
selected in docsPiniaORM.install()
to createORM()
(902f4c2
)findIn
since find
does the same (#144)0b71a7d
)default
export in indexes and create build config for cjs (#142)unbuild
(#142)Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
Please refer to CHANGELOG.md for details.
First release
Please refer to CHANGELOG.md for details.