diff options
Diffstat (limited to 'lib/query/encoder.ml')
| -rw-r--r-- | lib/query/encoder.ml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/query/encoder.ml b/lib/query/encoder.ml index 624931a..2f86eab 100644 --- a/lib/query/encoder.ml +++ b/lib/query/encoder.ml @@ -203,10 +203,11 @@ module CaqtiRequest = Map (struct let t_n = Caqti_type.t11 let f : type a. a data -> a Caqti_type.t = function - | { content = Text; _ } -> Caqti_type.option @@ Caqti_type.string - | { content = Integer; _ } -> Caqti_type.option @@ Caqti_type.int64 - | { content = MultiReference _; _ } -> Caqti_type.option @@ Caqti_type.int64 - | { content = MonoReference _; _ } -> Caqti_type.option @@ Caqti_type.int64 + | { content_type = Text; _ } -> Caqti_type.option @@ Caqti_type.string + | { content_type = Integer; _ } -> Caqti_type.option @@ Caqti_type.int64 + | { content_type = MultiReference _; _ } -> Caqti_type.int64 + | { content_type = MonoReference _; _ } -> + Caqti_type.option @@ Caqti_type.int64 end) module DefaultEncoder = struct @@ -246,10 +247,10 @@ module EncodeInsert = Map (struct type 'a t = string let f : type a. a data -> a t = function - | { content = Text; _ } -> "?" - | { content = Integer; _ } -> "?" - | { content = MonoReference _; _ } -> "?" - | { content = MultiReference _; _ } -> + | { content_type = Text; _ } -> "?" + | { content_type = Integer; _ } -> "?" + | { content_type = MonoReference _; _ } -> "?" + | { content_type = MultiReference _; _ } -> failwith "Cannot encode multireference field" include ConcatParam @@ -259,10 +260,10 @@ module InsertTableName = Map (struct type 'a t = string let f : type a. a data -> a t = function - | { name = column; content = Text; _ } -> column - | { name = column; content = Integer; _ } -> column - | { name = column; content = MultiReference _; _ } -> column - | { name = column; content = MonoReference _; _ } -> column + | { name = column; content_type = Text; _ } -> column + | { name = column; content_type = Integer; _ } -> column + | { name = column; content_type = MultiReference _; _ } -> column + | { name = column; content_type = MonoReference _; _ } -> column include ConcatParam end) |
