package caqti
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Unified interface to relational database libraries
Install
dune-project
Dependency
Authors
Maintainers
Sources
caqti-0.10.2.tbz
sha256=d688bd22f6fde5be5a755900545fade0d5fdce6dbcb0b85770d02dad87c41e7c
md5=d18745a703da336054c0d27e78f8be8a
doc/src/caqti/caqti_response_sig.ml.html
Source file caqti_response_sig.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82(* Copyright (C) 2017--2018 Petter A. Urkedal <paurkedal@gmail.com> * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version, with the OCaml static compilation exception. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. *) (** Signature of a response from a database. *) module type S = sig type 'b future type ('b, +'m) t (** The type describing the response and containing returned data from a request execution. - ['b] is the type of a single row - ['m] is the possible multiplicities of rows *) (** {2 Result inspection} *) val returned_count : ('b, 'm) t -> (int, [> Caqti_error.retrieve | `Unsupported]) result future (** [returned_count resp] is the number of rows returned by [resp]. This function may not be available for all databases. *) val affected_count : ('b, 'm) t -> (int, [> Caqti_error.retrieve | `Unsupported]) result future (** [affected_count resp] is the number of rows affected by the updated the produced [resp]. This function may not be available for all databases. *) (** {2 Result retrieval} *) val exec : (unit, [< `Zero]) t -> (unit, [> Caqti_error.retrieve]) result future (** [exec resp] checks that [resp] succeeded with no result rows. *) val find : ('b, [< `One]) t -> ('b, [> Caqti_error.retrieve]) result future (** [find resp] checks that [resp] succeeded with a single row, and returns the decoded row. *) val find_opt : ('b, [< `Zero | `One]) t -> ('b option, [> Caqti_error.retrieve]) result future (** [find_opt resp] checks that [resp] succeeded with at most one row, and returns the row if any. *) val fold : ('b -> 'c -> 'c) -> ('b, 'm) t -> 'c -> ('c, [> Caqti_error.retrieve]) result future (** [fold f resp] folds [f] over the decoded rows returned in [resp]. *) val fold_s : ('b -> 'c -> ('c, 'e) result future) -> ('b, 'm) t -> 'c -> ('c, [> Caqti_error.retrieve] as 'e) result future (** [fold_s f resp] folds [f] over the decoded rows returned by [resp] within the IO and result monad. {b Note.} Do not make nested queries in the callback to this function. If you use the same connection, it may lead to data corruption. If you pull a different connection from the same pool, it may deadlock if the pool runs out of connections. Also, some drivers may not support simpltaneous connections. *) val iter_s : ('b -> (unit, 'e) result future) -> ('b, 'm) t -> (unit, [> Caqti_error.retrieve] as 'e) result future (** [iter_s f resp] iterates [f] over the decoded rows returned by [resp] within the IO and result monad. {b Note.} Do not make nested queries in the callback to this function. Cf. {!fold_s}. *) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>