petrol
petrol copied to clipboard
feat: add nullable fields and handling
Wondering if you are thinking there are any better options than this kind of idea?
This let's users do:
let table, fields =
StaticSchema.declare_table
schema
~name:"optional"
~constraints:[]
(let open Schema in
[ field "id" ~ty:Type.int ~constraints:[ primary_key (); not_null () ]
; field "username" ~ty:(Type.null_ty Type.text)
])
and encode the possibility of null in the field type.