This file is indexed.

/usr/share/doc/libghc-hdbc-doc/html/Database-HDBC.html is in libghc-hdbc-doc 2.4.0.1-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Database.HDBC</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Database-HDBC.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Database-HDBC.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">HDBC-2.4.0.1: Haskell Database Connectivity</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2005-2011 John Goerzen</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>John Goerzen &lt;jgoerzen@complete.org&gt;</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Database.HDBC</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Introduction</a><ul><li><a href="#g:2">Features</a></li><li><a href="#g:3">Available Drivers</a></li></ul></li><li><a href="#g:4">Typing of transfer data</a></li><li><a href="#g:5">Database Connections</a><ul><li><a href="#g:6">Wrapped Connections</a></li><li><a href="#g:7">Preparing Queries</a></li><li><a href="#g:8">Transaction Handling</a></li><li><a href="#g:9">Connection Inquiries</a></li></ul></li><li><a href="#g:10">Statements</a><ul><li><a href="#g:11">Execution</a></li><li><a href="#g:12">Fetching Results</a></li><li><a href="#g:13">Statement Inquires</a></li><li><a href="#g:14">Miscellaneous</a></li></ul></li><li><a href="#g:15">Exceptions</a></li><li><a href="#g:16">Column Types</a></li><li><a href="#g:17">Threading</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Welcome to HDBC, the Haskell Database Connectivity library.</p><p>Written by John Goerzen, jgoerzen@complete.org</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:SqlValue">SqlValue</a><ul class="subs"><li>= <a href="#v:SqlString">SqlString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li>| <a href="#v:SqlByteString">SqlByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li>| <a href="#v:SqlWord32">SqlWord32</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word32">Word32</a></li><li>| <a href="#v:SqlWord64">SqlWord64</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a></li><li>| <a href="#v:SqlInt32">SqlInt32</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int32">Int32</a></li><li>| <a href="#v:SqlInt64">SqlInt64</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int64">Int64</a></li><li>| <a href="#v:SqlInteger">SqlInteger</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li>| <a href="#v:SqlChar">SqlChar</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Char.html#t:Char">Char</a></li><li>| <a href="#v:SqlBool">SqlBool</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li>| <a href="#v:SqlDouble">SqlDouble</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Double">Double</a></li><li>| <a href="#v:SqlRational">SqlRational</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Rational">Rational</a></li><li>| <a href="#v:SqlLocalDate">SqlLocalDate</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a></li><li>| <a href="#v:SqlLocalTimeOfDay">SqlLocalTimeOfDay</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a></li><li>| <a href="#v:SqlZonedLocalTimeOfDay">SqlZonedLocalTimeOfDay</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeZone">TimeZone</a></li><li>| <a href="#v:SqlLocalTime">SqlLocalTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:LocalTime">LocalTime</a></li><li>| <a href="#v:SqlZonedTime">SqlZonedTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:ZonedTime">ZonedTime</a></li><li>| <a href="#v:SqlUTCTime">SqlUTCTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a></li><li>| <a href="#v:SqlDiffTime">SqlDiffTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:NominalDiffTime">NominalDiffTime</a></li><li>| <a href="#v:SqlPOSIXTime">SqlPOSIXTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a></li><li>| <a href="#v:SqlEpochTime">SqlEpochTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li>| <a href="#v:SqlTimeDiff">SqlTimeDiff</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li>| <a href="#v:SqlNull">SqlNull</a></li></ul></li><li class="src short"><a href="#v:toSql">toSql</a> :: <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> a <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> =&gt; a -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></li><li class="src short"><a href="#v:fromSql">fromSql</a> :: <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> a =&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> -&gt; a</li><li class="src short"><a href="#v:safeFromSql">safeFromSql</a> :: <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> a =&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> -&gt; <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:ConvertResult">ConvertResult</a> a</li><li class="src short"><a href="#v:nToSql">nToSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integral">Integral</a> a =&gt; a -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></li><li class="src short"><a href="#v:iToSql">iToSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></li><li class="src short"><a href="#v:posixToSql">posixToSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a> -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></li><li class="src short"><span class="keyword">class</span> <a href="#t:IConnection">IConnection</a> conn <span class="keyword">where</span><ul class="subs"><li><a href="#v:disconnect">disconnect</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:commit">commit</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:rollback">rollback</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:runRaw">runRaw</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:run">run</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li><a href="#v:prepare">prepare</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Database-HDBC.html#t:Statement">Statement</a></li><li><a href="#v:clone">clone</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> conn</li><li><a href="#v:hdbcDriverName">hdbcDriverName</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:hdbcClientVer">hdbcClientVer</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:proxiedClientName">proxiedClientName</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:proxiedClientVer">proxiedClientVer</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:dbServerVer">dbServerVer</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:dbTransactionSupport">dbTransactionSupport</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:getTables">getTables</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]</li><li><a href="#v:describeTable">describeTable</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC-ColTypes.html#t:SqlColDesc">SqlColDesc</a>)]</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:ConnWrapper">ConnWrapper</a> = <span class="keyword">forall</span> conn . <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; <a href="#v:ConnWrapper">ConnWrapper</a> conn</li><li class="src short"><a href="#v:withWConn">withWConn</a> :: <span class="keyword">forall</span> b. <a href="Database-HDBC.html#t:ConnWrapper">ConnWrapper</a> -&gt; (<span class="keyword">forall</span> conn. <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; b) -&gt; b</li><li class="src short"><a href="#v:sRun">sRun</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:quickQuery-39-">quickQuery'</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]]</li><li class="src short"><a href="#v:quickQuery">quickQuery</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]]</li><li class="src short"><a href="#v:withTransaction">withTransaction</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; (conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><span class="keyword">data</span> <a href="#t:Statement">Statement</a></li><li class="src short"><a href="#v:execute">execute</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:executeRaw">executeRaw</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:sExecute">sExecute</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:executeMany">executeMany</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:sExecuteMany">sExecuteMany</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [[<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:fetchRow">fetchRow</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>])</li><li class="src short"><a href="#v:fetchRowAL">fetchRowAL</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)])</li><li class="src short"><a href="#v:fetchRowMap">fetchRowMap</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>))</li><li class="src short"><a href="#v:sFetchRow">sFetchRow</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>])</li><li class="src short"><a href="#v:fetchAllRows">fetchAllRows</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]]</li><li class="src short"><a href="#v:fetchAllRows-39-">fetchAllRows'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]]</li><li class="src short"><a href="#v:fetchAllRowsAL">fetchAllRowsAL</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)]]</li><li class="src short"><a href="#v:fetchAllRowsAL-39-">fetchAllRowsAL'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)]]</li><li class="src short"><a href="#v:fetchAllRowsMap">fetchAllRowsMap</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]</li><li class="src short"><a href="#v:fetchAllRowsMap-39-">fetchAllRowsMap'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]</li><li class="src short"><a href="#v:sFetchAllRows">sFetchAllRows</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]]</li><li class="src short"><a href="#v:sFetchAllRows-39-">sFetchAllRows'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]]</li><li class="src short"><a href="#v:getColumnNames">getColumnNames</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:describeResult">describeResult</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC-ColTypes.html#t:SqlColDesc">SqlColDesc</a>)]</li><li class="src short"><a href="#v:finish">finish</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:originalQuery">originalQuery</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:SqlError">SqlError</a> = <a href="#v:SqlError">SqlError</a> {<ul class="subs"><li><a href="#v:seState">seState</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li><li><a href="#v:seNativeError">seNativeError</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li><li><a href="#v:seErrorMsg">seErrorMsg</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li></ul>}</li><li class="src short"><a href="#v:throwSqlError">throwSqlError</a> :: <a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:catchSql">catchSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; (<a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:handleSql">handleSql</a> :: (<a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:sqlExceptions">sqlExceptions</a> :: <a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Database-HDBC.html#t:SqlError">SqlError</a></li><li class="src short"><a href="#v:handleSqlError">handleSqlError</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short">module <a href="Database-HDBC-ColTypes.html">Database.HDBC.ColTypes</a></li></ul></div><div id="interface"><h1 id="g:1">Introduction</h1><div class="doc"><p>Welcome to HDBC, Haskell Database Connectivity.</p><p>HDBC provides an abstraction layer between Haskell programs and SQL
relational databases.  This lets you write database code once, in
Haskell, and have it work with any number of backend SQL databases
(MySQL, Oracle, PostgreSQL, ODBC-compliant databases, etc.)</p><p>HDBC is modeled loosely on Perl's DBI interface
<a href="http://search.cpan.org/~timb/DBI/DBI.pm">http://search.cpan.org/~timb/DBI/DBI.pm</a>, though it has also
been influenced by Python's DB-API v2, JDBC in Java, and HSQL in
Haskell.</p><p>HDBC is a from-scratch effort.  It is not a reimplementation of HSQL,
though its purpose is the same.</p></div><h2 id="g:2">Features</h2><div class="doc"><p>Features of HDBC include:</p><ul><li>Ability to use replacable parameters to let one query be
   executed multiple times (eliminates the need for an escape
   function)</li><li>Ability to access returned rows by column number</li><li>Ability to read data from the SQL server on-demand rather than
   reading the entire result set up front</li><li>HUnit testsuite for each backend driver</li><li>Well-defined standard API and easy backend driver implementation</li><li>Lazy reading of the entire result set (think hGetContents, but
   for the results of SELECT) (see <code><a href="Database-HDBC.html#v:sFetchAllRows">sFetchAllRows</a></code>)</li><li>Support for translation between Haskell and SQL types</li><li>Support for querying database server properties</li><li>Add-on package (hdbc-missingh) to integrate with MissingH,
   providing a database backend for AnyDBM</li><li>Support for querying metadata such as column names</li><li>Support for querying additional metadata (column types, etc.)</li></ul></div><h2 id="g:3">Available Drivers</h2><div class="doc"><p>Here is a list of known drivers as of January 26, 2009:</p><dl><dt><code>Sqlite v3</code></dt><dd>Available from <a href="http://software.complete.org/hdbc-sqlite3">http://software.complete.org/hdbc-sqlite3</a>.  Or, to
