This file is indexed.

/usr/share/doc/racket/db/connect.html is in racket-doc 6.1-4.

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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>2&nbsp;Connections</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">DB:<span class="mywbr"> &nbsp;</span> Database Connectivity</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="using-db.html" class="tocviewlink" data-pltdoc="x">Using Database Connections</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Connections</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="query-api.html" class="tocviewlink" data-pltdoc="x">Queries</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="sql-types.html" class="tocviewlink" data-pltdoc="x">SQL Types and Conversions</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="util.html" class="tocviewlink" data-pltdoc="x">Utilities</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="notes.html" class="tocviewlink" data-pltdoc="x">Notes</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9658;</a></td><td>2&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Connections</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">2.1&nbsp;</td><td><a href="#%28part._creating-connections%29" class="tocviewlink" data-pltdoc="x">Base Connections</a></td></tr><tr><td align="right">2.2&nbsp;</td><td><a href="#%28part._.Connection_.Pooling%29" class="tocviewlink" data-pltdoc="x">Connection Pooling</a></td></tr><tr><td align="right">2.3&nbsp;</td><td><a href="#%28part._.Virtual_.Connections%29" class="tocviewlink" data-pltdoc="x">Virtual Connections</a></td></tr><tr><td align="right">2.4&nbsp;</td><td><a href="#%28part._kill-safe%29" class="tocviewlink" data-pltdoc="x">Kill-<wbr></wbr>safe Connections</a></td></tr><tr><td align="right">2.5&nbsp;</td><td><a href="#%28part._.Data_.Source_.Names%29" class="tocviewlink" data-pltdoc="x">Data Source Names</a></td></tr><tr><td align="right">2.6&nbsp;</td><td><a href="#%28part._managing-connections%29" class="tocviewlink" data-pltdoc="x">Managing Connections</a></td></tr><tr><td align="right">2.7&nbsp;</td><td><a href="#%28part._.System-specific_.Modules%29" class="tocviewlink" data-pltdoc="x">System-<wbr></wbr>specific Modules</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">2.1<tt>&nbsp;</tt></span><a href="#%28part._creating-connections%29" class="tocsubseclink" data-pltdoc="x">Base Connections</a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">postgresql-<wbr></wbr>connect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-guess-socket-path%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">postgresql-<wbr></wbr>guess-<wbr></wbr>socket-<wbr></wbr>path</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mysql-<wbr></wbr>connect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-guess-socket-path%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mysql-<wbr></wbr>guess-<wbr></wbr>socket-<wbr></wbr>path</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sqlite3-<wbr></wbr>connect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-available~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sqlite3-<wbr></wbr>available?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-connect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">odbc-<wbr></wbr>connect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-driver-connect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">odbc-<wbr></wbr>driver-<wbr></wbr>connect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-data-sources%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">odbc-<wbr></wbr>data-<wbr></wbr>sources</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-drivers%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">odbc-<wbr></wbr>drivers</span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.2<tt>&nbsp;</tt></span><a href="#%28part._.Connection_.Pooling%29" class="tocsubseclink" data-pltdoc="x">Connection Pooling</a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">connection-<wbr></wbr>pool</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">connection-<wbr></wbr>pool?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">connection-<wbr></wbr>pool-<wbr></wbr>lease</span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.3<tt>&nbsp;</tt></span><a href="#%28part._.Virtual_.Connections%29" class="tocsubseclink" data-pltdoc="x">Virtual Connections</a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">virtual-<wbr></wbr>connection</span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.4<tt>&nbsp;</tt></span><a href="#%28part._kill-safe%29" class="tocsubseclink" data-pltdoc="x">Kill-<wbr></wbr>safe Connections</a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._kill-safe-connection%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">kill-<wbr></wbr>safe-<wbr></wbr>connection</span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.5<tt>&nbsp;</tt></span><a href="#%28part._.Data_.Source_.Names%29" class="tocsubseclink" data-pltdoc="x">Data Source Names</a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">data-<wbr></wbr>source</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dsn-connect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">dsn-<wbr></wbr>connect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._current-dsn-file%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>dsn-<wbr></wbr>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._get-dsn%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">get-<wbr></wbr>dsn</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._put-dsn%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">put-<wbr></wbr>dsn</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._postgresql-data-source%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">postgresql-<wbr></wbr>data-<wbr></wbr>source</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._mysql-data-source%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">mysql-<wbr></wbr>data-<wbr></wbr>source</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._sqlite3-data-source%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sqlite3-<wbr></wbr>data-<wbr></wbr>source</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._odbc-data-source%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">odbc-<wbr></wbr>data-<wbr></wbr>source</span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.6<tt>&nbsp;</tt></span><a href="#%28part._managing-connections%29" class="tocsubseclink" data-pltdoc="x">Managing Connections</a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">connection?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">disconnect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connected~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">connected?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-dbsystem%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">connection-<wbr></wbr>dbsystem</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">dbsystem?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem-name%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">dbsystem-<wbr></wbr>name</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem-supported-types%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">dbsystem-<wbr></wbr>supported-<wbr></wbr>types</span></span></a></td></tr><tr><td><span class="tocsublinknumber">2.7<tt>&nbsp;</tt></span><a href="#%28part._.System-specific_.Modules%29" class="tocsubseclink" data-pltdoc="x">System-<wbr></wbr>specific Modules</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.1&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.1&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="using-db.html" title="backward to &quot;1 Using Database Connections&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;DB: Database Connectivity&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="query-api.html" title="forward to &quot;3 Queries&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;connect&quot;">2<tt>&nbsp;</tt><a name="(part._connect)"></a>Connections</h3><p>This section describes functions for creating connections as well as
administrative functions for managing connections.</p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;creating-connections&quot;">2.1<tt>&nbsp;</tt><a name="(part._creating-connections)"></a>Base Connections</h4><p>There are four kinds of base connection, and they are divided into two
groups: <a name="(tech._wire._based._connection)"></a><span style="font-style: italic">wire-based connections</span> and <a name="(tech._ffi._based._connection)"></a><span style="font-style: italic">FFI-based
connections</span>. PostgreSQL and MySQL connections are wire-based, and
SQLite and ODBC connections are FFI-based. See also
<a href="notes.html#%28part._ffi-concurrency%29" data-pltdoc="x">FFI-Based Connections and Concurrency</a>.</p><p>Base connections are made using the following functions.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td colspan="3"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._postgresql-connect))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValDef RktValLink" data-pltdoc="x">postgresql-connect</a></span></span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVar">user</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:server</span><span class="hspace">&nbsp;</span><span class="RktVar">server</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:port</span><span class="hspace">&nbsp;</span><span class="RktVar">port</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVar">socket</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVar">password</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:allow-cleartext-password?</span><span class="hspace">&nbsp;</span><span class="RktVar">allow-cleartext-password?</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:ssl</span><span class="hspace">&nbsp;</span><span class="RktVar">ssl</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:ssl-context</span><span class="hspace">&nbsp;</span><span class="RktVar">ssl-context</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notification-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notification-handler</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">user</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">server</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">"localhost"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">port</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-positive-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-positive-integer?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">5432</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">socket</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">guess</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">password</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">allow-cleartext-password?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ssl</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">yes</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">optional</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">no</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">no</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">ssl-context</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-client-context%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-client-context?</a></span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-make-client-context%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-make-client-context</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">sslv3</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">notification-handler</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Creates a connection to a PostgreSQL server. Only the
<span class="RktVar">database</span> and <span class="RktVar">user</span> arguments are mandatory.</div></p><p>By default, the connection is made via TCP to <span class="RktVal">"localhost"</span>
at port <span class="RktVal">5432</span>. To make a different TCP connection, provide
one or both of the <span class="RktVar">server</span> and <span class="RktVar">port</span> arguments.</p><p>To connect via a local socket, specify the socket path as the
<span class="RktVar">socket</span> argument. You must not supply the <span class="RktVar">socket</span>
argument if you have also supplied either of the TCP arguments. See
also <a href="notes.html#%28part._connecting-to-server%29" data-pltdoc="x">Local Sockets for PostgreSQL and MySQL Servers</a> for notes on socket
paths. Supplying a <span class="RktVar">socket</span> argument of <span class="RktVal">'</span><span class="RktVal">guess</span> is
the same as supplying <span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-guess-socket-path%29%29" class="RktValLink" data-pltdoc="x">postgresql-guess-socket-path</a></span><span class="RktPn">)</span>.
Sockets are only available under Linux (x86) and Mac OS X.</p><p>If the server requests password authentication, the
<span class="RktVar">password</span> argument must be present; otherwise an exception
is raised. If the server does not request password authentication,
the <span class="RktVar">password</span> argument is ignored and may be omitted.  A
connection normally only sends password hashes (using the <span class="stt">md5</span>
authentication method). If the server requests a password sent as
cleartext (un-hashed), the connection is aborted unless
<span class="RktVar">allow-cleartext-password?</span> is true.</p><p>If the <span class="RktVar">ssl</span> argument is either <span class="RktVal">'</span><span class="RktVal">yes</span> or
<span class="RktVal">'</span><span class="RktVal">optional</span>, the connection attempts to negotiate an SSL
connection. If the server refuses SSL, the connection raises an
exception if <span class="RktVar">ssl</span> was set to <span class="RktVal">'</span><span class="RktVal">yes</span> or continues with
an unencrypted connection if <span class="RktVar">ssl</span> was set to
<span class="RktVal">'</span><span class="RktVal">optional</span>. By default, SSL provides encryption but does not
verify the identity of the server (see
<a href="http://www.postgresql.org/docs/9.0/static/libpq-ssl.html">this
explanation</a>). Host verification can be required via the
<span class="RktVar">ssl-context</span> argument; see <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-set-verify%2521%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-set-verify!</a></span>. Some
servers use SSL certificates to authenticate clients; see
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-load-certificate-chain%2521%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-load-certificate-chain!</a></span> and
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-load-private-key%2521%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-load-private-key!</a></span>. SSL may only be used with TCP
connections, not with local sockets.</p><p>The <span class="RktVar">notice-handler</span> is called on notice messages
received asynchronously from the server. A common example is notice
of an index created automatically for a table&rsquo;s primary key. The
<span class="RktVar">notice-handler</span> function takes two string arguments: the
condition&rsquo;s SQLSTATE and a message. The
<span class="RktVar">notification-handler</span> is called in response to an event
notification (see the <span class="stt">LISTEN</span> and <span class="stt">NOTIFY</span> statements); its
argument is the name of the event as a string. An output port may be
supplied instead of a procedure, in which case a message is printed
to the given port. Finally, the symbol <span class="RktVal">'</span><span class="RktVal">output</span> causes the
message to be printed to the current output port, and
<span class="RktVal">'</span><span class="RktVal">error</span> causes the message to be printed to the current
error port.</p><p>If the connection cannot be made, an exception is raised.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:server</span><span class="hspace">&nbsp;</span><span class="RktVal">"db.mysite.com"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:port</span><span class="hspace">&nbsp;</span><span class="RktVal">5432</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"webappdb"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"webapp"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVal">"ultra5ecret"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVal">"icecream"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">Typical socket path</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVal">"/var/run/postgresql/.s.PGSQL.5432"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">guess</span><span class="hspace">&nbsp;</span><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">or (postgresql-guess-socket-path)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._postgresql-guess-socket-path))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-guess-socket-path%29%29" class="RktValDef RktValLink" data-pltdoc="x">postgresql-guess-socket-path</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Attempts to guess the path for the socket based on conventional
locations. This function returns the first such path that exists in
the filesystem. It does not check that the path is a socket file,
nor that the path is connected to a PostgreSQL server.</div></p><p>If none of the attempted paths exist, an exception is raised.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._mysql-connect))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValDef RktValLink" data-pltdoc="x">mysql-connect</a></span></span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVar">user</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:server</span><span class="hspace">&nbsp;</span><span class="RktVar">server</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:port</span><span class="hspace">&nbsp;</span><span class="RktVar">port</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVar">socket</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:ssl</span><span class="hspace">&nbsp;</span><span class="RktVar">ssl</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:ssl-context</span><span class="hspace">&nbsp;</span><span class="RktVar">ssl-context</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVar">password</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td><td>&rarr;</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">user</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">server</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">"localhost"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">port</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-positive-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-positive-integer?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">3306</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">socket</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ssl</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">yes</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">optional</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">no</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">no</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">ssl-context</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-client-context%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-client-context?</a></span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=openssl&amp;rel=index.html%23%2528def._%2528%2528lib._openssl%252Fmain..rkt%2529._ssl-make-client-context%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">ssl-make-client-context</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">tls</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">password</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-nonnegative-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Creates a connection to a MySQL server. If <span class="RktVar">database</span> is
<span class="RktVal">#f</span>, the connection is established without setting the
current database; it should be subsequently set with the <span class="stt">USE</span>
SQL command.</div></p><p>The meaning of the other keyword arguments is similar to those of
the <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span> function, except that the first
argument to a <span class="RktVar">notice-handler</span> function is a MySQL-specific
integer code rather than a SQLSTATE string, and a <span class="RktVar">socket</span>
argument of <span class="RktVal">'</span><span class="RktVal">guess</span> is the same as supplying
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-guess-socket-path%29%29" class="RktValLink" data-pltdoc="x">mysql-guess-socket-path</a></span><span class="RktPn">)</span>.</p><p>If the connection cannot be made, an exception is raised.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValLink" data-pltdoc="x">mysql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:server</span><span class="hspace">&nbsp;</span><span class="RktVal">"db.mysite.com"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:port</span><span class="hspace">&nbsp;</span><span class="RktVal">3306</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"webappdb"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"webapp"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVal">"ultra5ecret"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValLink" data-pltdoc="x">mysql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVal">"icecream"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValLink" data-pltdoc="x">mysql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">Typical socket path</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVal">"/var/run/mysqld/mysqld.sock"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValLink" data-pltdoc="x">mysql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-guess-socket-path%29%29" class="RktValLink" data-pltdoc="x">mysql-guess-socket-path</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._mysql-guess-socket-path))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-guess-socket-path%29%29" class="RktValDef RktValLink" data-pltdoc="x">mysql-guess-socket-path</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Attempts to guess the path for the socket based on conventional
locations. This function returns the first such path that exists in
the filesystem. It does not check that the path is a socket file,
nor that the path is connected to a MySQL server.</div></p><p>If none of the attempted paths exist, an exception is raised.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._sqlite3-connect))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValDef RktValLink" data-pltdoc="x">sqlite3-connect</a></span></span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:mode</span><span class="hspace">&nbsp;</span><span class="RktVar">mode</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:busy-retry-limit</span><span class="hspace">&nbsp;</span><span class="RktVar">busy-retry-limit</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:busy-retry-delay</span><span class="hspace">&nbsp;</span><span class="RktVar">busy-retry-delay</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:use-place</span><span class="hspace">&nbsp;</span><span class="RktVar">use-place</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">memory</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">temporary</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">mode</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">read-only</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">read/write</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">create</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">read/write</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">busy-retry-limit</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-nonnegative-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">+inf.0</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktVal">10</span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">busy-retry-delay</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._and%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">and/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._rational%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">rational?</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._not%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">not/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._negative%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">negative?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">0.1</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">use-place</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Opens the SQLite database at the file named by <span class="RktVar">database</span>, if
<span class="RktVar">database</span> is a string or path. If <span class="RktVar">database</span> is
<span class="RktVal">'</span><span class="RktVal">temporary</span>, a private disk-based database is created. If
<span class="RktVar">database</span> is <span class="RktVal">'</span><span class="RktVal">memory</span>, a private memory-based
database is created.</div></p><p>If <span class="RktVar">mode</span> is <span class="RktVal">'</span><span class="RktVal">read-only</span>, the database is opened in
read-only mode. If <span class="RktVar">mode</span> is <span class="RktVal">'</span><span class="RktVal">read/write</span> (the
default), the database is opened for reading and writing (if
filesystem permissions permit). The <span class="RktVal">'</span><span class="RktVal">create</span> mode is like
<span class="RktVal">'</span><span class="RktVal">read/write</span>, except that if the given file does not exist,
it is created as a new database.</p><p>SQLite uses <a href="http://www.sqlite.org/lockingv3.html">coarse-grained
locking</a>, and many internal operations fail with the
<span class="stt">SQLITE_BUSY</span> condition when a lock cannot be acquired. When an
internal operation fails because the database is busy, the
connection sleeps for <span class="RktVar">busy-retry-delay</span> seconds and retries
the operation, up to <span class="RktVar">busy-retry-limit</span> additional times. If
<span class="RktVar">busy-retry-limit</span> is <span class="RktVal">0</span>, the operation is only
attempted once. If after <span class="RktVar">busy-retry-limit</span> retries the
operation still does not succeed, an exception is raised.</p><p>If <span class="RktVar">use-place</span> is true, the actual connection is created in
a distinct <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=places.html%23%2528tech._place%2529&amp;version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">place</span></a> for database connections and a
proxy is returned; see <a href="notes.html#%28part._ffi-concurrency%29" data-pltdoc="x">FFI-Based Connections and Concurrency</a>.</p><p>If the connection cannot be made, an exception is raised.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"/path/to/my.db"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"relpath/to/my.db"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:mode</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">create</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._sqlite3-available~3f))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-available~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">sqlite3-available?</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Reports whether the SQLite native library is found, in which case
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span> works, otherwise it raises an exception.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td colspan="3"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._odbc-connect))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-connect%29%29" class="RktValDef RktValLink" data-pltdoc="x">odbc-connect</a></span></span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:dsn</span><span class="hspace">&nbsp;</span><span class="RktVar">dsn</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVar">user</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVar">password</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:strict-parameter-types?</span><span class="hspace">&nbsp;</span><span class="RktVar">strict-parameter-types?</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:character-mode</span><span class="hspace">&nbsp;</span><span class="RktVar">character-mode</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:use-place</span><span class="hspace">&nbsp;</span><span class="RktVar">use-place</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">user</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">password</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">strict-parameter-types?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">character-mode</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">wchar</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">utf-8</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">latin-1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">wchar</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">use-place</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a connection to the ODBC Data Source named <span class="RktVar">dsn</span>. The
<span class="RktVar">user</span> and <span class="RktVar">password</span> arguments are optional, since
that information may be incorporated into the data source
definition, or it might not be relevant to the data source&rsquo;s driver.
The <span class="RktVar">notice-handler</span> argument behaves the same as in
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span>.</div></p><p>If <span class="RktVar">strict-parameter-types?</span> is true, then the connection
attempts to determine and enforce specific types for query
parameters. See <a href="sql-types.html#%28part._odbc-types%29" data-pltdoc="x">ODBC Types</a> for more details.</p><p>By default, connections use ODBC&rsquo;s <span class="stt">SQL_C_WCHAR</span>-based character
encoding (as UTF-16) to send and receive Unicode character
data. Unfortunately, some drivers&rsquo; support for this method is
buggy. To use <span class="stt">SQL_C_CHAR</span> instead, set <span class="RktVar">character-mode</span>
to <span class="RktVal">'</span><span class="RktVal">utf-8</span> or <span class="RktVal">'</span><span class="RktVal">latin-1</span>, depending on which encoding
the driver uses.</p><p>See <a href="notes.html#%28part._odbc-status%29" data-pltdoc="x">ODBC Status</a> for notes on specific ODBC drivers and
recommendations for connection options.</p><p>If <span class="RktVar">use-place</span> is true, the actual connection is created in
a distinct <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=places.html%23%2528tech._place%2529&amp;version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">place</span></a> for database connections and a
proxy is returned; see <a href="notes.html#%28part._ffi-concurrency%29" data-pltdoc="x">FFI-Based Connections and Concurrency</a>.</p><p>If the connection cannot be made, an exception is raised.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td colspan="3"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._odbc-driver-connect))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-driver-connect%29%29" class="RktValDef RktValLink" data-pltdoc="x">odbc-driver-connect</a></span></span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktVar">connection-string</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:strict-parameter-types?</span><span class="hspace">&nbsp;</span><span class="RktVar">strict-parameter-types?</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:character-mode</span><span class="hspace">&nbsp;</span><span class="RktVar">character-mode</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:use-place</span><span class="hspace">&nbsp;</span><span class="RktVar">use-place</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">connection-string</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">strict-parameter-types?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">character-mode</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">wchar</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">utf-8</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">latin-1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">wchar</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">use-place</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a connection using an ODBC connection string containing a
sequence of keyword and value connection parameters. The syntax of
connection strings is described in
<a href="http://msdn.microsoft.com/en-us/library/ms715433%28v=VS.85%29.aspx">SQLDriverConnect</a>
(see Comments section); supported attributes depend on the
driver. The other arguments are the same as in <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-connect%29%29" class="RktValLink" data-pltdoc="x">odbc-connect</a></span>.</div></p><p>If the connection cannot be made, an exception is raised.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._odbc-data-sources))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-data-sources%29%29" class="RktValDef RktValLink" data-pltdoc="x">odbc-data-sources</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._listof%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._list%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">list/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns a list of known ODBC Data Sources. Each data souce is
represented by a list of two strings; the first string is the name
of the data source, and the second is the name of its associated
driver.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/main..rkt)._odbc-drivers))"></a><span title="Provided from: db | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-drivers%29%29" class="RktValDef RktValLink" data-pltdoc="x">odbc-drivers</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._listof%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._cons%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">cons/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Returns a list of known ODBC Drivers. Each driver is represented by
a list, the first element of which is the name of the driver. The
contents of the rest of each entry is currently undefined.</div></p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;Connection_Pooling&quot;">2.2<tt>&nbsp;</tt><a name="(part._.Connection_.Pooling)"></a>Connection Pooling</h4><p>Creating a database connection can be a costly operation; it may
involve steps such as process creation and SSL negotiation. A
<a name="(tech._connection._pool)"></a><span style="font-style: italic">connection pool</span> helps reduce connection costs by reusing
connections.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._connection-pool))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool%29%29" class="RktValDef RktValLink" data-pltdoc="x">connection-pool</a></span></span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktVar">connect</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:max-connections</span><span class="hspace">&nbsp;</span><span class="RktVar">max-connections</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:max-idle-connections</span><span class="hspace">&nbsp;</span><span class="RktVar">max-idle-connections</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool~3f%29%29" class="RktValLink" data-pltdoc="x">connection-pool?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">connect</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">max-connections</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._integer-in%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">integer-in</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">10000</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">+inf.0</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">+inf.0</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">max-idle-connections</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._integer-in%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">integer-in</a></span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="hspace">&nbsp;</span><span class="RktVal">10000</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktVal">+inf.0</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">10</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a <a href="#%28tech._connection._pool%29" class="techoutside" data-pltdoc="x"><span class="techinside">connection pool</span></a>. The pool consists of up to
<span class="RktVar">max-connections</span>, divided between leased connections and up to
<span class="RktVar">max-idle-connections</span> idle connections. The pool uses
<span class="RktVar">connect</span> to create new connections when needed. The
<span class="RktVar">connect</span> function is called with the same
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=custodians.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-custodian%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">current-custodian</a></span> value as when the connection pool was
created, and it must return a fresh connection each time it is called.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">pool</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool%29%29" class="RktValLink" data-pltdoc="x">connection-pool</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Writing.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._displayln%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">displayln</a></span><span class="hspace">&nbsp;</span><span class="RktVal">"connecting!"</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span><span class="hspace">&nbsp;</span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:max-idle-connections</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c1</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="RktValLink" data-pltdoc="x">connection-pool-lease</a></span><span class="hspace">&nbsp;</span><span class="RktSym">pool</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">connecting!</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c2</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="RktValLink" data-pltdoc="x">connection-pool-lease</a></span><span class="hspace">&nbsp;</span><span class="RktSym">pool</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">connecting!</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="RktValLink" data-pltdoc="x">disconnect</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c1</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c3</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="RktValLink" data-pltdoc="x">connection-pool-lease</a></span><span class="hspace">&nbsp;</span><span class="RktSym">pool</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktCmt">;</span><span class="RktCmt">&nbsp;</span><span class="RktCmt">reuses actual conn. from c1</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr></table></blockquote></td></tr></table></p><p>See also <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="RktValLink" data-pltdoc="x">virtual-connection</a></span> for a mechanism that eliminates
the need to explicitly call <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="RktValLink" data-pltdoc="x">connection-pool-lease</a></span> and
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="RktValLink" data-pltdoc="x">disconnect</a></span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._connection-pool~3f))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">connection-pool?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">x</span> is a connection pool, <span class="RktVal">#f</span>
otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._connection-pool-lease))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="RktValDef RktValLink" data-pltdoc="x">connection-pool-lease</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">pool</span><span class="hspace">&nbsp;</span>[<span class="RktVar">release</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">pool</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool~3f%29%29" class="RktValLink" data-pltdoc="x">connection-pool?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">release</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=sync.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._evt%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">evt?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=custodians.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._custodian%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">custodian?</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=threads.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-thread%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">current-thread</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Obtains a connection from the connection pool, using an existing idle
connection in <span class="RktVar">pool</span> if one is available. If no idle connection
is available and the pool contains fewer than its maximum allowed
connections, a new connection is created; otherwise an exception is
raised.</div></p><p>Calling <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="RktValLink" data-pltdoc="x">disconnect</a></span> on the connection obtained causes the
connection to be released back to the connection pool. The connection
is also released if <span class="RktVar">release</span> becomes available, if it is a
synchronizable event, or if <span class="RktVar">release</span> is shutdown, if it is a
custodian. The default for <span class="RktVar">release</span> is the current thread, so
the resulting connection is released when the thread that requested it
terminates.</p><p>When a connection is released, it is kept as an idle connection if
<span class="RktVar">pool</span>&rsquo;s idle connection limit would not be exceeded;
otherwise, it is disconnected. In either case, if the connection is in
a transaction, the transaction is rolled back.</p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;Virtual_Connections&quot;">2.3<tt>&nbsp;</tt><a name="(part._.Virtual_.Connections)"></a>Virtual Connections</h4><p>A <a name="(tech._virtual._connection)"></a><span style="font-style: italic">virtual connection</span> creates actual connections on demand and
automatically releases them when they are no longer needed.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._virtual-connection))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="RktValDef RktValLink" data-pltdoc="x">virtual-connection</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">connect</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">connect</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-&gt;</span></a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool~3f%29%29" class="RktValLink" data-pltdoc="x">connection-pool?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a <a href="#%28tech._virtual._connection%29" class="techoutside" data-pltdoc="x"><span class="techinside">virtual connection</span></a> that creates actual connections on
demand using the <span class="RktVar">connect</span> function, or by calling
<span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool-lease%29%29" class="RktValLink" data-pltdoc="x">connection-pool-lease</a></span><span class="stt"> </span><span class="RktVar">connect</span><span class="RktPn">)</span> if <span class="RktVar">connect</span> is a
<a href="#%28tech._connection._pool%29" class="techoutside" data-pltdoc="x"><span class="techinside">connection pool</span></a>. If <span class="RktVar">connect</span> is a function, it is
called with the same <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=custodians.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._current-custodian%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">current-custodian</a></span> value as when the
virtual connection was created.</div></p><p>A virtual connection encapsulates a mapping
of threads to actual connections. When a query function is called with
a virtual connection, the current thread&rsquo;s associated actual
connection is used to execute the query. If there is no actual
connection associated with the current thread, one is obtained by
calling <span class="RktVar">connect</span>. An actual connection is disconnected when
its associated thread dies.</p><p>Virtual connections are especially useful in contexts such as web
servlets (see <a href="using-db.html#%28part._intro-servlets%29" data-pltdoc="x">Databases and Web Servlets</a>), where each request is
handled in a fresh thread. A single global virtual connection can be
defined, freeing each servlet request from explicitly opening and
closing its own connections. In particular, a <a href="#%28tech._virtual._connection%29" class="techoutside" data-pltdoc="x"><span class="techinside">virtual
connection</span></a> backed by a <a href="#%28tech._connection._pool%29" class="techoutside" data-pltdoc="x"><span class="techinside">connection pool</span></a> combines convenience
with efficiency:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">the-connection</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="RktValLink" data-pltdoc="x">virtual-connection</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-pool%29%29" class="RktValLink" data-pltdoc="x">connection-pool</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>The resulting virtual connection leases a connection from the pool on
demand for each servlet request thread and releases it when the thread
terminates (that is, when the request has been handled).</p><p>When given a connection produced by <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="RktValLink" data-pltdoc="x">virtual-connection</a></span>,
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connected~3f%29%29" class="RktValLink" data-pltdoc="x">connected?</a></span> indicates whether there is an actual connection
associated with the current thread. Likewise, <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="RktValLink" data-pltdoc="x">disconnect</a></span>
causes the current actual connection associated with the thread (if
there is one) to be disconnected, but the connection will be recreated
if a query function is executed.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="RktValLink" data-pltdoc="x">virtual-connection</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Writing.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._printf%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">printf</a></span><span class="hspace">&nbsp;</span><span class="RktVal">"connecting!\n"</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span><span class="hspace">&nbsp;</span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connected~3f%29%29" class="RktValLink" data-pltdoc="x">connected?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._query-value%29%29" class="RktValLink" data-pltdoc="x">query-value</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktVal">"select 1"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">connecting!</span></p></td></tr><tr><td><p><span class="RktRes">1</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connected~3f%29%29" class="RktValLink" data-pltdoc="x">connected?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=threads.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._thread%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">thread</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Writing.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._displayln%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">displayln</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._query-value%29%29" class="RktValLink" data-pltdoc="x">query-value</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktVal">"select 2"</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktOut">connecting!</span></p></td></tr><tr><td><p><span class="RktOut">2</span></p></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="RktValLink" data-pltdoc="x">disconnect</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connected~3f%29%29" class="RktValLink" data-pltdoc="x">connected?</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._query-value%29%29" class="RktValLink" data-pltdoc="x">query-value</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktVal">"select 3"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">connecting!</span></p></td></tr><tr><td><p><span class="RktRes">3</span></p></td></tr></table></blockquote></td></tr></table></p><p>Connections produced by <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-connection%29%29" class="RktValLink" data-pltdoc="x">virtual-connection</a></span> may not be used
with the <span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._prepare%29%29" class="RktValLink" data-pltdoc="x">prepare</a></span> function. However, they may still be used to
execute parameterized queries expressed as strings or encapsulated via
<span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-statement%29%29" class="RktValLink" data-pltdoc="x">virtual-statement</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._prepare%29%29" class="RktValLink" data-pltdoc="x">prepare</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktVal">"select 2 + $1"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">prepare: cannot prepare statement with virtual connection</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._query-value%29%29" class="RktValLink" data-pltdoc="x">query-value</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktVal">"select 2 + $1"</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">4</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace">&nbsp;</span><span class="RktSym">pst</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._virtual-statement%29%29" class="RktValLink" data-pltdoc="x">virtual-statement</a></span><span class="hspace">&nbsp;</span><span class="RktVal">"select 2 + $1"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._query-value%29%29" class="RktValLink" data-pltdoc="x">query-value</a></span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktSym">pst</span><span class="hspace">&nbsp;</span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">5</span></p></td></tr></table></blockquote></td></tr></table></p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;kill-safe&quot;">2.4<tt>&nbsp;</tt><a name="(part._kill-safe)"></a>Kill-safe Connections</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._kill-safe-connection))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._kill-safe-connection%29%29" class="RktValDef RktValLink" data-pltdoc="x">kill-safe-connection</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">c</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Creates a proxy for connection <span class="RktVar">c</span>. All queries performed
through the proxy are kill-safe; that is, if a thread is killed during
a call to a query function such as <span class="RktSym"><a href="query-api.html#%28def._%28%28lib._db%2Fbase..rkt%29._query%29%29" class="RktValLink" data-pltdoc="x">query</a></span>, the connection will
not become locked or damaged. (Connections are normally thread-safe but
not kill-safe.)</div></p><p>Note: A kill-safe connection whose underlying connection uses ports to
communicate with a database server is not protected from a custodian
shutting down its ports.</p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;Data_Source_Names&quot;">2.5<tt>&nbsp;</tt><a name="(part._.Data_.Source_.Names)"></a>Data Source Names</h4><p>A DSN (data source name) is a symbol associated with a connection
specification in a DSN file. They are inspired by, but distinct from,
ODBC&rsquo;s DSNs.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace">&nbsp;</span></td><td><a name="(def._((lib._db/base..rkt)._set-data-source-extensions!))"></a><a name="(def._((lib._db/base..rkt)._set-data-source-args!))"></a><a name="(def._((lib._db/base..rkt)._set-data-source-connector!))"></a><a name="(def._((lib._db/base..rkt)._data-source-extensions))"></a><a name="(def._((lib._db/base..rkt)._data-source-args))"></a><a name="(def._((lib._db/base..rkt)._data-source-connector))"></a><a name="(def._((lib._db/base..rkt)._data-source~3f))"></a><a name="(def._((lib._db/base..rkt)._struct~3adata-source))"></a><a name="(def._((lib._db/base..rkt)._data-source))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source%29%29" class="RktValDef RktValLink" data-pltdoc="x">data-source</a></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">connector</span><span class="stt"> </span><span class="RktSym">args</span><span class="stt"> </span><span class="RktSym">extensions</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:mutable</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">connector</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">postgresql</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">mysql</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">sqlite3</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">odbc</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">args</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._list%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">list?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktSym">extensions</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._listof%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._list%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">list/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Represents a data source. The <span class="RktSym">connector</span> field determines
which connection function is used to create the connection. The
<span class="RktSym">args</span> field is a partial list of arguments passed to the
connection function; additional arguments may be added when
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dsn-connect%29%29" class="RktValLink" data-pltdoc="x">dsn-connect</a></span> is called. The <span class="RktSym">extensions</span> field
contains additional information about a connection; for example,
this library&rsquo;s testing framework uses it to store SQL dialect
flags.</div></p><p>Data sources can also be created using the
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._postgresql-data-source%29%29" class="RktValLink" data-pltdoc="x">postgresql-data-source</a></span>, etc auxiliary functions.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._dsn-connect))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dsn-connect%29%29" class="RktValDef RktValLink" data-pltdoc="x">dsn-connect</a></span></span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktVar">dsn</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:dsn-file</span><span class="hspace">&nbsp;</span><span class="RktVar">dsn-file</span>]</td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktVar">arg</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:&lt;kw&gt;</span><span class="hspace">&nbsp;</span><span class="RktVar">kw-arg</span><span class="hspace">&nbsp;</span><span class="RktMeta">...</span><span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td><td>&rarr;</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn-file</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._current-dsn-file%29%29" class="RktValLink" data-pltdoc="x">current-dsn-file</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">arg</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">kw-arg</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Makes a connection using the connection information associated with
  <span class="RktVar">dsn</span> in <span class="RktVar">dsn-file</span>. The given <span class="RktVar">arg</span>s and
  <span class="RktVar">kw-arg</span>s are added to those specified by <span class="RktVar">dsn</span> to
  form the complete arguments supplied to the connect function.</div></p><p>If <span class="RktVar">dsn-file</span> does not exist, or if it contains no entry
  for <span class="RktVar">dsn</span>, an exception is raised. If <span class="RktVar">dsn</span> is a
  <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source%29%29" class="RktValLink" data-pltdoc="x">data-source</a></span>, then <span class="RktVar">dsn-file</span> is ignored.</p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._put-dsn%29%29" class="RktValLink" data-pltdoc="x">put-dsn</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">pg</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._postgresql-data-source%29%29" class="RktValLink" data-pltdoc="x">postgresql-data-source</a></span><span class="hspace">&nbsp;</span><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVal">"me"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVal">"mydb"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVal">"icecream"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dsn-connect%29%29" class="RktValLink" data-pltdoc="x">dsn-connect</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">pg</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dsn-connect%29%29" class="RktValLink" data-pltdoc="x">dsn-connect</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">pg</span><span class="hspace">&nbsp;</span><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">code</span><span class="hspace">&nbsp;</span><span class="RktSym">msg</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">(object:connection% ...)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._current-dsn-file))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._current-dsn-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-dsn-file</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._current-dsn-file%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-dsn-file</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A parameter holding the location of the default DSN file. The
