lucid icon indicating copy to clipboard operation
lucid copied to clipboard

feat: allow serialize callback in hasOne and hasMany

Open Sebastien-Ahkrin opened this issue 3 years ago • 20 comments

Proposed changes

This will add the serialize feature of column in the hasOne decorator

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [x] I have read the CONTRIBUTING doc
  • [x] Lint and unit tests pass locally with my changes
  • [x] I have added tests that prove my fix is effective or that my feature works.
  • [ ] I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Sebastien-Ahkrin avatar Aug 30 '22 09:08 Sebastien-Ahkrin

@thetutlage I'm mentoring Sébastien on this (the idea is to add support for serialize callback in @hasOne).

targos avatar Aug 30 '22 09:08 targos

@targos Can we have it for the relationships?

thetutlage avatar Aug 30 '22 14:08 thetutlage

@thetutlage Do you mean for the other relationships too?

targos avatar Aug 30 '22 14:08 targos

Yup

thetutlage avatar Aug 30 '22 14:08 thetutlage

Let's start with one, and try to replicate to the others after :)

targos avatar Aug 30 '22 14:08 targos

Let's start with one, and try to replicate to the others after :)

I think we will have to release all of them together, so that all relationships have similar and consistent API.

But yes, in the PR, we can do it one at a time

thetutlage avatar Aug 31 '22 10:08 thetutlage

I know the PR is in draft mode. So feel free to ignore this comment.

I see there is only one test committed to the source code. Is it that you are going to implement the serialize method afterwards?

thetutlage avatar Aug 31 '22 10:08 thetutlage

I know the PR is in draft mode. So feel free to ignore this comment.

I see there is only one test committed to the source code. Is it that you are going to implement the serialize method afterwards?

i wanted to create the PR first to allow me to test before creating my PR i can close this Pr and re-open it after if wanted ?

Sebastien-Ahkrin avatar Sep 02 '22 09:09 Sebastien-Ahkrin

@Sebastien-Ahkrin

No worries. You can also use this PR to add the actual implementation. I asked to make sure that my understanding is correct :)

thetutlage avatar Sep 02 '22 09:09 thetutlage

@thetutlage i have a little question so about how to run the test cases in my computer .... After running, the npm run test script, i have this error message:

Capture d’écran 2022-09-02 à 12 01 16

Do i have to do something ? i really wanted to run my test in my computer :/

Sebastien-Ahkrin avatar Sep 02 '22 10:09 Sebastien-Ahkrin

I think for the serialization change, you can skip docker altogether and run tests using sqlite only.

So, please run npm run test:sqlite to run tests

thetutlage avatar Sep 02 '22 11:09 thetutlage

@thetutlage We made an initial implementation on @hasOne? We would like to have you feedback on it before doing the change to the other kinds of relations.

targos avatar Sep 06 '22 12:09 targos

@thetutlage does it LGTY now?

targos avatar Nov 07 '22 13:11 targos

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 16 '23 02:01 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 18 '23 04:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 18 '23 23:05 stale[bot]

@thetutlage We still hope that you can review/merge this one day.

targos avatar May 19 '23 09:05 targos

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 10 '23 05:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 15 '23 12:10 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 17 '24 12:03 stale[bot]