Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New execute method for json objects #10

Merged
merged 3 commits into from
Jul 13, 2021
Merged

New execute method for json objects #10

merged 3 commits into from
Jul 13, 2021

Conversation

aaronschweig
Copy link
Contributor

What kind of change does this PR introduce?

This PR implements a new executeTo method which automatically parses the response into a json object as described in #7

What is the current behavior?

#7

What is the new behavior?

An ExecuteTo method was added to the structs as described which directly parses the response body into an interface{}

Additional context

I tried to implement the changes described in the issue but was not sure regarding the requriements. I currently implemented the functions as requested with the return value of an (interface{}, error) for the ExecuteTo functions.

I also thought about changing the function to ExecuteTo(target interface{}) error which enables the user to give a custom struct or map from outside. Then instead of creating a new object inside the executeTo function, this target value is used to parse the response body into. I would be open to implement this function as well - maybe under a different name like ExecuteInto

As this is my first contribution, i hope i didn't miss something or did something wrong, if so please let me know so i can fix it!

@yusufpapurcu
Copy link
Member

Actually I mis explained problem a little 😅
We need exactly ExecuteInto. Can you implement this named as ExecuteTo ?

Great work and thanks for support 👍

@aaronschweig
Copy link
Contributor Author

Okay, maybe i just misunderstood the issue 😃

I pushed the changes with the needed functionality 😄

@yusufpapurcu yusufpapurcu merged commit 829cbb8 into supabase-community:main Jul 13, 2021
@yusufpapurcu
Copy link
Member

Great work thanks for support 💯

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.

None yet

2 participants