bomberpac/waltz/sqltest.fnl

13 lines
316 B
Plaintext
Raw Normal View History

2022-03-27 04:10:37 +00:00
(local Sqlog (require :waltz.sqlog))
(import-macros {: $ : query : defrules} :waltz.macros)
(local s (Sqlog))
(s:deftable :parent :parent :child)
2022-03-27 16:26:26 +00:00
(s:deftable :p :x :y)
(s:deftable :q :z)
2022-03-27 04:10:37 +00:00
(defrules s
2022-03-27 16:26:26 +00:00
([ancestor x y] [parent x y])
([ancestor x y] [parent x z] [ancestor z y]))
(pp (query s [p x y] [q (+ x 1)]))
2022-03-27 04:10:37 +00:00