15 lines
403 B
Go
15 lines
403 B
Go
// 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
|
|
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;`
|