participate in development, use 
<code>git clone <a href="git://git.complete.org/hdbc-sqlite3">git://git.complete.org/hdbc-sqlite3</a></code></dd><dt><code>PostgreSQL</code></dt><dd>Available from <a href="http://software.complete.org/hdbc-postgresql">http://software.complete.org/hdbc-postgresql</a>.  Or, to
participate in development, use
<code>git clone <a href="git://git.complete.org/hdbc-postgresql">git://git.complete.org/hdbc-postgresql</a></code></dd><dt><code>ODBC</code></dt><dd>Available from <a href="http://software.complete.org/hdbc-odbc">http://software.complete.org/hdbc-odbc</a>.  Or, to
partitipace in development, use
<code>git clone <a href="git://git.complete.org/hdbc-odbc">git://git.complete.org/hdbc-odbc</a></code></dd><dt><code>MySQL</code></dt><dd>MySQL users have two choices: the first is the ODBC driver, which works
and has been tested against MySQL on both Linux/Unix and Windows platforms.  There is
also an alpha-quality native MySQL driver available for download at
<a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HDBC-mysql">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HDBC-mysql</a> with a homepage
at <a href="http://www.maubi.net/~waterson/hacks/hdbc-mysql.html">http://www.maubi.net/~waterson/hacks/hdbc-mysql.html</a>.</dd></dl><p>In addition, there is one integration package: <em>hdbc-anydbm</em>.  This
integrates with the AnyDBM library <a href="http://software.complete.org/anydbm">http://software.complete.org/anydbm</a>.
It lets any HDBC database act as a backend for the
AnyDBM interface.  Available from <a href="http://software.complete.org/hdbc-anydbm">http://software.complete.org/hdbc-anydbm</a>.  Or,
to participate in development, use
<code>darcs get --partial <a href="http://darcs.complete.org/hdbc-anydbm">http://darcs.complete.org/hdbc-anydbm</a></code></p><p>The latest version of HDBC itself is available from
<a href="http://software.complete.org/hdbc">http://software.complete.org/hdbc</a>.  Or, to participate in development, use
<code>git clone <a href="git://git.complete.org/hdbc">git://git.complete.org/hdbc</a></code>.</p></div><h1 id="g:4">Typing of transfer data</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:SqlValue" class="def">SqlValue</a> <a href="src/Database-HDBC-SqlValue.html#SqlValue" class="link">Source</a></p><div class="doc"><p><code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code> is the main type for expressing Haskell values to SQL databases.</p><p><em>INTRODUCTION TO SQLVALUE</em></p><p>This type is used to marshall Haskell data to and from database APIs.
HDBC driver interfaces will do their best to use the most accurate and
efficient way to send a particular value to the database server.</p><p>Values read back from the server are constructed with the most appropriate <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>
constructor.  <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> or <code><a href="Database-HDBC.html#v:safeFromSql">safeFromSql</a></code> 
can then be used to convert them into whatever type
is needed locally in Haskell.</p><p>Most people will use <code><a href="Database-HDBC.html#v:toSql">toSql</a></code> and <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> instead of manipulating
<code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s directly.</p><p><em>EASY CONVERSIONS BETWEEN HASKELL TYPES</em></p><p>Conversions are powerful; for instance, you can call <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> on a SqlInt32
and get a String or a Double out of it.  This class attempts to Do
The Right Thing whenever possible, and will raise an error when asked to
do something incorrect.  In particular, when converting to any type
except a Maybe, <code><a href="Database-HDBC.html#v:SqlNull">SqlNull</a></code> as the input will cause an error to be raised.</p><p>Conversions are implemented in terms of the <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible.html">Data.Convertible</a> module, part of the
convertible package.  You can refer to its documentation, and import that module,
if you wish to parse the Left result from <code><a href="Database-HDBC.html#v:safeFromSql">safeFromSql</a></code> yourself, or write your
own conversion instances.</p><p>Here are some notes about conversion:</p><ul><li>Fractions of a second are not preserved on time values</li><li>There is no <code>safeToSql</code> because <code><a href="Database-HDBC.html#v:toSql">toSql</a></code> never fails.</li></ul><p>See also <code><a href="Database-HDBC.html#v:toSql">toSql</a></code>, <code><a href="Database-HDBC.html#v:safeFromSql">safeFromSql</a></code>, <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code>, <code><a href="Database-HDBC.html#v:nToSql">nToSql</a></code>, <code><a href="Database-HDBC.html#v:iToSql">iToSql</a></code>, <code><a href="Database-HDBC.html#v:posixToSql">posixToSql</a></code>.</p><p><em>ERROR CONDITIONS</em></p><p>There may sometimes be an error during conversion.  For instance, if you have a
<code><a href="Database-HDBC.html#v:SqlString">SqlString</a></code> and are attempting to convert it to an Integer, but it doesn't parse as
an Integer, you will get an error.  This will be indicated as an exception if using
<code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code>, or a Left result if using <code><a href="Database-HDBC.html#v:safeFromSql">safeFromSql</a></code>.</p><p><em>SPECIAL NOTE ON POSIXTIME</em></p><p>Note that a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:NominalDiffTime">NominalDiffTime</a></code> or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a></code> is converted to <code><a href="Database-HDBC.html#v:SqlDiffTime">SqlDiffTime</a></code> by
<code><a href="Database-HDBC.html#v:toSql">toSql</a></code>.  HDBC cannot differentiate between <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:NominalDiffTime">NominalDiffTime</a></code> and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a></code>
since they are the same underlying type.  You must construct <code><a href="Database-HDBC.html#v:SqlPOSIXTime">SqlPOSIXTime</a></code>
manually or via <code><a href="Database-HDBC.html#v:posixToSql">posixToSql</a></code>, or use <code><a href="Database-HDBC.html#v:SqlUTCTime">SqlUTCTime</a></code>.</p><p><em>DETAILS ON SQL TYPES</em></p><p>HDBC database backends are expected to marshal date and time data back and
forth using the appropriate representation for the underlying database engine.
Databases such as PostgreSQL with builtin date and time types should see automatic
conversion between these Haskell types to database types.  Other databases will be
presented with an integer or a string.  Care should be taken to use the same type on
the Haskell side as you use on the database side.  For instance, if your database
type lacks timezone information, you ought not to use ZonedTime, but
instead LocalTime or UTCTime.  Database type systems are not always as rich
as Haskell.  For instance, for data stored in a TIMESTAMP
WITHOUT TIME ZONE column, HDBC may not be able to tell if it is intended
as UTCTime or LocalTime data, and will happily convert it to both, 
upon your request.  It is
your responsibility to ensure that you treat timezone issues with due care.</p><p>This behavior also exists for other types.  For instance, many databases do not
have a Rational type, so they will just use the show function and
store a Rational as a string.</p><p>The conversion between Haskell types and database types is complex,
and generic code in HDBC or its backends cannot possibly accomodate
every possible situation.  In some cases, you may be best served by converting your
Haskell type to a String, and passing that to the database.</p><p><em>UNICODE AND BYTESTRINGS</em></p><p>Beginning with HDBC v2.0, interactions with a database are presumed to occur in UTF-8.</p><p>To accomplish this, whenever a ByteString must be converted to or from a String,
the ByteString is assumed to be in UTF-8 encoding, and will be decoded or encoded
as appropriate.  Database drivers will generally present text or string data they have
received from the database as a SqlValue holding a ByteString, which <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> will
automatically convert to a String, and thus automatically decode UTF-8, when
you need it.  In the other direction, database drivers will generally convert
a <code><a href="Database-HDBC.html#v:SqlString">SqlString</a></code> to a ByteString in UTF-8 encoding before passing it to the
database engine.</p><p>If you are handling some sort of binary data that is not in UTF-8, you can of course
work with the ByteString directly, which will bypass any conversion.</p><p>Due to lack of support by database engines, lazy ByteStrings are not passed to database
drivers.  When you use <code><a href="Database-HDBC.html#v:toSql">toSql</a></code> on a lazy ByteString, it will be converted to a strict
ByteString for storage.  Similarly, <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> will convert a strict ByteString to
a lazy ByteString if you demand it.</p><p><em>EQUALITY OF SQLVALUE</em></p><p>Two SqlValues are considered to be equal if one of these hold.  The
first comparison that can be made is controlling; if none of these
comparisons can be made, then they are not equal:</p><ul><li>Both are NULL</li><li>Both represent the same type and the encapsulated values are considered equal
   by applying (==) to them</li><li>The values of each, when converted to a string, are equal</li></ul><p><em>STRING VERSIONS OF TIMES</em></p><p>Default string representations are given as comments below where such are non-obvious.
