modelRT/sql/topologic.go

15 lines
403 B
Go
Raw Normal View History

// Package sql define database sql statement
package sql
// RecursiveSQL define Topologic table recursive query statement
var RecursiveSQL = `WITH RECURSIVE recursive_tree as (
SELECT uuid_from,uuid_to,flag
FROM "Topologic"
WHERE uuid_from = ?
UNION ALL
2025-10-14 16:12:00 +08:00
SELECT t.uuid_from,t.uuid_to,t.flag
FROM "Topologic" t
JOIN recursive_tree rt ON t.uuid_from = rt.uuid_to
)
SELECT * FROM recursive_tree;`