~
This commit is contained in:
parent
f8ef92b67e
commit
eb3152a2f6
3 changed files with 89 additions and 81 deletions
33
src/pg.ml
33
src/pg.ml
|
|
@ -12,11 +12,6 @@ open Crypto
|
|||
module Caqti_type = struct
|
||||
include Caqti_type
|
||||
|
||||
(* we want to use int64 timestamps,
|
||||
not postgresql built-in timestamp type *)
|
||||
let ptime : Ptime.t option t = Timestamp.caqti
|
||||
let time = Timestamp.caqti
|
||||
|
||||
let amount : Amount.t t =
|
||||
let open Amount in
|
||||
custom
|
||||
|
|
@ -25,28 +20,14 @@ module Caqti_type = struct
|
|||
Amount.make ~sign:None ~currency:Config.currency ~value ~fraction)
|
||||
(t2 int64 int32)
|
||||
|
||||
(* we want to use int64 timestamps,
|
||||
not postgresql built-in timestamp type *)
|
||||
let ptime : Ptime.t option t = Timestamp.caqti
|
||||
let time = Timestamp.caqti
|
||||
let age_mask : int t = Caqti_type.int
|
||||
|
||||
let rsa_public : RsaPublicKey.t t =
|
||||
let open RsaPublicKey in
|
||||
custom
|
||||
~encode:(fun v -> Ok (to_octets v))
|
||||
~decode:(fun v -> of_octets v)
|
||||
octets
|
||||
|
||||
let eddsa_public : EddsaPublicKey.t t =
|
||||
let open EddsaPublicKey in
|
||||
custom
|
||||
~encode:(fun v -> Ok (to_octets v))
|
||||
~decode:(fun v -> Ok (of_octets v))
|
||||
octets
|
||||
|
||||
let eddsa_signature : EddsaSignature.t t =
|
||||
let open EddsaSignature in
|
||||
custom
|
||||
~encode:(fun v -> Ok (to_octets v))
|
||||
~decode:(fun s -> Ok (of_octets s))
|
||||
octets
|
||||
let rsa_public = RsaPublicKey.caqti
|
||||
let eddsa_public = EddsaPublicKey.caqti
|
||||
let eddsa_signature = EddsaSignature.caqti
|
||||
|
||||
include struct
|
||||
(* alias for hash *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue