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

Extract optional PostgREST properties and add schema support for RPC. #716

Merged
merged 8 commits into from
Sep 9, 2024

Conversation

jan-tennert
Copy link
Collaborator

@jan-tennert jan-tennert commented Sep 8, 2024

What kind of change does this PR introduce?

Feature (closes #713)

What is the current behavior?

Optional properties like defaultToNull for inserting or head for selecting are a function parameter. In increasing numbers, these function parameters get too clunky and as there are already some parameters in the DSL builder (PostgrestRequestBuilder), moving these properties would fit more.

What is the new behavior?

The Select, Insert and Upsert methods now have their own DSL inheriting from the base builder and adding these "old" function parameters. The syntax now looks like this:

supabase.from("table").select {
    head = true
}
supabase.from("table").upsert(myValue) {
    defaultToNull = false
    ignoreDuplicates = false
}
supabase.postgrest.rpc("function") {
    method = RpcMethod.GET
    schema = "mySchema"
}

Additional context

Add any other context or screenshots.

@jan-tennert jan-tennert added the enhancement New feature or request label Sep 8, 2024
@jan-tennert jan-tennert self-assigned this Sep 8, 2024
@jan-tennert jan-tennert merged commit bfee3d0 into master Sep 9, 2024
13 checks passed
@jan-tennert jan-tennert deleted the extract-postgrest branch September 9, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request postgrest tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add schema option for database functions
2 participants