Skip to content

Conversation

thecoolwinter
Copy link
Contributor

What kind of change does this PR introduce?

Adds modifiers that are available in the supabase-js library

  • limit
  • order
  • single
  • range
  • offset <- this last one isn't the js library but is available in the postgrest server and seems really useful

What is the new behavior?

Queries can now add modifiers when building, eg:

// Get 15 users and order by their name descending
client.from("users")
    .order("name", desc: true)
    .limit(15)

// Get one user
client.from("users")
    .single()

// Get posts after the 15th result until the 30th result
client.from("posts")
    .range(15, 30)

// Same as above, but uses the `offset` modifier.
client.from("posts")
    .offset(15)
    .limit(15)

Copy link
Contributor

@grdsdev grdsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks!

@grdsdev grdsdev merged commit 0e4f7d8 into supabase-community:master Aug 30, 2021
@thecoolwinter thecoolwinter deleted the add-modifiers branch December 1, 2021 23:01
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