supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
962 stars 128 forks source link

refactor: query parser cleanup #496

Closed bnjmnt4n closed 4 months ago

bnjmnt4n commented 7 months ago

What kind of change does this PR introduce?

Refactor

What is the current behavior?

There is a lot of duplicated code in the query parser, due to the field and renamed field parsing sharing the same code.

What is the new behavior?

The parsing of a field is extracted out to a separate ParseField helper, which can be reused to detect both a renamed field and non-renamed fields. I also updated some comments for accuracy.

bnjmnt4n commented 5 months ago

Any blockers for this?

steve-chavez commented 4 months ago

@bnjmnt4n Could you please rebase? Just merged https://github.com/supabase/postgrest-js/pull/429 which solves casting and didn't realize it would conflict with this PR.

bnjmnt4n commented 4 months ago

@steve-chavez I've rebased this, and will rebase my other PRs as well.

bnjmnt4n commented 4 months ago

Any chance in merging the other PRs: #497, #498, #499? I think a couple of others are particularly useful: #451, #458 (might need rebasing though).

steve-chavez commented 4 months ago

@bnjmnt4n Yeah, I'd like to merge those. Could you rebase?

bnjmnt4n commented 4 months ago

I’ve rebased those as well!

github-actions[bot] commented 3 months ago

:tada: This PR is included in version 1.12.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: