my $query = <<"";
WITH RECURSIVE record_links_rec_${wanted}(id, from_table, from_id, to_table, to_id, depth, path, cycle) AS (
SELECT id, from_table, from_id, to_table, to_id,
my $query = <<"";
WITH RECURSIVE record_links_rec_${wanted}(id, from_table, from_id, to_table, to_id, depth, path, cycle) AS (
SELECT id, from_table, from_id, to_table, to_id,