adamc@469: functor Make(M : sig adamc@469: type key adamc@469: con id :: Name adamc@469: con parent :: Name adamc@469: con cols :: {Type} adamc@469: constraint [id] ~ [parent] adamc@469: constraint [id, parent] ~ cols adamc@469: adamc@469: val key_inj : sql_injectable key adamc@469: val option_key_inj : sql_injectable (option key) adamc@469: adamc@469: table tab : [id = key, parent = option key] ++ cols adamc@469: end) : sig adamc@469: adamc@469: con id = M.id adamc@469: con parent = M.parent adamc@469: adamc@469: val tree : ($([id = M.key, parent = option M.key] ++ M.cols) -> xbody) adamc@469: -> option M.key adamc@469: -> transaction xbody adamc@469: adamc@469: end