File: dbi_postgres.mli

package info (click to toggle)
ocamldbi 0.9.13-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 336 kB
  • ctags: 368
  • sloc: ml: 2,223; makefile: 268; sh: 32
file content (74 lines) | stat: -rw-r--r-- 2,784 bytes parent folder | download | duplicates (2)
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
(* PostgreSQL database interface for mod_caml programs.
 * Copyright (C) 2003-2004 Merjis Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: dbi_postgres.mli,v 1.5 2004/08/03 16:49:42 rwmj Exp $
 *)

(** Please see {!Dbi} for main documentation. *)

val string_of_timestamp : Dbi.datetime -> string
(** Convert a timestamp into a string. *)
val timestamp_of_string : string -> Dbi.datetime
(** Convert a string into a timestamp. *)
val string_of_interval : Dbi.datetime -> string
(** Convert an interval into a string. *)
val interval_of_string : string -> Dbi.datetime
(** Convert a string into an interval. *)

class connection :
  ?host:string ->
  ?port:string ->
  ?user:string ->
  ?password:string ->
  string ->
object
  method close : unit -> unit
  method closed : bool
  method commit : unit -> unit
  method database : string
  method database_type : string
  method debug : bool
  method ex : string -> Dbi.sql_t list -> Dbi.statement
  method host : string option
  method id : int
  method password : string option
  method ping : unit -> bool
  method port : string option
  method prepare : string -> Dbi.statement
  method prepare_cached : string -> Dbi.statement
  method register_postrollback : (unit -> unit) -> Dbi.postrollback_handle
  method register_precommit : (unit -> unit) -> Dbi.precommit_handle
  method rollback : unit -> unit
  method set_debug : bool -> unit
  method unregister_postrollback : Dbi.postrollback_handle -> unit
  method unregister_precommit : Dbi.precommit_handle -> unit
  method user : string option
end

val connect : ?host:string -> ?port:string ->
  ?user:string -> ?password:string -> string -> connection
(** Functional version of [new Dbi.connection ...] *)
val close : connection -> unit
(** Functional version of [dbh#close ()] *)
val closed : connection -> bool
(** Functional version of [dbh#closed] *)
val commit : connection -> unit
(** Functional version of [dbh#commit ()] *)
val ping : connection -> bool
(** Functional version of [dbh#ping ()] *)
val rollback : connection -> unit
(** Functional version of [dbh#rollback ()] *)