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

Supabase v2 Types #2

Closed
drewbietron opened this issue Oct 13, 2022 · 4 comments · Fixed by #3
Closed

Supabase v2 Types #2

drewbietron opened this issue Oct 13, 2022 · 4 comments · Fixed by #3
Assignees

Comments

@drewbietron
Copy link

Found this repo and found it very helpful, thank you for that!

This isn't an issue, but I was wondering if you've tried adapting this to the new v2 Supabase client? In particular the Typescript portion that's been added.

I'm able to get the table names typed.

type QueryCreator = (supabase: SupabaseClient<Database>) => PostgrestFilterBuilder<any, any>;

But getting the .select or other methods to be typed, as well as type the return value of the UseQueryResult have been pretty difficult. Was wondering if you've had any luck with it.

Supabase is doing some sort of TS voodoo to use the arguments passed to .from and it's a little over my head 🤯.

Appreciate any insight and thanks for creating this repo!

@HermanNygaard
Copy link
Owner

Hey @drewbietron ,

Thanks for your comment. I also agree with this and would love to see it, but got very limited time right now. If anyone is up for it please feel free to contribute.

@drewbietron
Copy link
Author

@HermanNygaard - Looking at React Query support with this library. Once the nut is cracked it could be applied to the context types here 💪 - psteinroe/supabase-cache-helpers#57 (comment)

@HermanNygaard
Copy link
Owner

@drewbietron I'm thinking to start looking into this now (and then moving to tanstack-query). I see you already have done some work (linked in the thread above and in supabase-issues), looks promising. Do you have any updates or a quick summary on what the blocker is now? Also cool to see supabase-cache-helpers – I didn't know about that library.

@HermanNygaard HermanNygaard added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Feb 6, 2023
@HermanNygaard HermanNygaard self-assigned this Feb 10, 2023
@HermanNygaard
Copy link
Owner

I have started integrating v2 here #3, mostly done

@HermanNygaard HermanNygaard linked a pull request Feb 17, 2023 that will close this issue
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 a pull request may close this issue.

2 participants