These are used for <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> when a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></code> is desired.  They are also defaults for
representing data to SQL backends, though individual backends may override them
when a different format is demanded by the underlying database.  Date and time formats
use ISO8601 date format, with HH:MM:SS added for time, and -HHMM added for timezone
offsets.</p><p><em>DEPRECATED CONSTRUCTORS</em></p><p><code><a href="Database-HDBC.html#v:SqlEpochTime">SqlEpochTime</a></code> and <code><a href="Database-HDBC.html#v:SqlTimeDiff">SqlTimeDiff</a></code> are no longer created automatically by any
<code><a href="Database-HDBC.html#v:toSql">toSql</a></code> or <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> functions or database backends.  They may still be manually
constructed, but are
expected to be removed in a future version.  Although these two constructures will
be removed, support for marshalling to and from the old System.Time data will be
maintained as long as System.Time is, simply using the newer data types for conversion.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:SqlString" class="def">SqlString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlByteString" class="def">SqlByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlWord32" class="def">SqlWord32</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word32">Word32</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlWord64" class="def">SqlWord64</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlInt32" class="def">SqlInt32</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int32">Int32</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlInt64" class="def">SqlInt64</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int64">Int64</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlInteger" class="def">SqlInteger</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlChar" class="def">SqlChar</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Char.html#t:Char">Char</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlBool" class="def">SqlBool</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlDouble" class="def">SqlDouble</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlRational" class="def">SqlRational</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Rational">Rational</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:SqlLocalDate" class="def">SqlLocalDate</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a></td><td class="doc"><p>Local YYYY-MM-DD (no timezone).</p></td></tr><tr><td class="src"><a name="v:SqlLocalTimeOfDay" class="def">SqlLocalTimeOfDay</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a></td><td class="doc"><p>Local HH:MM:SS (no timezone).</p></td></tr><tr><td class="src"><a name="v:SqlZonedLocalTimeOfDay" class="def">SqlZonedLocalTimeOfDay</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeZone">TimeZone</a></td><td class="doc"><p>Local HH:MM:SS -HHMM.  Converts to and from (TimeOfDay, TimeZone).</p></td></tr><tr><td class="src"><a name="v:SqlLocalTime" class="def">SqlLocalTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:LocalTime">LocalTime</a></td><td class="doc"><p>Local YYYY-MM-DD HH:MM:SS (no timezone).</p></td></tr><tr><td class="src"><a name="v:SqlZonedTime" class="def">SqlZonedTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:ZonedTime">ZonedTime</a></td><td class="doc"><p>Local YYYY-MM-DD HH:MM:SS -HHMM.  Considered equal if both convert to the same UTC time.</p></td></tr><tr><td class="src"><a name="v:SqlUTCTime" class="def">SqlUTCTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a></td><td class="doc"><p>UTC YYYY-MM-DD HH:MM:SS.</p></td></tr><tr><td class="src"><a name="v:SqlDiffTime" class="def">SqlDiffTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:NominalDiffTime">NominalDiffTime</a></td><td class="doc"><p>Calendar diff between seconds.  Rendered as Integer when converted to String, but greater precision may be preserved for other types or to underlying database.</p></td></tr><tr><td class="src"><a name="v:SqlPOSIXTime" class="def">SqlPOSIXTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a></td><td class="doc"><p>Time as seconds since midnight Jan 1 1970 UTC.  Integer rendering as for <code><a href="Database-HDBC.html#v:SqlDiffTime">SqlDiffTime</a></code>.</p></td></tr><tr><td class="src"><a name="v:SqlEpochTime" class="def">SqlEpochTime</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>DEPRECATED Representation of ClockTime or CalendarTime.  Use SqlPOSIXTime instead.</p></td></tr><tr><td class="src"><a name="v:SqlTimeDiff" class="def">SqlTimeDiff</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>DEPRECATED Representation of TimeDiff.  Use SqlDiffTime instead.</p></td></tr><tr><td class="src"><a name="v:SqlNull" class="def">SqlNull</a></td><td class="doc"><p>NULL in SQL or Nothing in Haskell.</p></td></tr></table></div><div class="subs instances"><p id="control.i:SqlValue" class="caption collapser" onclick="toggleSection('i:SqlValue')">Instances</p><div id="section.i:SqlValue" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-225" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-223" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-486" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Char.html#t:Char">Char</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-523" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Double">Double</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-551" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-326" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int32">Int32</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-354" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int64">Int64</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-380" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-458" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Rational">Rational</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-581" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word32">Word32</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-406" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-432" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-259" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-313" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-320" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-302" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-296" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:LocalTime">LocalTime</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-704" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:ZonedTime">ZonedTime</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-730" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-641" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-756" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:NominalDiffTime">NominalDiffTime</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-797" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-609" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:DiffTime">DiffTime</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-882" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> TimeDiff <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-854" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> ClockTime <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-827" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> CalendarTime <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-908" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></span> <a href="src/Database-HDBC-SqlValue.html#line-488" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Database-HDBC-SqlValue.html#line-525" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Double">Double</a></span> <a href="src/Database-HDBC-SqlValue.html#line-553" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></span> <a href="src/Database-HDBC-SqlValue.html#line-330" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int32">Int32</a></span> <a href="src/Database-HDBC-SqlValue.html#line-356" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int64">Int64</a></span> <a href="src/Database-HDBC-SqlValue.html#line-382" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a></span> <a href="src/Database-HDBC-SqlValue.html#line-460" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Rational">Rational</a></span> <a href="src/Database-HDBC-SqlValue.html#line-583" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word32">Word32</a></span> <a href="src/Database-HDBC-SqlValue.html#line-408" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a></span> <a href="src/Database-HDBC-SqlValue.html#line-434" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></span> <a href="src/Database-HDBC-SqlValue.html#line-261" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></span> <a href="src/Database-HDBC-SqlValue.html#line-315" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></span> <a href="src/Database-HDBC-SqlValue.html#line-322" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a></span> <a href="src/Database-HDBC-SqlValue.html#line-305" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></span> <a href="src/Database-HDBC-SqlValue.html#line-299" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:LocalTime">LocalTime</a></span> <a href="src/Database-HDBC-SqlValue.html#line-706" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:ZonedTime">ZonedTime</a></span> <a href="src/Database-HDBC-SqlValue.html#line-732" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a></span> <a href="src/Database-HDBC-SqlValue.html#line-643" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a></span> <a href="src/Database-HDBC-SqlValue.html#line-758" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:NominalDiffTime">NominalDiffTime</a></span> <a href="src/Database-HDBC-SqlValue.html#line-799" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a></span> <a href="src/Database-HDBC-SqlValue.html#line-611" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock.html#t:DiffTime">DiffTime</a></span> <a href="src/Database-HDBC-SqlValue.html#line-884" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> TimeDiff</span> <a href="src/Database-HDBC-SqlValue.html#line-856" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> ClockTime</span> <a href="src/Database-HDBC-SqlValue.html#line-829" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> CalendarTime</span> <a href="src/Database-HDBC-SqlValue.html#line-911" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-256" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> a =&gt; <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</span> <a href="src/Database-HDBC-SqlValue.html#line-918" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeZone">TimeZone</a>)</span> <a href="src/Database-HDBC-SqlValue.html#line-670" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> a <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> =&gt; <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> a) <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-915" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeOfDay">TimeOfDay</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html#t:TimeZone">TimeZone</a>) <a href="Database-HDBC.html#t:SqlValue">SqlValue</a></span> <a href="src/Database-HDBC-SqlValue.html#line-668" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:toSql" class="def">toSql</a> :: <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> a <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> =&gt; a -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="src/Database-HDBC-SqlValue.html#toSql" class="link">Source</a></p><div class="doc"><p>Convert a value to an <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>.  This function is simply
a restricted-type wrapper around <code><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#v:convert">convert</a></code>.  See extended notes on <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:fromSql" class="def">fromSql</a> :: <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> a =&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> -&gt; a <a href="src/Database-HDBC-SqlValue.html#fromSql" class="link">Source</a></p><div class="doc"><p>Convert from an <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code> to a Haskell value.  Any problem is indicated by
   calling <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#v:error">error</a></code>.  This function is simply a restricted-type wrapper around
   <code><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#v:convert">convert</a></code>.  See extended notes on <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:safeFromSql" class="def">safeFromSql</a> :: <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:Convertible">Convertible</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> a =&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> -&gt; <a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#t:ConvertResult">ConvertResult</a> a <a href="src/Database-HDBC-SqlValue.html#safeFromSql" class="link">Source</a></p><div class="doc"><p>Conversions to and from <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s and standard Haskell types.</p><p>This function converts from an <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code> to a Haskell value.  Many people will use the simpler
   <code><a href="Database-HDBC.html#v:fromSql">fromSql</a></code> instead.  This function is simply a restricted-type wrapper around
   <code><a href="file:///usr/share/doc/libghc-convertible-doc/html/Data-Convertible-Base.html#v:safeConvert">safeConvert</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:nToSql" class="def">nToSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integral">Integral</a> a =&gt; a -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="src/Database-HDBC-SqlValue.html#nToSql" class="link">Source</a></p><div class="doc"><p>Converts any Integral type to a <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code> by using toInteger. </p></div></div><div class="top"><p class="src"><a name="v:iToSql" class="def">iToSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="src/Database-HDBC-SqlValue.html#iToSql" class="link">Source</a></p><div class="doc"><p>Convenience function for using numeric literals in your program. </p></div></div><div class="top"><p class="src"><a name="v:posixToSql" class="def">posixToSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a> -&gt; <a href="Database-HDBC.html#t:SqlValue">SqlValue</a> <a href="src/Database-HDBC-SqlValue.html#posixToSql" class="link">Source</a></p><div class="doc"><p>Convenience function for converting <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a></code> to a <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>, because
