Hi guys, is there a way to concat in a select ? Li...
# help
g
Hi guys, is there a way to concat in a select ? Like so:
Copy code
const { data: parts } = await supabase
      .from('parts')
      .select(
        "CONCAT(root, '-', REPEAT('0', 5 - length(number::TEXT)), number, '-', revision) AS SERIAL"
      )
      .order('serial')
s
Hi @User. You can create a [computed column](https://github.com/supabase/supabase/discussions/3582#discussioncomment-1497587) for that. It's not possible to call sql functions directly through the library in that way. https://postgrest.org/en/stable/api.html#computed-columns
g
Thank you Steve !