I am trying to write this query for postgres using Octo.jl
# postgres select all elements from table where column is in list and return in same order as list
# SELECT *
# FROM your_table
# WHERE your_column = ANY(ARRAY['value1', 'value2', 'value3'])
# ORDER BY POSITION(your_column::text in ARRAY['value1', 'value2', 'value3']);
I figure I may need to write the query as a literal string or I may just be able to use Octo’s DSL. But in either case I need to be able to convert a Vector{String} to a working sql string. This is what I’m trying:
using Octo.Adapters.SQL # to_sql
strings = ["a", "b", "c"]
@show to_sql([Enclosed(Any[strings...])])
ERROR: LoadError: too many parameters for type