<code><a href="Database-HDBC.html#v:toSql">toSql</a></code> cannot do the correct thing in this instance. </p></div></div><h1 id="g:5">Database Connections</h1><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:IConnection" class="def">IConnection</a> conn <span class="keyword">where</span> <a href="src/Database-HDBC-Types.html#IConnection" class="link">Source</a></p><div class="doc"><p>Main database handle object.</p><p>An <code><a href="Database-HDBC.html#t:IConnection">IConnection</a></code> object is created by specific functions in the module for an
individual database.  That is, the connect function -- which creates
this object -- is not standardized through the HDBC interface.</p><p>A connection is closed by a call to <code><a href="Database-HDBC.html#v:disconnect">disconnect</a></code>.</p><p>A call to <code><a href="Database-HDBC.html#v:commit">commit</a></code> is required to make sure that your changes get committed
to the database.  In other words, HDBC has <em>no support for autocommit</em>, which
we consider an outdated notion.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Database-HDBC.html#v:disconnect">disconnect</a>, <a href="Database-HDBC.html#v:commit">commit</a>, <a href="Database-HDBC.html#v:rollback">rollback</a>, <a href="Database-HDBC.html#v:run">run</a>, <a href="Database-HDBC.html#v:prepare">prepare</a>, <a href="Database-HDBC.html#v:clone">clone</a>, <a href="Database-HDBC.html#v:hdbcDriverName">hdbcDriverName</a>, <a href="Database-HDBC.html#v:hdbcClientVer">hdbcClientVer</a>, <a href="Database-HDBC.html#v:proxiedClientName">proxiedClientName</a>, <a href="Database-HDBC.html#v:proxiedClientVer">proxiedClientVer</a>, <a href="Database-HDBC.html#v:dbServerVer">dbServerVer</a>, <a href="Database-HDBC.html#v:dbTransactionSupport">dbTransactionSupport</a>, <a href="Database-HDBC.html#v:getTables">getTables</a>, <a href="Database-HDBC.html#v:describeTable">describeTable</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:disconnect" class="def">disconnect</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Types.html#disconnect" class="link">Source</a></p><div class="doc"><p>Disconnect from the remote database.</p><p>You do not need to explicitly close an IConnection object, but you may do so if
you so desire.  If you don't, the object will disconnect from the database
in a sane way when it is garbage-collected.  However, a disconnection may
raise an error, so you are encouraged to explicitly call <code><a href="Database-HDBC.html#v:disconnect">disconnect</a></code>.  Also,
garbage collection may not run when the program terminates, and some databases
really like an explicit disconnect.</p><p>So, bottom line is, you're best off calling <code><a href="Database-HDBC.html#v:disconnect">disconnect</a></code> directly, but the
world won't end if you forget.</p><p>This function discards any data not committed already.  Database driver
implementators should explicitly call <code><a href="Database-HDBC.html#v:rollback">rollback</a></code> if their databases don't
do this automatically on disconnect.</p><p>Bad Things (TM) could happen if you call this while you have <code><a href="Database-HDBC.html#t:Statement">Statement</a></code>s 
active.  In more precise language, the results in such situations are undefined
and vary by database.  So don't do it.</p></div><p class="src"><a name="v:commit" class="def">commit</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Types.html#commit" class="link">Source</a></p><div class="doc"><p>Commit any pending data to the database.</p><p>Required to make any changes take effect. </p></div><p class="src"><a name="v:rollback" class="def">rollback</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Types.html#rollback" class="link">Source</a></p><div class="doc"><p>Roll back to the state the database was in prior to the
                   last <code><a href="Database-HDBC.html#v:commit">commit</a></code> or <code><a href="Database-HDBC.html#v:rollback">rollback</a></code>. </p></div><p class="src"><a name="v:runRaw" class="def">runRaw</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Types.html#runRaw" class="link">Source</a></p><div class="doc"><p>Execute an SQL string, which may contain multiple
                   queries. This is intended for situations where you
                   need to run DML or DDL queries and aren't
                   interested in results. </p></div><p class="src"><a name="v:run" class="def">run</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a> <a href="src/Database-HDBC-Types.html#run" class="link">Source</a></p><div class="doc"><p>Execute a single SQL query.  Returns the number
                   of rows modified (see <code><a href="Database-HDBC.html#v:execute">execute</a></code> for details).
                   The second parameter is a list
                   of replacement values, if any. </p></div><p class="src"><a name="v:prepare" class="def">prepare</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Database-HDBC.html#t:Statement">Statement</a> <a href="src/Database-HDBC-Types.html#prepare" class="link">Source</a></p><div class="doc"><p>Prepares a statement for execution. </p><p>Question marks in the statement will be replaced by
                   positional parameters in a later call to <code><a href="Database-HDBC.html#v:execute">execute</a></code>.</p><p>Please note that, depending on the database
                   and the driver, errors in your SQL may be raised
                   either here or by <code><a href="Database-HDBC.html#v:execute">execute</a></code>.  Make sure you
                   handle exceptions both places if necessary. </p></div><p class="src"><a name="v:clone" class="def">clone</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> conn <a href="src/Database-HDBC-Types.html#clone" class="link">Source</a></p><div class="doc"><p>Create a new <code>Connection</code> object, pointed at the same
                   server as this object is.  This will generally establish
                   a separate physical connection.</p><p>When you wish to establish multiple connections to a single
                   server, the correct way to do so is to establish the
                   first connection with the driver-specific connection
                   function, and then clone it for each additional connection.</p><p>This can be important when a database doesn't provide
                   much thread support itself, and the HDBC driver module
                   must serialize access to a particular database.</p><p>This can also be a handy utility function whenever you
                   need a separate connection to whatever database you are
                   connected to already. </p></div><p class="src"><a name="v:hdbcDriverName" class="def">hdbcDriverName</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Database-HDBC-Types.html#hdbcDriverName" class="link">Source</a></p><div class="doc"><p>The name of the HDBC driver module for this connection.
                   Ideally would be the same as the database name portion
                   of the Cabal package name.  For instance, &quot;sqlite3&quot;
                   or &quot;odbc&quot;.  This is the layer that is bound most
                   tightly to HDBC. </p></div><p class="src"><a name="v:hdbcClientVer" class="def">hdbcClientVer</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Database-HDBC-Types.html#hdbcClientVer" class="link">Source</a></p><div class="doc"><p>The version of the C (or whatever) client library
                   that the HDBC driver module is bound to.  The meaning
                   of this is driver-specific.  For an ODBC or similar
                   proxying driver, this should be the version of the
                   ODBC library, not the eventual DB client driver. </p></div><p class="src"><a name="v:proxiedClientName" class="def">proxiedClientName</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Database-HDBC-Types.html#proxiedClientName" class="link">Source</a></p><div class="doc"><p>In the case of a system such as ODBC, the name of
                   the database client/server in use, if available.
                   For others,
                   identical to <code><a href="Database-HDBC.html#v:hdbcDriverName">hdbcDriverName</a></code>. </p></div><p class="src"><a name="v:proxiedClientVer" class="def">proxiedClientVer</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Database-HDBC-Types.html#proxiedClientVer" class="link">Source</a></p><div class="doc"><p>In the case of a system such as ODBC, the version of
                   the database client in use, if available.  For others,
                   identical to <code><a href="Database-HDBC.html#v:hdbcClientVer">hdbcClientVer</a></code>. This is the next layer
                   out past the HDBC driver. </p></div><p class="src"><a name="v:dbServerVer" class="def">dbServerVer</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Database-HDBC-Types.html#dbServerVer" class="link">Source</a></p><div class="doc"><p>The version of the database server, if available. </p></div><p class="src"><a name="v:dbTransactionSupport" class="def">dbTransactionSupport</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Database-HDBC-Types.html#dbTransactionSupport" class="link">Source</a></p><div class="doc"><p>Whether or not the current database supports transactions.
                   If False, then <code><a href="Database-HDBC.html#v:commit">commit</a></code> and <code><a href="Database-HDBC.html#v:rollback">rollback</a></code> should be expected
                   to raise errors.</p><p>MySQL is the only commonly-used database that is known
                   to not support transactions entirely.  Please see
                   the MySQL notes in the ODBC driver for more information. </p></div><p class="src"><a name="v:getTables" class="def">getTables</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] <a href="src/Database-HDBC-Types.html#getTables" class="link">Source</a></p><div class="doc"><p>The names of all tables accessible by the current
                   connection, excluding special meta-tables (system tables).</p><p>You should expect this to be returned in the same manner
                   as a result from <code><a href="Database-HDBC.html#v:fetchAllRows-39-">fetchAllRows'</a></code>.</p><p>All results should be converted to lowercase for you
                   before you see them.</p></div><p class="src"><a name="v:describeTable" class="def">describeTable</a> :: conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC-ColTypes.html#t:SqlColDesc">SqlColDesc</a>)] <a href="src/Database-HDBC-Types.html#describeTable" class="link">Source</a></p><div class="doc"><p>Obtain information about the columns in a specific
                   table.  The String in the result
                   set is the column name.</p><p>You should expect this to be returned in the same manner
                   as a result from <code><a href="Database-HDBC.html#v:fetchAllRows-39-">fetchAllRows'</a></code>.</p><p>All results should be converted to lowercase for you
                   before you see them.</p></div></div><div class="subs instances"><p id="control.i:IConnection" class="caption collapser" onclick="toggleSection('i:IConnection')">Instances</p><div id="section.i:IConnection" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Database-HDBC.html#t:IConnection">IConnection</a> <a href="Database-HDBC.html#t:ConnWrapper">ConnWrapper</a></span> <a href="src/Database-HDBC-Types.html#line-198" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h2 id="g:6">Wrapped Connections</h2><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ConnWrapper" class="def">ConnWrapper</a> <a href="src/Database-HDBC-Types.html#ConnWrapper" class="link">Source</a></p><div class="doc"><p>Sometimes, it is annoying to use typeclasses with Haskell's type system.
