What is the proper syntax in Sequel to order by a slice of an SQL array value?
Here's what I want to do in SQL:
SELECT
a, -- column with SQL array values
depth,
name
FROM
nodes
ORDER BY
a[0:depth], name -- sort by 'a' ignoring last element, then by 'name'
In Sequel, I could do:
DB[:nodes].select(:a, :depth, :name).order(:a, :name)
but this sorts by all of :a, not the [0:depth] slice as desired. What's the proper syntax?