diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-31 16:11:15 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-31 16:11:15 -0400 |
commit | b027a79d3f701b4d2d4d1849449e4e6d8b973fcd (patch) | |
tree | 2a59c923141b406475b379c2c9f0a573e2038206 | |
parent | a7ffe5cf661a65e0dc48b90f16df9746de034096 (diff) |
Monoize OFFSET
-rw-r--r-- | src/monoize.sml | 10 | ||||
-rw-r--r-- | tests/limit.ur | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 620956f7..3bf96f26 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -752,6 +752,16 @@ fun monoExp (env, st, fm) (all as (e, loc)) = | L.EFfi ("Basis", "sql_no_offset") => ((L'.EPrim (Prim.String ""), loc), fm) + | L.EFfiApp ("Basis", "sql_offset", [e]) => + let + val (e, fm) = monoExp (env, st, fm) e + in + (strcat loc [ + (L'.EPrim (Prim.String " OFFSET "), loc), + (L'.EFfiApp ("Basis", "sqlifyInt", [e]), loc) + ], + fm) + end | L.EFfi ("Basis", "sql_eq") => ((L'.EPrim (Prim.String "="), loc), fm) diff --git a/tests/limit.ur b/tests/limit.ur index 03deb0b3..2079b47c 100644 --- a/tests/limit.ur +++ b/tests/limit.ur @@ -10,7 +10,7 @@ val q4 = fn n => fn m => (SELECT * FROM t LIMIT {n} OFFSET {m}) datatype list a = Nil | Cons of a * list a val r1 : transaction (list {A : int, B : string, C : float}) = - query (q2 3) + query (q4 3 7) (fn fs acc => return (Cons (fs.T, acc))) Nil |