PageRenderTime 13ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Database/HDBC/PostgreSQL.hs

http://github.com/hdbc/hdbc-postgresql
Haskell | 82 lines | 13 code | 8 blank | 61 comment | 0 complexity | 41d9ddd589870f01de42d0c9d32aa831 MD5 | raw file
 1{- |
 2   Module     : Database.HDBC.PostgreSQL
 3   Copyright  : Copyright (C) 2005-2011 John Goerzen
 4   License    : BSD3
 5
 6   Maintainer : John Goerzen <jgoerzen@complete.org>
 7   Stability  : provisional
 8   Portability: portable
 9
10HDBC driver interface for PostgreSQL 8.x
11
12Written by John Goerzen, jgoerzen\@complete.org
13
14/NOTE ON DATES AND TIMES/
15
16The recommended correspondence between PostgreSQL date and time types and HDBC SqlValue
17types is:
18
19* SqlLocalDate: DATE
20
21* SqlLocalTimeOfDay: TIME WITHOUT TIME ZONE
22
23* SqlZonedLocalTimeOfDay: TIME WITH TIME ZONE
24
25* SqlLocalTime: TIMESTAMP WITHOUT TIME ZONE
26
27* SqlZonedTime: TIMESTAMP WITH TIME ZONE
28
29* SqlUTCTime: TIMESTAMP WITH TIME ZONE
30
31* SqlDiffTime: INTERVAL
32
33* SqlPOSIXTime: NUMERIC
34
35* SqlEpochTime: INTEGER
36
37* SqlTimeDiff: INTERVAL
38
39Other combinations are possible, and may even be converted automatically.
40The above simply represents the types that seem the most logical correspondence,
41and thus are tested by the HDBC-PostgreSQL test suite.
42
43-}
44
45module Database.HDBC.PostgreSQL
46    (
47     -- * Connecting to Databases
48     connectPostgreSQL, withPostgreSQL,
49     connectPostgreSQL', withPostgreSQL',
50     Connection,
51
52     -- * Transactions
53     begin,
54
55     -- * PostgreSQL Error Codes
56     --
57     -- |When an @SqlError@ is thrown, the field @seState@ is set to one of the following
58     -- error codes.
59     module Database.HDBC.PostgreSQL.ErrorCodes,
60
61     -- * Threading
62     -- $threading
63    )
64
65where
66
67import Database.HDBC.PostgreSQL.Connection(connectPostgreSQL, withPostgreSQL,
68                                           connectPostgreSQL', withPostgreSQL',
69                                           begin, Connection())
70import Database.HDBC.PostgreSQL.ErrorCodes
71
72{- $threading
73   
74   Provided the local libpq library is thread-safe, multiple 'Connection's may be used
75   to have concurrent database queries.  Concurrent queries issued on a single 
76   'Connection' will be performed serially.
77
78   When the local libpq library is not thread-safe (ie. it has not been compiled with 
79   --enable-thread-safety), only a single database function will be performed at a time.
80  
81-}
82