aboutsummaryrefslogtreecommitdiff
path: root/lib/sql/trim.ml
blob: 4e4bcf4322d065a873135c606f57a4f51d44b7e8 (plain)
1
2
3
4
5
6
7
8
9
(* Override the trim function with another which also remove the retchar *)

let f : Sqlite3.Data.t -> Sqlite3.Data.t =
 fun data ->
  match data with
  | Sqlite3.Data.TEXT content -> Sqlite3.Data.TEXT (String.trim content)
  | _ -> data

let register : Sqlite3.db -> unit = fun db -> Sqlite3.create_fun1 db "trim" f