zakodium / adonis-mongodb

MongoDB provider for AdonisJS 5
https://zakodium.github.io/adonis-mongodb/
Other
64 stars 12 forks source link

feat: support @computed decorator #153

Closed tpoisseau closed 11 months ago

tpoisseau commented 11 months ago

Closes: https://github.com/zakodium/adonis-mongodb/issues/135

codecov-commenter commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Coverage Δ
src/Model/Model.ts 98.05% <100.00%> (+0.09%) :arrow_up:
src/Model/proxyHandler.ts 100.00% <100.00%> (ø)
src/Odm/decorators.ts 100.00% <100.00%> (ø)

:loudspeaker: Thoughts on this report? Let us know!

targos commented 11 months ago

Did you try to make an API like Lucid?

tpoisseau commented 11 months ago

Yes, I try. I didn't found every places and it's hard to replicate code in two different codebase with differences. The ActiveRecord pattern is very confusing by mixing db row instances with DB API, and metadata of collection.

But, I ended to be able to make a correct @computed() getter without breaking existent tests

tpoisseau commented 11 months ago

I added support on toJSON serialization, if you see something else Lucid support with @computed you found important, Say it to me please