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

Added select with foreign table #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DominatorVbN
Copy link

What kind of change does this PR introduce?

This PR introduce capability to query foreign tables using select

What is the current behavior?

Current api does not support querying foreign table like JS version https://supabase.com/docs/reference/javascript/select?example=query-foreign-tables

What is the new behavior?

New API would enable configuring the query to fetch foreign tables similar to JS SDK

Additional context

NA

@grdsdev
Copy link
Contributor

grdsdev commented Oct 9, 2023

Hi @DominatorVbN I think the current implementation is already capable of querying foreign tables, and rewriting the JS example you mentioned in Swift, it should be as follows and work as expected.

let response = try await client
  .database
  .from("countries")
  .select(columns: "name,cities(name)")
  .execute()
  .value

Can you try that within your project and let me know the result?

@DominatorVbN
Copy link
Author

Hi @DominatorVbN I think the current implementation is already capable of querying foreign tables, and rewriting the JS example you mentioned in Swift, it should be as follows and work as expected.

let response = try await client
  .database
  .from("countries")
  .select(columns: "name,cities(name)")
  .execute()
  .value

Can you try that within your project and let me know the result?

Hey,
Though this works, this seems like a bit too stringly typed API, can we may be try to alter it in direction where we could maybe write this query using more builder and less string format, which this PR can be a pert of, may be the implementation of the PR might not be optimal, but would like to have discussion around this.

@SergioB-dev
Copy link

I agree with @DominatorVbN here. The syntax to grab foreign tables seems off here. There should be a more ergonomic way.

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.

3 participants