adam@1867: table t : { Id : int, Blob : blob, MimeType : string }
adam@1867: sequence s
adam@1867:
adam@1867: fun getImage id : transaction page =
adam@1867: r <- oneRow1 (SELECT t.Blob, t.MimeType
adam@1867: FROM t
adam@1867: WHERE t.Id = {[id]});
adam@1867: returnBlob r.Blob (blessMime r.MimeType)
adam@1867:
adam@1867: fun main () : transaction page =
adam@1867: let
adam@1867: fun handle r =
adam@1867: id <- nextval s;
adam@1867: dml (INSERT INTO t (Id, Blob, MimeType)
adam@1867: VALUES ({[id]}, {[fileData r.File]}, {[fileMimeType r.File]}));
adam@1867: main ()
adam@1867: in
adam@1867: x <- queryX1 (SELECT t.Id FROM t)
adam@1867: (fn r =>
);
adam@1867: return
adam@1867:
adam@1867:
adam@1867: {x}
adam@1867:
adam@1867: end