edtris/waltz/sqltest.fnl

11 lines
270 B
Fennel

(local Sqlog (require :waltz.sqlog))
(import-macros {: $ : query : defrules} :waltz.macros)
(local s (Sqlog))
(s:deftable :parent :parent :child)
(defrules s
[(ancestor x y) (parent x y)]
[(ancestor x y) (parent x z) (ancestor z y)])
(pp (query s (ancestor x y)))