Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Internal Map doesn't allow url params with the same keys #14

Open
prilaga opened this issue Dec 29, 2022 · 3 comments
Open

Internal Map doesn't allow url params with the same keys #14

prilaga opened this issue Dec 29, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@prilaga
Copy link

prilaga commented Dec 29, 2022

  val postgrestClient = PostgrestDefaultClient(
                    uri = URI("https://......."),
                    headers = mapOf("piu" to "kjxhzfldjfglekjblcnakuefhlk")
                )

                return postgrestClient.from<Message>("table_name")
                    .select("*")
                    .ilike("key", "%hello%")
                    .gt("like", 1_000_000) // Greater than
                    .lt("like", 3_000_000) // Less than
                    .order("like", false)
                    .limit(10)
                    .execute()

"value", 1_000_000 - will never be added to the request, because internal map will rewrite it with "value", 3_000_000
Recommendation to use multi map and then build a request.

@prilaga prilaga added the bug Something isn't working label Dec 29, 2022
@ponytailer
Copy link
Contributor

You should use the

rangeGt rangeGte and etc.

@prilaga
Copy link
Author

prilaga commented Jan 29, 2023

@ponytailer Could you please write an example, how to use it?
What is the format of range parameter in the method?
For example int field "count" - range: "500, 600" or "[500,600]" or "{500,600}".

fun rangeGt(column: String, range: String): PostgrestFilterBuilder<T> {
        setSearchParam(column, "sr.${range}")
        return this
    }

@ponytailer
Copy link
Contributor

@ponytailer Could you please write an example, how to use it?

What is the format of range parameter in the method?

For example int field "count" - range: "500, 600" or "[500,600]" or "{500,600}".


fun rangeGt(column: String, range: String): PostgrestFilterBuilder<T> {

        setSearchParam(column, "sr.${range}")

        return this

    }

https://postgrest.org/en/stable/api.html?highlight=nxl#operators

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants