Andrey V
02/19/2025, 7:20 AMobject Objects : UUIDTable("objects", "id") { val data = json<...>("data"); val prev = uuid("prev").references(id); }
what's the DSL syntax for CTEs to do things like linked list building given the SQL form
WITH objs
AS(
SELECT data, id, prev FROM Objects where id = ${ID}
UNION
SELECT o.data, o.id, o.prev FROM Objects o JOIN objs ON (o.id = objs.prev)
)
SELECT objs.data, objs.id, objs.prev FROM objs;
where ${ID}
is the usual Query.where { id eq ... }
(also, is there a way to create virtual tables for pre-join filtering? I can work around it with a post-join filtering but the virtual table creation helps filter early and clean the data set pre join (and pre recurse))