7 type t
= | Int
| Text
| Blob
10 let to_string = Show.show
<t
>
11 (* let to_string = function | Int -> "Int" | Text -> "Text" | Blob -> "Blob" *)
12 let to_cpp_string x
= "typename Traits::" ^
(to_string x
)
17 type conflict_algo
= | Ignore
| Replace
| Abort
| Fail
| Rollback
20 type t
= | PrimaryKey
| NotNull
| Unique
| Autoincrement
| OnConflict
of conflict_algo
26 type t
= {name
:string; cpp_name
:string; sqltype
:Type.t
; constraints
:Constraint.t list
}
28 let make name sqltype constraints
=
29 {name
=name
; cpp_name
=name
; sqltype
=sqltype
; constraints
=constraints
}
30 let type_to_string c
= Type.to_string c
.sqltype
31 let type_to_cpp_string c
= Type.to_cpp_string c
.sqltype
32 let is_primary_key c
= List.mem
Constraint.PrimaryKey c
.constraints
37 type t
= {name
:string; cpp_name
:string; cols
:Col.t list
}
40 let make name cols
= {name
=name
;cpp_name
=name
;cols
=cols
}