In those situations, you can use a ConnWrapper.  You can create one with:</p><pre>let wrapped = ConnWrapper iconn</pre><p>You can then use this directly, since a ConnWrapper is also an
<code><a href="Database-HDBC.html#t:IConnection">IConnection</a></code>.  However, you will not be able to use private database
functions on it.</p><p>Or, you can use <code><a href="Database-HDBC.html#v:withWConn">withWConn</a></code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><span class="keyword">forall</span> conn . <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; <a name="v:ConnWrapper" class="def">ConnWrapper</a> conn</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:ConnWrapper" class="caption collapser" onclick="toggleSection('i:ConnWrapper')">Instances</p><div id="section.i:ConnWrapper" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Database-HDBC.html#t:IConnection">IConnection</a> <a href="Database-HDBC.html#t:ConnWrapper">ConnWrapper</a></span> <a href="src/Database-HDBC-Types.html#line-198" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:withWConn" class="def">withWConn</a> :: <span class="keyword">forall</span> b. <a href="Database-HDBC.html#t:ConnWrapper">ConnWrapper</a> -&gt; (<span class="keyword">forall</span> conn. <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; b) -&gt; b <a href="src/Database-HDBC-Types.html#withWConn" class="link">Source</a></p><div class="doc"><p>Unwrap a <code><a href="Database-HDBC.html#t:ConnWrapper">ConnWrapper</a></code> and pass the embedded <code><a href="Database-HDBC.html#t:IConnection">IConnection</a></code> to
a function.  Example:</p><pre>withWConn wrapped run $ &quot;SELECT * from foo where bar = 1&quot; []</pre></div></div><h2 id="g:7">Preparing Queries</h2><div class="top"><p class="src"><a name="v:sRun" class="def">sRun</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a> <a href="src/Database-HDBC-Utils.html#sRun" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:run">run</a></code>, but take a list of Maybe Strings instead of <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s. </p></div></div><div class="top"><p class="src"><a name="v:quickQuery-39-" class="def">quickQuery'</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]] <a href="src/Database-HDBC-Utils.html#quickQuery%27" class="link">Source</a></p><div class="doc"><p>Strict version of <code><a href="Database-HDBC.html#v:quickQuery">quickQuery</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:quickQuery" class="def">quickQuery</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]] <a href="src/Database-HDBC-Utils.html#quickQuery" class="link">Source</a></p><div class="doc"><p>A quick way to do a query.  Similar to preparing, executing, and
then calling <code><a href="Database-HDBC.html#v:fetchAllRows">fetchAllRows</a></code> on a statement. See also <code><a href="Database-HDBC.html#v:quickQuery-39-">quickQuery'</a></code>. </p></div></div><h2 id="g:8">Transaction Handling</h2><div class="doc"><p>This section concerns itself with writing (updating) a database.</p><p>In HDBC, as with many RDBMS implementations, every write to the
database occurs within a transaction.  No changes are visible (outside
the current transaction) until a commit operation occurs, in which
case all changes since the transaction started are atomically
committed.  Also, there is a rollback operation that can undo all
changes since the transaction started.</p><p>HDBC does everything within a transaction.  A transaction is implicitly entered
when a connection to a database is established, and a transaction is
implicitly entered after each call to <code><a href="Database-HDBC.html#v:commit">commit</a></code> or <code><a href="Database-HDBC.html#v:rollback">rollback</a></code> as well.</p><p>The practical effect of this is that you must call <code><a href="Database-HDBC.html#v:commit">commit</a></code> after making
changes to a database in order for those changes to become visible.  You don't
have to call <code><a href="Database-HDBC.html#v:commit">commit</a></code> after <em>every</em> change, just after a batch of them.</p><p>(Exceptions exist for databases that don't offer a high level of transaction
isolation; but you should always play it safe and commit anyway.)</p><p>Database developers will also be experienced with the atomicity benefits
of transactions, an explanation of which is outside the scope of this manual.</p><p>Errors occuring at the database level can leave a transaction in an
indeterminate state, depending on the database.  Some databases will
refuse all queries until the next <code><a href="Database-HDBC.html#v:commit">commit</a></code> or <code><a href="Database-HDBC.html#v:rollback">rollback</a></code>.  The safe thing
to do is to issue a <code><a href="Database-HDBC.html#v:commit">commit</a></code> or <code><a href="Database-HDBC.html#v:rollback">rollback</a></code> after trapping any <code><a href="Database-HDBC.html#t:SqlError">SqlError</a></code>.
Alternatively, you could use <code><a href="Database-HDBC.html#v:withTransaction">withTransaction</a></code>, which will automatically
handle this detail for you.</p></div><div class="top"><p class="src"><a name="v:withTransaction" class="def">withTransaction</a> :: <a href="Database-HDBC.html#t:IConnection">IConnection</a> conn =&gt; conn -&gt; (conn -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a <a href="src/Database-HDBC-Utils.html#withTransaction" class="link">Source</a></p><div class="doc"><p>Execute some code.  If any uncaught exception occurs, run
<code><a href="Database-HDBC.html#v:rollback">rollback</a></code> and re-raise it.  Otherwise, run <code><a href="Database-HDBC.html#v:commit">commit</a></code> and return.</p><p>This function, therefore, encapsulates the logical property that a transaction
is all about: all or nothing.</p><p>The <code><a href="Database-HDBC.html#t:IConnection">IConnection</a></code> object passed in is passed directly to the specified
function as a convenience.</p><p>This function traps <em>all</em> uncaught exceptions, not just SqlErrors.  Therefore,
you will get a rollback for any exception that you don't handle.  That's
probably what you want anyway.</p><p>Since all operations in HDBC are done in a transaction, this function doesn't
issue an explicit &quot;begin&quot; to the server.  You should ideally have
called <code><a href="Database-HDBC.html#v:commit">commit</a></code> or <code><a href="Database-HDBC.html#v:rollback">rollback</a></code> before
calling this function.  If you haven't, this function will commit or rollback
more than just the changes made in the included action.</p><p>If there was an error while running <code><a href="Database-HDBC.html#v:rollback">rollback</a></code>, this error will not be
reported since the original exception will be propogated back.  (You'd probably
like to know about the root cause for all of this anyway.)  Feedback
on this behavior is solicited.</p></div></div><h2 id="g:9">Connection Inquiries</h2><h1 id="g:10">Statements</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Statement" class="def">Statement</a> <a href="src/Database-HDBC-Statement.html#Statement" class="link">Source</a></p></div><h2 id="g:11">Execution</h2><div class="top"><p class="src"><a name="v:execute" class="def">execute</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a> <a href="src/Database-HDBC-Statement.html#execute" class="link">Source</a></p><div class="doc"><p>Execute the prepared statement, passing in the given positional
        parameters (that should take the place of the question marks
        in the call to <code>prepare</code>).</p><p>For non-SELECT queries, the return value is the number of
        rows modified, if known.  If no rows were modified, you get 0.
        If the value is unknown, you get -1.  All current HDBC drivers
        support this function and should never return -1.</p><p>For SELECT queries, you will always get 0.</p><p>This function should automatically call finish() to finish the previous
        execution, if necessary.</p></div></div><div class="top"><p class="src"><a name="v:executeRaw" class="def">executeRaw</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Statement.html#executeRaw" class="link">Source</a></p><div class="doc"><p>Execute the statement as-is, without supplying any
        positional parameters.  This is intended for statements for
        which the results aren't interesting or present (e.g., DDL or
        DML commands).  If your query contains placeholders, this will
        certainly fail; use <code><a href="Database-HDBC.html#v:execute">execute</a></code> instead. </p></div></div><div class="top"><p class="src"><a name="v:sExecute" class="def">sExecute</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Prelude.html#t:Integer">Integer</a> <a href="src/Database-HDBC-Utils.html#sExecute" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:execute">execute</a></code>, but take a list of Maybe Strings instead of
   <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s. </p></div></div><div class="top"><p class="src"><a name="v:executeMany" class="def">executeMany</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Statement.html#executeMany" class="link">Source</a></p><div class="doc"><p>Execute the query with many rows. 
        The return value is the return value from the final row 
        as if you had called <code><a href="Database-HDBC.html#v:execute">execute</a></code> on it.</p><p>Due to optimizations that are possible due to different
        databases and driver designs, this can often be significantly
        faster than using <code><a href="Database-HDBC.html#v:execute">execute</a></code> multiple times since queries
        need to be compiled only once.</p><p>This is most useful for non-SELECT statements. </p></div></div><div class="top"><p class="src"><a name="v:sExecuteMany" class="def">sExecuteMany</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; [[<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Utils.html#sExecuteMany" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:executeMany">executeMany</a></code>, but take a list of Maybe Strings instead of
   <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s. </p></div></div><h2 id="g:12">Fetching Results</h2><div class="top"><p class="src"><a name="v:fetchRow" class="def">fetchRow</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]) <a href="src/Database-HDBC-Statement.html#fetchRow" class="link">Source</a></p><div class="doc"><p>Fetches one row from the DB.  Returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if there
        are no more rows.  Will automatically call <code><a href="Database-HDBC.html#v:finish">finish</a></code> when
        the last row is read. </p></div></div><div class="top"><p class="src"><a name="v:fetchRowAL" class="def">fetchRowAL</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)]) <a href="src/Database-HDBC-Utils.html#fetchRowAL" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:fetchRow">fetchRow</a></code>, but instead of returning a list, return an association
