Permalink
Browse files

[syntax] go for totally separate sqlite/appengine syntax backends, an…

…d factor them back in later (when the Tokyo Cabinet ones are done too)
  • Loading branch information...
1 parent 467e019 commit 3b77442314e7fbd23d3299fc61054593d2135e81 @avsm committed Mar 14, 2010
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/syntax/Makefile
  2. +1 −1 lib/syntax/{p4_orm.ml → p4_orm_sqlite.ml}
  3. +4 −4 lib/syntax/pa_orm.ml
View
@@ -1,7 +1,7 @@
OCAMLMAKEFILE = ../../OCamlMakefile
ANNOTATE = yes
-SOURCES = p4_hash.ml pa_hash.ml p4_utils.ml p4_orm.ml pa_orm.ml
+SOURCES = p4_hash.ml pa_hash.ml p4_utils.ml p4_orm_sqlite.ml p4_orm_appengine.ml pa_orm.ml
PACKS = type-conv dyntype.syntax
RESULT = pa_orm
USE_CAMLP4 = yes
@@ -251,7 +251,7 @@ let cache_module env tds (_loc, n, t) =
end)
>>
-let gen mode env tds =
+let gen env tds =
let _loc = loc_of_ctyp tds in
let ts = list_of_ctyp_decl tds in
@@ -84,8 +84,8 @@ let _ =
let _loc = loc_of_ctyp tds in
let args = match args with None -> [] |Some x -> x in
let mode, keys = List.partition (function `Mode _ -> true |_ -> false) args in
- let mode = match mode with [] -> `Sqlite | [`Mode x] -> x | _ -> failwith "too many mode args" in
- P4_orm.gen mode keys tds
+ match mode with
+ | [] | [`Mode `Sqlite] -> P4_orm_sqlite.gen keys tds
+ | [`Mode `Appengine] -> P4_orm_appengine.gen keys tds
+ | _ -> failwith "unknown orm:mode argument"
)
-
-

0 comments on commit 3b77442

Please sign in to comment.