api query parameters in toddle

  • ssssadsadasd-1351544975657275403

    ssssadsadasd

    1 month ago

    how would this sql call look like in a toddle api call? I am not sure how to incorporate the where and order by clauses. thanks


    SELECT *
    FROM profiles
    WHERE LOWER(name) LIKE LOWER(CONCAT('%', :search, '%')) OR LOWER(username) LIKE LOWER(CONCAT('%', :search, '%'))
    ORDER BY CASE
    WHEN user_type IN ('Club', 'Player') THEN 0
    ELSE 1
    END,
    name
    LIMIT 7;
  • lucasg-1351628112848486511

    Lucas G

    1 month ago

    That would depend on the API you are calling and how they expect things to be formatted
  • ssssadsadasd-1351629929649016932

    ssssadsadasd

    1 month ago

    using supabase @Lucas G
  • lucasg-1351684288596410469

    Lucas G

    1 month ago

    Supabase uses PostgREST for its Rest API so you can use its docs to get an idea of how to do it:
    https://docs.postgrest.org/en/v12/references/api/tables_views.html