list from column name to value.</p><p>The keys of the column names are lowercase versions of the data returned
by <code><a href="Database-HDBC.html#v:getColumnNames">getColumnNames</a></code>.  Please heed the warnings there.  Additionally,
results are undefined if multiple columns are returned with identical names.</p></div></div><div class="top"><p class="src"><a name="v:fetchRowMap" class="def">fetchRowMap</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)) <a href="src/Database-HDBC-Utils.html#fetchRowMap" class="link">Source</a></p><div class="doc"><p>Similar to <code><a href="Database-HDBC.html#v:fetchRowAL">fetchRowAL</a></code>, but return a Map instead of an association list.</p></div></div><div class="top"><p class="src"><a name="v:sFetchRow" class="def">sFetchRow</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]) <a href="src/Database-HDBC-Utils.html#sFetchRow" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:fetchRow">fetchRow</a></code>, but return a list of Maybe Strings instead of
   <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s. </p></div></div><div class="top"><p class="src"><a name="v:fetchAllRows" class="def">fetchAllRows</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]] <a href="src/Database-HDBC-Utils.html#fetchAllRows" class="link">Source</a></p><div class="doc"><p>Lazily fetch all rows from an executed <code><a href="Database-HDBC.html#t:Statement">Statement</a></code>.</p><p>You can think of this as hGetContents applied to a database result set.</p><p>The result of this is a lazy list, and each new row will be read, lazily, from
