@@ -18,7 +18,7 @@ module Type = struct
1818 | String
1919 | Set (* of strings *)
2020 | Pairs (* of string * string *)
21- with sexp
21+ [ @@ deriving sexp ]
2222
2323 exception Error of t * t
2424 let _ = Printexc. register_printer (function
@@ -35,7 +35,7 @@ module Value = struct
3535 | String of string
3636 | Set of string list
3737 | Pairs of (string * string ) list
38- with sexp
38+ [ @@ deriving sexp ]
3939
4040 let marshal = function
4141 | String x -> x
@@ -73,33 +73,33 @@ module Column = struct
7373 default : Value .t option ; (* * if column is missing, this is default value is used *)
7474 ty : Type .t ; (* * the type of the value in the column *)
7575 issetref : bool ; (* * only so we can special case set refs in the interface *)
76- } with sexp
76+ } [ @@ deriving sexp ]
7777end
7878
7979module Table = struct
8080 type t = {
8181 name : string ;
8282 columns : Column .t list ;
8383 persistent : bool ;
84- } with sexp
84+ } [ @@ deriving sexp ]
8585 let find name t = List. find (fun col -> col.Column. name = name) t.columns
8686end
8787
8888type relationship =
8989 | OneToMany of string * string * string * string
90- with sexp
90+ [ @@ deriving sexp ]
9191
9292module Database = struct
9393 type t = {
9494 tables : Table .t list ;
95- } with sexp
95+ } [ @@ deriving sexp ]
9696
9797 let find name t = List. find (fun tbl -> tbl.Table. name = name) t.tables
9898end
9999
100100(* * indexed by table name, a list of (this field, foreign table, foreign field) *)
101101type foreign = (string * string * string ) list
102- with sexp
102+ [ @@ deriving sexp ]
103103
104104module ForeignMap = struct
105105 include Map. Make (struct
@@ -108,7 +108,7 @@ module ForeignMap = struct
108108 end )
109109
110110 type t' = (string * foreign ) list
111- with sexp
111+ [ @@ deriving sexp ]
112112
113113 type m = foreign t
114114 let sexp_of_m t : Sexplib.Sexp.t =
@@ -127,7 +127,7 @@ type t = {
127127 (* * indexed by table name, a list of (this field, foreign table, foreign field) *)
128128 one_to_many : ForeignMap .m ;
129129 many_to_many : ForeignMap .m ;
130- } with sexp
130+ } [ @@ deriving sexp ]
131131
132132let database x = x.database
133133
@@ -170,4 +170,3 @@ let many_to_many tblname schema =
170170 try
171171 ForeignMap. find tblname schema.many_to_many
172172 with Not_found -> []
173-
0 commit comments