Skip to content

Conversation

@grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Jul 17, 2021

What kind of change does this PR introduce?

Refactor, improves current code.

Additional context

Hi, I'm willing to use these packages on one of my side projects, and while reading the code base, I found some room for code improvements and I decided to contribute by opening this PR.

These changes introduce only refactor and should not have the behavior changed.

Improved items

  • Remove unnecessary ifs from execute method of PostgrestBuilder class.
  • Replace ifs with guard whenever sounds better on class PostgrestBuilder.
  • Improve URL creation by not building a URLComponent and extracting a URL from it every time the method appendSearchParams is called.
  • Separate validation and parsing logic in different methods as they are different things.
  • Add SnapshotTesting for testing the URLRequest that are built by the builder classes (this is a suggestion on how to easy test the Builders)

@satishbabariya
Copy link
Member

LGTM 👍

@satishbabariya satishbabariya merged commit 1b214d6 into supabase-community:master Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants