We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to get latest record,but i don't know how to query to meet such needs.
The text was updated successfully, but these errors were encountered:
So there is a way to do this. If you look at this file on line 343:
func (b *SelectRequestBuilder) OrderBy(column, direction string) *SelectRequestBuilder { b.params.Set("order", column+"."+direction) return b }
The way it would be used is:
var results []interface{} client := supa.CreateClient(supabase_url, supabase_key) err := client.DB.From(tableName).Select("*").OrderBy("name", "asc").ExecuteWithContext(ctx, &results) log.Info("results", results)
However, this addition hasn't been added to the latest tags/ releases of postgres-go so you currently can't do it until @nedpals adds the new tag.
I did push this PR though, so that the function would work this way since the order parameter is just a binary function at the end of the day.
order
If accepted the function would work like this:
var results []interface{} client := supa.CreateClient(supabase_url, supabase_key) // true for ascend // false for descend err := client.DB.From(tableName).Select("*").OrderBy("name", true).ExecuteWithContext(ctx, &results) log.Info("results", results) ``
Sorry, something went wrong.
So in conclusion, we can not use OrderBy, can we?
No branches or pull requests
I want to get latest record,but i don't know how to query to meet such needs.
The text was updated successfully, but these errors were encountered: