adamc@325: functor Make(M : sig adamc@325: con cols :: {Type} adamc@325: constraint [Id] ~ cols adamc@325: val tab : sql_table ([Id = int] ++ cols) adamc@325: adamc@325: val title : string adamc@325: adamc@325: val cols : $(mapTT (fn t => {Show : t -> xbody}) cols) adamc@325: end) = struct adamc@325: adamc@325: open constraints M adamc@325: val tab = M.tab adamc@325: adamc@325: fun list () = adamc@325: rows <- query (SELECT * FROM tab AS T) adamc@325: (fn fs acc => return adamc@325: {acc} {txt _ fs.T.Id} adamc@325: ) ; adamc@325: return adamc@325: List adamc@325: adamc@325: adamc@325: adamc@325:

List

adamc@325: adamc@325: adamc@325: adamc@325: {rows} adamc@325:
ID
adamc@325: adamc@325: adamc@325: fun main () : transaction page = return adamc@325: {cdata M.title} adamc@325: adamc@325:

{cdata M.title}

adamc@325: adamc@325:
  • List all rows
  • adamc@325: adamc@325: adamc@325: end