.
This commit is contained in:
parent
4913d8ca76
commit
c0ef1aede1
8 changed files with 47 additions and 16 deletions
|
|
@ -1,6 +1,8 @@
|
|||
type t = Ptime.t option
|
||||
type span = Ptime.Span.t option
|
||||
|
||||
let epoch = Some Ptime.epoch
|
||||
|
||||
let diff a b =
|
||||
match (a, b) with
|
||||
| None, _ | _, None -> None
|
||||
|
|
@ -79,7 +81,7 @@ let decode_int64 i = if i = Int64.max_int then None else Some (ptime_of_int64 i)
|
|||
let bin = Bin.map Bin.neint64 decode_int64 encode_int64
|
||||
let bin_nbo = Bin.map Bin.beint64 decode_int64 encode_int64
|
||||
|
||||
let caqti : Ptime.t option Caqti_type.t =
|
||||
let caqti : t Caqti_type.t =
|
||||
let encode v = Ok (encode_int64 v) in
|
||||
let decode v = Ok (decode_int64 v) in
|
||||
Caqti_type.custom ~encode ~decode Caqti_type.int64
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue