/usr/share/doc/cl-sql/html/find-database.html is in cl-sql 6.5.0-1.
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 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>FIND-DATABASE</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="CLSQL Users' Guide" /><link rel="up" href="ref-connect.html" title="Connection and Initialisation" /><link rel="prev" href="disconnect-pooled.html" title="DISCONNECT-POOLED" /><link rel="next" href="initialize-database-type.html" title="INITIALIZE-DATABASE-TYPE" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">FIND-DATABASE</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="disconnect-pooled.html">Prev</a> </td><th width="60%" align="center">Connection and Initialisation</th><td width="20%" align="right"> <a accesskey="n" href="initialize-database-type.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="find-database"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>FIND-DATABASE — >Locate a database object through it's
name.<strong>Function</strong></p></div><div class="refsect1"><a id="idp61635392"></a><h2>Syntax</h2><pre class="synopsis"><code class="function">find-database</code> <em class="replaceable"><code>database</code></em> &optional <em class="replaceable"><code>errorp</code></em> => <span class="returnvalue">result</span></pre></div><div class="refsect1"><a id="idp61638304"></a><h2>Arguments and Values</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>database</code></em></span></dt><dd><p>A database object or a string, denoting a database
name.</p></dd><dt><span class="term"><em class="parameter"><code>errorp</code></em></span></dt><dd><p>A generalized boolean. Defaults to
<span class="symbol">t</span>.</p></dd><dt><span class="term"><em class="parameter"><code>db-type</code></em></span></dt><dd><p>
A keyword symbol denoting a known database back-end.
</p></dd><dt><span class="term"><span class="returnvalue">result</span></span></dt><dd><p>Either a database object, or, if
<em class="parameter"><code>errorp</code></em> is <code class="constant">NIL</code>,
possibly <code class="constant">NIL</code>.</p></dd></dl></div></div><div class="refsect1"><a id="idp61648784"></a><h2>Description</h2><p><code class="function">find-database</code> locates an active
database object given the specification in
<em class="parameter"><code>database</code></em>. If
<em class="parameter"><code>database</code></em> is an object of type
<span class="type">database</span>, <code class="function">find-database</code>
returns this. Otherwise it will search the active databases
as indicated by the list returned by
<code class="function">connected-databases</code> for a database of
type <em class="parameter"><code>db-type</code></em> whose name (as returned by
<code class="function">database-name</code> is equal as per
<code class="function">string=</code> to the string passed as
<em class="parameter"><code>database</code></em>. If it succeeds, it returns
the first database found.</p><p>
If <em class="parameter"><code>db-type</code></em> is <code class="constant">NIL</code> all databases
matching the string <em class="parameter"><code>database</code></em> are
considered. If no matching databases are found and
<em class="parameter"><code>errorp</code></em> is <code class="constant">NIL</code> then <code class="constant">NIL</code> is
returned. If <em class="parameter"><code>errorp</code></em> is <code class="constant">NIL</code> and one or
more matching databases are found, then the most recently
connected database is returned as a first value and the
number of matching databases is returned as a second
value. If no, or more than one, matching databases are found
and <em class="parameter"><code>errorp</code></em> is true, an error is
signalled.
</p></div><div class="refsect1"><a id="idp61661568"></a><h2>Examples</h2><pre class="screen">
(database-name-from-spec '("dent" "newesim" "dent" "dent") :mysql)
=> "dent/newesim/dent"
(connect '("dent" "newesim" "dent" "dent") :database-type :mysql)
=> #<CLSQL-MYSQL:MYSQL-DATABASE {48391DCD}>
(database-name *default-database*)
=> "dent/newesim/dent"
(database-name-from-spec '(nil "template1" "dent" nil) :postgresql)
=> "/template1/dent"
(connect '(nil "template1" "dent" nil) :database-type :postgresql)
=> #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {48392D2D}>
(database-name *default-database*)
=> "/template1/dent"
(database-name-from-spec '("www.pmsf.de" "template1" "dent" nil) :postgresql)
=> "www.pmsf.de/template1/dent"
(find-database "dent/newesim/dent")
=> #<CLSQL-MYSQL:MYSQL-DATABASE {484E91C5}>
(find-database "/template1/dent")
=> #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {48392D2D}>
(find-database "www.pmsf.de/template1/dent" nil)
=> NIL
(find-database **)
=> #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {48392D2D}>
</pre></div><div class="refsect1"><a id="idp61663920"></a><h2>Side Effects</h2><p>None.</p></div><div class="refsect1"><a id="idp61665072"></a><h2>Affected By</h2><p>
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="link" href="connected-databases.html" title="CONNECTED-DATABASES"><code class="function">connected-databases</code></a></td></tr></table><p>
</p></div><div class="refsect1"><a id="idp61667968"></a><h2>Exceptional Situations</h2><p>Will signal an error of type
<span class="errortype">clsql-error</span> if no matching database
can be found, and <em class="parameter"><code>errorp</code></em> is true.
Will signal an error if the value of
<em class="parameter"><code>database</code></em> is neither an object of type
<span class="type">database</span> nor a string.</p></div><div class="refsect1"><a id="idp61671136"></a><h2>See Also</h2><p>
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="link" href="database-name.html" title="DATABASE-NAME"><code class="function">database-name</code></a></td></tr><tr><td><a class="link" href="database-name-from-spec.html" title="DATABASE-NAME-FROM-SPEC"><code class="function">database-name-from-spec</code></a></td></tr><tr><td><a class="link" href="disconnect.html" title="DISCONNECT"><code class="function">disconnect</code></a></td></tr><tr><td><a class="link" href="connect.html" title="CONNECT"><code class="function">connect</code></a></td></tr><tr><td><a class="link" href="status.html" title="STATUS"><code class="function">status</code></a></td></tr><tr><td><a class="link" href="connected-databases.html" title="CONNECTED-DATABASES"><code class="function">connected-databases</code></a></td></tr></table><p>
</p></div><div class="refsect1"><a id="idp61679632"></a><h2>Notes</h2><p>The <em class="parameter"><code>db-type</code></em> keyword argument to
<code class="function">find-database</code> is a <span class="application"><span class="emphasis"><em>CLSQL</em></span></span>
extension. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="disconnect-pooled.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref-connect.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="initialize-database-type.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">DISCONNECT-POOLED </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> INITIALIZE-DATABASE-TYPE</td></tr></table></div></body></html>
|