the database as the list is processed.</p><p>When you have exhausted the list, the <code><a href="Database-HDBC.html#t:Statement">Statement</a></code> will be <code><a href="Database-HDBC.html#v:finish">finish</a></code>ed.</p><p>Please note that the careless use of this function can lead to some unpleasant
behavior.  In particular, if you have not consumed the entire list, then
attempt to <code><a href="Database-HDBC.html#v:finish">finish</a></code> or re-execute the statement, and then attempt to consume
more elements from the list, the result will almost certainly not be what
you want.</p><p>But then, similar caveats apply with hGetContents.</p><p>Bottom line: this is a very convenient abstraction; use it wisely.</p><p>Use <code><a href="Database-HDBC.html#v:fetchAllRows-39-">fetchAllRows'</a></code> if you need something that is strict, without
all these caveats.</p></div></div><div class="top"><p class="src"><a name="v:fetchAllRows-39-" class="def">fetchAllRows'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="Database-HDBC.html#t:SqlValue">SqlValue</a>]] <a href="src/Database-HDBC-Utils.html#fetchAllRows%27" class="link">Source</a></p><div class="doc"><p>Strict version of <code><a href="Database-HDBC.html#v:fetchAllRows">fetchAllRows</a></code>.  Does not have the side-effects
of <code><a href="Database-HDBC.html#v:fetchAllRows">fetchAllRows</a></code>, but forces the entire result set to be buffered
in memory. </p></div></div><div class="top"><p class="src"><a name="v:fetchAllRowsAL" class="def">fetchAllRowsAL</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)]] <a href="src/Database-HDBC-Utils.html#fetchAllRowsAL" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:fetchAllRows">fetchAllRows</a></code>, but instead of returning a list for each
row, return an association list for each row, from column name to value.</p><p>See <code><a href="Database-HDBC.html#v:fetchRowAL">fetchRowAL</a></code> for more details. </p></div></div><div class="top"><p class="src"><a name="v:fetchAllRowsAL-39-" class="def">fetchAllRowsAL'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>)]] <a href="src/Database-HDBC-Utils.html#fetchAllRowsAL%27" class="link">Source</a></p><div class="doc"><p>Strict version of <code><a href="Database-HDBC.html#v:fetchAllRowsAL">fetchAllRowsAL</a></code> </p></div></div><div class="top"><p class="src"><a name="v:fetchAllRowsMap" class="def">fetchAllRowsMap</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] <a href="src/Database-HDBC-Utils.html#fetchAllRowsMap" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:fetchAllRowsAL">fetchAllRowsAL</a></code>, but return a list of Maps instead of a list of
association lists. </p></div></div><div class="top"><p class="src"><a name="v:fetchAllRowsMap-39-" class="def">fetchAllRowsMap'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="Database-HDBC.html#t:SqlValue">SqlValue</a>] <a href="src/Database-HDBC-Utils.html#fetchAllRowsMap%27" class="link">Source</a></p><div class="doc"><p>Strict version of <code><a href="Database-HDBC.html#v:fetchAllRowsMap">fetchAllRowsMap</a></code> </p></div></div><div class="top"><p class="src"><a name="v:sFetchAllRows" class="def">sFetchAllRows</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]] <a href="src/Database-HDBC-Utils.html#sFetchAllRows" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:fetchAllRows">fetchAllRows</a></code>, but return Maybe Strings instead of <code><a href="Database-HDBC.html#t:SqlValue">SqlValue</a></code>s. </p></div></div><div class="top"><p class="src"><a name="v:sFetchAllRows-39-" class="def">sFetchAllRows'</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [[<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]] <a href="src/Database-HDBC-Utils.html#sFetchAllRows%27" class="link">Source</a></p><div class="doc"><p>Strict version of <code><a href="Database-HDBC.html#v:sFetchAllRows">sFetchAllRows</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:getColumnNames" class="def">getColumnNames</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] <a href="src/Database-HDBC-Statement.html#getColumnNames" class="link">Source</a></p><div class="doc"><p>Returns a list of the column names in the result.
        For maximum portability, you should not assume that
        information is available until after an <code><a href="Database-HDBC.html#v:execute">execute</a></code> function
        has been run.</p><p>Information is returned here directly as returned
        by the underlying database layer.  Note that different
        databases have different rules about capitalization
        of return values and about representation of names
        of columns that are not simple columns.  For this reason,
        it is suggested that you treat this information for
        display purposes only.  Failing that, you should convert
        to lower (or upper) case, and use <code>AS</code> clauses for
        anything other than simple columns.</p><p>A simple getColumnNames implementation could simply
        apply <code>map fst</code> to the return value of <code><a href="Database-HDBC.html#v:describeResult">describeResult</a></code>.</p></div></div><h2 id="g:13">Statement Inquires</h2><div class="top"><p class="src"><a name="v:describeResult" class="def">describeResult</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>, <a href="Database-HDBC-ColTypes.html#t:SqlColDesc">SqlColDesc</a>)] <a href="src/Database-HDBC-Statement.html#describeResult" class="link">Source</a></p><div class="doc"><p>Obtain information about the columns in the result set.
          Must be run only after <code><a href="Database-HDBC.html#v:execute">execute</a></code>.  The String in the result
          set is the column name.</p><p>You should expect this to be returned in the same manner
          as a result from <code><a href="Database-HDBC.html#v:fetchAllRows-39-">fetchAllRows'</a></code>.</p><p>All results should be converted to lowercase for you
          before you see them.</p><p>Please see caveats under <code><a href="Database-HDBC.html#v:getColumnNames">getColumnNames</a></code> for information
          on the column name field here.</p></div></div><h2 id="g:14">Miscellaneous</h2><div class="top"><p class="src"><a name="v:finish" class="def">finish</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-HDBC-Statement.html#finish" class="link">Source</a></p><div class="doc"><p>Abort a query in progress -- usually not needed. </p></div></div><div class="top"><p class="src"><a name="v:originalQuery" class="def">originalQuery</a> :: <a href="Database-HDBC.html#t:Statement">Statement</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Database-HDBC-Statement.html#originalQuery" class="link">Source</a></p><div class="doc"><p>The original query that this <code><a href="Database-HDBC.html#t:Statement">Statement</a></code> was prepared
          with. </p></div></div><h1 id="g:15">Exceptions</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:SqlError" class="def">SqlError</a> <a href="src/Database-HDBC-Statement.html#SqlError" class="link">Source</a></p><div class="doc"><p>The main HDBC exception object.  As much information as possible