initial value is a file located immediately within
<span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Filesystem.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._find-system-path%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">find-system-path</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">prefs-dir</span><span class="RktPn">)</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._get-dsn))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._get-dsn%29%29" class="RktValDef RktValLink" data-pltdoc="x">get-dsn</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span>[<span class="RktVar">default</span><span class="hspace">&nbsp;</span><span class="RktPn">#:dsn-file</span><span class="hspace">&nbsp;</span><span class="RktVar">dsn-file</span>]<span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">default</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn-file</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._current-dsn-file%29%29" class="RktValLink" data-pltdoc="x">current-dsn-file</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns the <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source%29%29" class="RktValLink" data-pltdoc="x">data-source</a></span> associated with <span class="RktVar">dsn</span> in
<span class="RktVar">dsn-file</span>.</div></p><p>If <span class="RktVar">dsn-file</span> does not exist, an exception is raised. If
<span class="RktVar">dsn-file</span> does not have an entry for <span class="RktVar">dsn</span>,
<span class="RktVar">default</span> is called if it is a function or returned
otherwise.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._put-dsn))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._put-dsn%29%29" class="RktValDef RktValLink" data-pltdoc="x">put-dsn</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span><span class="RktVar">ds</span><span class="hspace">&nbsp;</span>[<span class="RktPn">#:dsn-file</span><span class="hspace">&nbsp;</span><span class="RktVar">dsn-file</span>]<span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ds</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn-file</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._current-dsn-file%29%29" class="RktValLink" data-pltdoc="x">current-dsn-file</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Associates <span class="RktVar">dsn</span> with the given data source <span class="RktVar">ds</span> in
<span class="RktVar">dsn-file</span>, replacing the previous association, if one
exists.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td colspan="3"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._postgresql-data-source))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._postgresql-data-source%29%29" class="RktValDef RktValLink" data-pltdoc="x">postgresql-data-source</a></span></span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVar">user</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:server</span><span class="hspace">&nbsp;</span><span class="RktVar">server</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:port</span><span class="hspace">&nbsp;</span><span class="RktVar">port</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVar">socket</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVar">password</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:allow-cleartext-password?</span><span class="hspace">&nbsp;</span><span class="RktVar">allow-cleartext-password?</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:ssl</span><span class="hspace">&nbsp;</span><span class="RktVar">ssl</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notification-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notification-handler</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">user</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">server</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">port</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-positive-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-positive-integer?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">socket</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">guess</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">password</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">allow-cleartext-password?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ssl</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">yes</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">optional</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">no</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">notice-handler</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">notification-handler</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._mysql-data-source))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._mysql-data-source%29%29" class="RktValDef RktValLink" data-pltdoc="x">mysql-data-source</a></span></span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVar">user</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:server</span><span class="hspace">&nbsp;</span><span class="RktVar">server</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:port</span><span class="hspace">&nbsp;</span><span class="RktVar">port</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:socket</span><span class="hspace">&nbsp;</span><span class="RktVar">socket</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:ssl</span><span class="hspace">&nbsp;</span><span class="RktVar">ssl</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVar">password</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">user</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">server</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">port</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-positive-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-positive-integer?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">socket</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">guess</span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">ssl</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">yes</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">optional</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">no</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">password</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">notice-handler</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._sqlite3-data-source))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._sqlite3-data-source%29%29" class="RktValDef RktValLink" data-pltdoc="x">sqlite3-data-source</a></span></span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:mode</span><span class="hspace">&nbsp;</span><span class="RktVar">mode</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:busy-retry-limit</span><span class="hspace">&nbsp;</span><span class="RktVar">busy-retry-limit</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:busy-retry-delay</span><span class="hspace">&nbsp;</span><span class="RktVar">busy-retry-delay</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:use-place</span><span class="hspace">&nbsp;</span><span class="RktVar">use-place</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">memory</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">temporary</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">mode</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">read-only</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">read/write</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">create</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">busy-retry-limit</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._exact-nonnegative-integer%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">+inf.0</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span style="font-style: italic">absent</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td><span class="hspace">&nbsp;&nbsp;</span></td><td><span class="RktVar">busy-retry-delay</span></td><td><span class="hspace">&nbsp;</span></td><td>:</td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._and%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">and/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._rational%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">rational?</a></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._not%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">not/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._negative%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">negative?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td>=</td><td><span class="hspace">&nbsp;</span></td><td><span style="font-style: italic">absent</span></td></tr></table></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">use-place</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td colspan="3"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._odbc-data-source))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._odbc-data-source%29%29" class="RktValDef RktValLink" data-pltdoc="x">odbc-data-source</a></span></span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span>[</td><td><span class="RktPn">#:dsn</span><span class="hspace">&nbsp;</span><span class="RktVar">dsn</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:database</span><span class="hspace">&nbsp;</span><span class="RktVar">database</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:user</span><span class="hspace">&nbsp;</span><span class="RktVar">user</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:password</span><span class="hspace">&nbsp;</span><span class="RktVar">password</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:notice-handler</span><span class="hspace">&nbsp;</span><span class="RktVar">notice-handler</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:strict-parameter-types?</span><span class="hspace">&nbsp;</span><span class="RktVar">strict-parameter-types?</span></td><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td><td><span class="hspace">&nbsp;</span></td><td><span class="RktPn">#:character-mode</span><span class="hspace">&nbsp;</span><span class="RktVar">character-mode</span>]<span class="RktPn">)</span></td><td><span class="hspace">&nbsp;</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source~3f%29%29" class="RktValLink" data-pltdoc="x">data-source?</a></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">dsn</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">database</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">user</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">password</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">notice-handler</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">output</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">error</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">strict-parameter-types?</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">character-mode</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">wchar</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">utf-8</span><span class="hspace">&nbsp;</span><span class="RktVal">'</span><span class="RktVal">latin-1</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>=<span class="hspace">&nbsp;</span><span style="font-style: italic">absent</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Analogues of <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValLink" data-pltdoc="x">mysql-connect</a></span>,
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span>, and <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-connect%29%29" class="RktValLink" data-pltdoc="x">odbc-connect</a></span>, respectively,
that return a <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._data-source%29%29" class="RktValLink" data-pltdoc="x">data-source</a></span> describing the (partial)
connection information. All arguments are optional, even those that
are mandatory in the corresponding connection function; the missing
arguments must be supplied when <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dsn-connect%29%29" class="RktValLink" data-pltdoc="x">dsn-connect</a></span> is called.</div></p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;managing-connections&quot;">2.6<tt>&nbsp;</tt><a name="(part._managing-connections)"></a>Managing Connections</h4><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._connection~3f))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">connection?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">x</span> is a connection, <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._disconnect))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._disconnect%29%29" class="RktValDef RktValLink" data-pltdoc="x">disconnect</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">connection</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">connection</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Closes the connection.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._connected~3f))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connected~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">connected?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">connection</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">connection</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">connection</span> is connected, <span class="RktVal">#f</span>
otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._connection-dbsystem))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection-dbsystem%29%29" class="RktValDef RktValLink" data-pltdoc="x">connection-dbsystem</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">connection</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem~3f%29%29" class="RktValLink" data-pltdoc="x">dbsystem?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">connection</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._connection~3f%29%29" class="RktValLink" data-pltdoc="x">connection?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Gets an object encapsulating information about the database system of
<span class="RktVar">connection</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._dbsystem~3f))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">dbsystem?</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">x</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Predicate for objects representing database systems.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._dbsystem-name))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem-name%29%29" class="RktValDef RktValLink" data-pltdoc="x">dbsystem-name</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">sys</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">sys</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem~3f%29%29" class="RktValLink" data-pltdoc="x">dbsystem?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a symbol that identifies the database system. Currently one of the
following:
</div><div class="SIntrapara"><ul><li><p><span class="RktVal">'</span><span class="RktVal">postgresql</span></p></li><li><p><span class="RktVal">'</span><span class="RktVal">mysql</span></p></li><li><p><span class="RktVal">'</span><span class="RktVal">sqlite3</span></p></li><li><p><span class="RktVal">'</span><span class="RktVal">odbc</span></p></li></ul></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._db/base..rkt)._dbsystem-supported-types))"></a><span title="Provided from: db, db/base | Package: db-lib"><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem-supported-types%29%29" class="RktValDef RktValLink" data-pltdoc="x">dbsystem-supported-types</a></span></span><span class="hspace">&nbsp;</span><span class="RktVar">sys</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span>&rarr;<span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._listof%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace">&nbsp;</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&amp;version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktVar">sys</span><span class="hspace">&nbsp;</span>:<span class="hspace">&nbsp;</span><span class="RktSym"><a href="#%28def._%28%28lib._db%2Fbase..rkt%29._dbsystem~3f%29%29" class="RktValLink" data-pltdoc="x">dbsystem?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns a list of symbols identifying types supported by the database
system. See <a href="sql-types.html#%28part._db-types%29" data-pltdoc="x">SQL Type Conversions</a>.</div></p><h4 x-source-module="(lib &quot;db/scribblings/db.scrbl&quot;)" x-part-tag="&quot;System-specific_Modules&quot;">2.7<tt>&nbsp;</tt><a name="(part._.System-specific_.Modules)"></a><a name="(mod-path._db/base)"></a><a name="(mod-path._db/postgresql)"></a><a name="(mod-path._db/mysql)"></a><a name="(mod-path._db/sqlite3)"></a><a name="(mod-path._db/odbc)"></a>System-specific Modules</h4><p>The <a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">db</span></a> module exports all of the
functions listed in this manual except those described in
<a href="util.html" data-pltdoc="x">Utilities</a>. The database system-specific connection modules are
loaded lazily to avoid unnecessary dependencies on foreign libraries.</p><p>The following modules provide subsets of the bindings described in
this manual.</p><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._db%2Fbase%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">db/base</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">db-lib</span></span></td></tr></table></p><p>Provides all generic connection operations (those described in
<a href="#%28part._managing-connections%29" data-pltdoc="x">Managing Connections</a> and <a href="query-api.html" data-pltdoc="x">Queries</a>) and SQL data
support (<a href="sql-types.html" data-pltdoc="x">SQL Types and Conversions</a>).</p><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._db%2Fpostgresql%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">db/postgresql</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">db-lib</span></span></td></tr></table></p><p>Provides only <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-connect%29%29" class="RktValLink" data-pltdoc="x">postgresql-connect</a></span> and
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._postgresql-guess-socket-path%29%29" class="RktValLink" data-pltdoc="x">postgresql-guess-socket-path</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._db%2Fmysql%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">db/mysql</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">db-lib</span></span></td></tr></table></p><p>Provides only <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-connect%29%29" class="RktValLink" data-pltdoc="x">mysql-connect</a></span> and
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._mysql-guess-socket-path%29%29" class="RktValLink" data-pltdoc="x">mysql-guess-socket-path</a></span>.</p><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._db%2Fsqlite3%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">db/sqlite3</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">db-lib</span></span></td></tr></table></p><p>Provides <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span> plus <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-available~3f%29%29" class="RktValLink" data-pltdoc="x">sqlite3-available?</a></span>. When
the SQLite native library cannot be found, <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29" class="RktValLink" data-pltdoc="x">sqlite3-connect</a></span>
raises an exception.</p><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&amp;rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&amp;version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="#%28mod-path._db%2Fodbc%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">db/odbc</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller">&nbsp;package:</span> <span class="stt">db-lib</span></span></td></tr></table></p><p>Provides only <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-connect%29%29" class="RktValLink" data-pltdoc="x">odbc-connect</a></span>, <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-driver-connect%29%29" class="RktValLink" data-pltdoc="x">odbc-driver-connect</a></span>,
<span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-data-sources%29%29" class="RktValLink" data-pltdoc="x">odbc-data-sources</a></span>, and <span class="RktSym"><a href="#%28def._%28%28lib._db%2Fmain..rkt%29._odbc-drivers%29%29" class="RktValLink" data-pltdoc="x">odbc-drivers</a></span>. In contrast to
<a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">db</span></a>, this module immediately attempts to
load the ODBC native library when required, and it raises an exception
if it cannot be found.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.1&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.1&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="using-db.html" title="backward to &quot;1 Using Database Connections&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;DB: Database Connectivity&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="query-api.html" title="forward to &quot;3 Queries&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>