package pgx_async

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Async based Postgres client based on Pgx.

include Pgx.S with type 'a Io.t = 'a Async_kernel.Deferred.t and type Io.ssl_config = Conduit_async.Ssl.config
type t
module Io : sig ... end
val connect : ?ssl:[ `Always of Io.ssl_config | `Auto | `No ] -> ?host:string -> ?port:int -> ?user:string -> ?password:string -> ?database:string -> ?unix_domain_socket_dir:string -> ?verbose:int -> ?max_message_length:int -> unit -> t Io.t
val close : t -> unit Io.t
val with_conn : ?ssl:[ `Always of Io.ssl_config | `Auto | `No ] -> ?host:string -> ?port:int -> ?user:string -> ?password:string -> ?database:string -> ?unix_domain_socket_dir:string -> ?verbose:int -> ?max_message_length:int -> (t -> 'a Io.t) -> 'a Io.t
val ping : t -> unit Io.t
val alive : t -> bool Io.t
val begin_work : ?isolation:Pgx__.Isolation.t -> ?access:Pgx__.Access.t -> ?deferrable:bool -> t -> t Io.t
val commit : t -> unit Io.t
val rollback : t -> unit Io.t
val with_transaction : ?isolation:Pgx__.Isolation.t -> ?access:Pgx__.Access.t -> ?deferrable:bool -> t -> (t -> 'b Io.t) -> 'b Io.t
module Prepared : sig ... end
val execute : ?params:Pgx__.Types.row -> t -> string -> Pgx__.Types.row list Io.t
val execute_unit : ?params:Pgx__.Types.row -> t -> string -> unit Io.t
val execute_fold : ?params:Pgx__.Types.param list -> t -> string -> init:'accum -> f:('accum -> Pgx__.Types.row -> 'accum Io.t) -> 'accum Io.t
val execute_map : ?params:Pgx__.Types.param list -> t -> string -> f:(Pgx__.Types.row -> 'a Io.t) -> 'a list Io.t
val execute_iter : ?params:Pgx__.Types.param list -> t -> string -> f:(Pgx__.Types.row -> unit Io.t) -> unit Io.t
val execute_many : t -> query:string -> params:Pgx__.Types.param list list -> Pgx__.Types.row list list Io.t
val simple_query : t -> string -> Pgx__.Types.row list list Io.t
module Thread : Pgx.Io with type 'a t = 'a Async_kernel.Deferred.t
val execute_pipe : ?params:Pgx.row -> t -> string -> Pgx.row Async_kernel.Pipe.Reader.t

Like execute but returns a pipe so you can operate on the results before they have all returned. Note that execute_iter and execute_fold can perform significantly better because they don't have as much overhead.

module Value = Pgx_value_core

Exposed for backwards compatiblity. New code should use Pgx_value_core directly.

OCaml

Innovation. Community. Security.