is passed from the database through to the application through this object.</p><p>Errors generated in the Haskell layer will have seNativeError set to -1.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:SqlError" class="def">SqlError</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:seState" class="def">seState</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:seNativeError" class="def">seNativeError</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:seErrorMsg" class="def">seErrorMsg</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:SqlError" class="caption collapser" onclick="toggleSection('i:SqlError')">Instances</p><div id="section.i:SqlError" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> <a href="Database-HDBC.html#t:SqlError">SqlError</a></span> <a href="src/Database-HDBC-Statement.html#line-111" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Read.html#t:Read">Read</a> <a href="Database-HDBC.html#t:SqlError">SqlError</a></span> <a href="src/Database-HDBC-Statement.html#line-111" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Database-HDBC.html#t:SqlError">SqlError</a></span> <a href="src/Database-HDBC-Statement.html#line-111" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Exception-Base.html#t:Exception">Exception</a> <a href="Database-HDBC.html#t:SqlError">SqlError</a></span> <a href="src/Database-HDBC-Statement.html#line-116" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:throwSqlError" class="def">throwSqlError</a> :: <a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a <a href="src/Database-HDBC-Utils.html#throwSqlError" class="link">Source</a></p><div class="doc"><p>A utility function to throw a <code><a href="Database-HDBC.html#t:SqlError">SqlError</a></code>.  The mechanics of throwing
such a thing differ between GHC 6.8.x, Hugs, and GHC 6.10.  This function
takes care of the special cases to make it simpler.</p><p>With GHC 6.10, it is a type-restricted alias for throw.  On all other systems,
it is a type-restricted alias for throwDyn. </p></div></div><div class="top"><p class="src"><a name="v:catchSql" class="def">catchSql</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; (<a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a <a href="src/Database-HDBC-Utils.html#catchSql" class="link">Source</a></p><div class="doc"><p>Execute the given IO action.</p><p>If it raises a <code><a href="Database-HDBC.html#t:SqlError">SqlError</a></code>, then execute the supplied handler and return its
return value.  Otherwise, proceed as normal. </p></div></div><div class="top"><p class="src"><a name="v:handleSql" class="def">handleSql</a> :: (<a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a <a href="src/Database-HDBC-Utils.html#handleSql" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Database-HDBC.html#v:catchSql">catchSql</a></code>, with the order of arguments reversed. </p></div></div><div class="top"><p class="src"><a name="v:sqlExceptions" class="def">sqlExceptions</a> :: <a href="Database-HDBC.html#t:SqlError">SqlError</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Database-HDBC.html#t:SqlError">SqlError</a> <a href="src/Database-HDBC-Utils.html#sqlExceptions" class="link">Source</a></p><div class="doc"><p>Given an Exception, return Just SqlError if it was an SqlError, or Nothing
otherwise. Useful with functions like catchJust. </p></div></div><div class="top"><p class="src"><a name="v:handleSqlError" class="def">handleSqlError</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a <a href="src/Database-HDBC-Utils.html#handleSqlError" class="link">Source</a></p><div class="doc"><p>Catches <code><a href="Database-HDBC.html#t:SqlError">SqlError</a></code>s, and re-raises them as IO errors with fail.
Useful if you don't care to catch SQL errors, but want to see a sane
error message if one happens.  One would often use this as a high-level
wrapper around SQL calls. </p></div></div><h1 id="g:16">Column Types</h1><div class="doc"><p>These are defined in <a href="Database-HDBC-ColTypes.html">Database.HDBC.ColTypes</a> but are
 available to programs importing <a href="Database-HDBC.html">Database.HDBC</a> by default as well.
 See <a href="Database-HDBC-ColTypes.html">Database.HDBC.ColTypes</a> for documentation.</p></div><div class="top"><p class="src">module <a href="Database-HDBC-ColTypes.html">Database.HDBC.ColTypes</a></p></div><h1 id="g:17">Threading</h1><div class="doc"><p>FIXME: this is draft information</p><p>Thread support in a generalized interface such as HDBC can be complicated
because support for threading varies across database interfaces.</p><p>However, applications using HDBC should be able to rely upon at least a few
basic guarantees:</p><ul><li>The HDBC modules may freely be imported and used across all threads.</li><li>HDBC modules may also freely share database connections and statements;
   the database or HDBC driver will be responsible for locking if necessary.</li></ul><p>I use &quot;share&quot; in the same sense as Python's DB-API: multiple threads may use
the resource without wrapping it in any lock.</p><p>However, there are some caveats to the above:</p><ul><li>Not all databases support more than one active statement for a single
   connection.  Therefore, for maximum portability, you should use
   a different connection to the database for each simultaneous query you
   wish to use.
   FIXME: describe when a statement is active.</li><li>Not all databases may support the level of multithreading described above.
   For those that don't, safe access will be restriced in the HDBC driver
   by using locks.  Therefore, you can write portable code, but you 
   only get real multithreading when databases really support it.
   Details of thread support should be documented in the HDBC
   driver for each specific database.</li></ul></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>