Hello everyone. Is there a way of abstracting fragments from a query? For example, lets say that I have this query:
from(..., order_by: [
fragment(
"""
CASE
WHEN ? = 'elixir' THEN 1,
WHEN ? = 'ruby' THEN 2,
WHEN ? = 'gleam' THEN 3
END
""",
language.name
),
fragment("""
CASE
WHEN ? = 'something' THEN 1,
WHEN ? = 'anotherthing' THEN 2,
END
""",
language.somestuff
)
]
Let’s say I want to do this order_by in 2 different queries. Is there a way to abstract this?
Thank you for your help