r10285: * doc/*.xml: Fix spelling of Vladimir
[clsql.git] / doc / ref-fdml.xml
index ca725bdd492e25973f4169adadabcb56f9f57bd1..c512cdb020f9d0829e16bfe5396a1d7a26f52e51 100644 (file)
     <refnamediv>
       <refname>CACHE-TABLE-QUERIES</refname>
       <refpurpose>Control the caching of table attribute types.</refpurpose>
+      <refclass>Function</refclass>
     </refnamediv>
     <refsect1>
       <title>Syntax</title>
+      <synopsis>
+      <function>cache-table-queries</function> <replaceable>table</replaceable> &amp;key <replaceable>action</replaceable> <replaceable>database</replaceable> => <returnvalue></returnvalue></synopsis>
+    </refsect1>
+    <refsect1>
+      <title>Arguments and Values</title>
+      <variablelist>
+        <varlistentry>
+          <term><parameter>table</parameter></term>
+          <listitem>
+            <para>
+              A string representing a database table, &t; or
+              <symbol>:default</symbol>.
+            </para> 
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><parameter>action</parameter></term>
+          <listitem>
+            <para>
+              &t;, &nil; or <symbol>:flush</symbol>. 
+            </para> 
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><parameter>database</parameter></term>
+          <listitem>
+            <para>A 
+            <glossterm linkend="gloss-database-object">database
+            object</glossterm>. This will default to the value
+            of <symbol>*default-database*</symbol>.</para>
+          </listitem>
+      </varlistentry>
+      </variablelist>
+    </refsect1>
+    <refsect1>
+      <title>Description</title>
+      <para>Controls the caching of attribute type information on the
+      table specified by <parameter>table</parameter> in
+      <parameter>database</parameter> which defaults to
+      <symbol>*default-database*</symbol>. <parameter>action</parameter>
+      specifies the caching behaviour to adopt. If its value is &t;
+      then attribute type information is cached whereas if its value
+      is &nil; then attribute type information is not cached. If
+      <parameter>action</parameter> is <symbol>:flush</symbol> then
+      all existing type information in the cache for
+      <parameter>table</parameter> is removed, but caching is still
+      enabled. <parameter>table</parameter> may be a string
+      representing a table for which the caching action is to be taken
+      while the caching action is applied to all tables if
+      <parameter>table</parameter> is &t;. Alternatively, when
+      <parameter>table</parameter> is <symbol>:default</symbol>, the
+      default caching action specified by
+      <symbol>*cache-table-queries-default*</symbol> is applied to all
+      tables for which a caching action has not been explicitly set.
+      </para>
+    </refsect1>
+    <refsect1>
+      <title>Examples</title>
+      <screen>
+(setf *cache-table-queries-default* t)
+=> T
+(create-table [foo]
+              '(([id] integer)
+                ([height] float)
+                ([name] (string 24))
+                ([comments] varchar)))
+=> 
+(cache-table-queries "foo")
+=> 
+(list-attribute-types "foo")
+=> (("id" :INT4 4 NIL 1) ("height" :FLOAT8 8 NIL 1) ("name" :BPCHAR 24 NIL 1)
+    ("comments" :VARCHAR 255 NIL 1))
+(drop-table "foo")
+=> 
+(create-table [foo]
+              '(([id] integer)
+                ([height] float)
+                ([name] (string 36))
+                ([comments] (string 100))))
+=> 
+(cache-table-queries "foo" :action :flush)
+=> 
+(list-attribute-types "foo")
+=> (("id" :INT4 4 NIL 1) ("height" :FLOAT8 8 NIL 1) ("name" :BPCHAR 36 NIL 1)
+    ("comments" :BPCHAR 100 NIL 1))
+      </screen>
+    </refsect1>
+    <refsect1>
+      <title>Side Effects</title>
+       <para>
+        The internal attribute cache for
+        <parameter>database</parameter> is modified.
+       </para>
+     </refsect1>
+    <refsect1>
+      <title>Affected by</title>
+      <simplelist>
+        <member><link linkend="cache-table-queries-default"><symbol>*cache-table-queries-default*</symbol></link></member>
+      </simplelist>
+    </refsect1>
+    <refsect1>
+      <title>Exceptional Situations</title>
       <para>
+        None. 
+      </para>
+    </refsect1>
+    <refsect1>
+      <title>See Also</title>
+      <simplelist>
+        <member><link linkend="cache-table-queries-default"><symbol>*cache-table-queries-default*</symbol></link></member>
+      </simplelist>
+    </refsect1>
+    <refsect1>
+      <title>Notes</title>
+      <para>
+        None. 
       </para>
     </refsect1>
   </refentry>
         :from [employee]
         :where [= [emplid] 1] 
         :field-names nil)
-=> (("Vladamir" "Lenin" "lenin@soviet.org"))
+=> (("Vladimir" "Lenin" "lenin@soviet.org"))
 (update-records [employee] 
                 :av-pairs'((first_name "Yuri")
                            (last_name "Gagarin")
       <title>Examples</title>
       <screen>
 (query "select emplid,first_name,last_name,height from employee where emplid = 1")
-=> ((1 "Vladamir" "Lenin" 1.5564661d0)), 
+=> ((1 "Vladimir" "Lenin" 1.5564661d0)), 
    ("emplid" "first_name" "last_name" "height")
 
 (query "select emplid,first_name,last_name,height from employee where emplid = 1" 
        :field-names nil)
-=> ((1 "Vladamir" "Lenin" 1.5564661d0))
+=> ((1 "Vladimir" "Lenin" 1.5564661d0))
 
 (query "select emplid,first_name,last_name,height from employee where emplid = 1" 
        :field-names nil
        :result-types nil)
-=> (("1" "Vladamir" "Lenin" "1.5564661"))
+=> (("1" "Vladimir" "Lenin" "1.5564661"))
 
 (query "select emplid,first_name,last_name,height from employee where emplid = 1" 
        :field-names nil
        :result-types '(:int t t :double))
-=> ((1 "Vladamir" "Lenin" 1.5564661))
+=> ((1 "Vladimir" "Lenin" 1.5564661))
 
 (query "select last_name from employee where emplid > 5" :flatp t)
 => ("Andropov" "Chernenko" "Gorbachev" "Yeltsin" "Putin"), 
                      :where [&lt; [emplid] 5]] 
               :titles '("ID" "FORENAME" "SURNAME" "EMAIL"))
 ID FORENAME SURNAME  EMAIL               
-1  Vladamir Lenin    lenin@soviet.org    
+1  Vladimir Lenin    lenin@soviet.org    
 2  Josef    Stalin   stalin@soviet.org   
 3  Leon     Trotsky  trotsky@soviet.org  
 4  Nikita   Kruschev kruschev@soviet.org 
@@ -963,7 +1079,7 @@ ID FORENAME   SURNAME   EMAIL
 7  Konstantin Chernenko chernenko@soviet.org 
 8  Mikhail    Gorbachev gorbachev@soviet.org 
 9  Boris      Yeltsin   yeltsin@soviet.org   
-10 Vladamir   Putin     putin@soviet.org     
+10 Vladimir   Putin     putin@soviet.org     
 => 
 </screen>
     </refsect1>
@@ -1017,7 +1133,7 @@ ID FORENAME   SURNAME   EMAIL
     <refsect1>
       <title>Syntax</title>
       <synopsis>
-      <function>select</function> &amp;rest <replaceable>identifiers</replaceable> &amp;key <replaceable>all</replaceable> <replaceable>distinct</replaceable> <replaceable>from</replaceable> <replaceable>group-by</replaceable> <replaceable>having</replaceable> <replaceable>order-by</replaceable> <replaceable>set-operation</replaceable> <replaceable>where</replaceable> <replaceable>result-types</replaceable> <replaceable>field-names</replaceable> <replaceable>flatp</replaceable> <replaceable>refresh</replaceable> <replaceable>database</replaceable> => <returnvalue>result</returnvalue></synopsis>
+      <function>select</function> &amp;rest <replaceable>identifiers</replaceable> &amp;key <replaceable>all</replaceable> <replaceable>distinct</replaceable> <replaceable>from</replaceable> <replaceable>group-by</replaceable> <replaceable>having</replaceable> <replaceable>order-by</replaceable> <replaceable>set-operation</replaceable> <replaceable>where</replaceable> <replaceable>result-types</replaceable> <replaceable>field-names</replaceable> <replaceable>flatp</replaceable> <replaceable>refresh</replaceable> <replaceable>caching</replaceable> <replaceable>database</replaceable> => <returnvalue>result</returnvalue></synopsis>
     </refsect1>
     <refsect1>
       <title>Arguments and Values</title>
@@ -1164,6 +1280,35 @@ ID FORENAME   SURNAME   EMAIL
           </para>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term><parameter>refresh</parameter></term>
+          <listitem> 
+          <para>
+            This value is only considered when CLOS objects are being
+            selected. A boolean with a default value of &nil;. When
+            the value of the <varname>caching</varname> keyword is
+            &t;, a second equivalent <function>select</function> call
+            will return the same view class instance objects. When
+            <varname>refresh</varname> is &t;, then slots of the
+            existing instances are updated as necessary. In such
+            cases, you may wish to override the hook
+            <function>instance-refresh</function>.
+          </para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><parameter>caching</parameter></term>
+          <listitem> 
+          <para>
+            This value is only considered when CLOS objects are being
+            selected.  A boolean with a default value of
+            <varname>*default-caching*</varname>. &clsql; caches
+            objects in accordance with the &commonsql; interface: a
+            second equivalent <function>select</function> call will
+            return the same view class instance objects.
+          </para>
+          </listitem>
+        </varlistentry>
         <varlistentry>
           <term><parameter>result</parameter></term>
           <listitem>
@@ -1252,7 +1397,7 @@ ID FORENAME   SURNAME   EMAIL
                      :field-names nil 
                      :result-types nil 
                      :order-by [first-name])
-=> ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir"
+=> ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladimir"
     "Yuri")
 
 (select [first-name] [count [*]] :from [employee]
@@ -1261,7 +1406,7 @@ ID FORENAME   SURNAME   EMAIL
                                 :order-by [first-name]
                                 :field-names nil)
 => (("Boris" "1") ("Josef" "1") ("Konstantin" "1") ("Leon" "1") ("Leonid" "1")
-    ("Mikhail" "1") ("Nikita" "1") ("Vladamir" "2") ("Yuri" "1"))
+    ("Mikhail" "1") ("Nikita" "1") ("Vladimir" "2") ("Yuri" "1"))
 
 (select [last-name] :from [employee] 
                     :where [like [email] "%org"]
@@ -1309,7 +1454,7 @@ ID FORENAME   SURNAME   EMAIL
         :order-by '(([first-name] :asc) ([last-name] :desc)))
 => (("Boris" "Yeltsin") ("Josef" "Stalin") ("Konstantin" "Chernenko")
     ("Leon" "Trotsky") ("Leonid" "Brezhnev") ("Mikhail" "Gorbachev")
-    ("Nikita" "Kruschev") ("Vladamir" "Putin") ("Vladamir" "Lenin")
+    ("Nikita" "Kruschev") ("Vladimir" "Putin") ("Vladimir" "Lenin")
     ("Yuri" "Andropov"))
 
 (select [last-name] :from [employee]                   
@@ -1320,7 +1465,7 @@ ID FORENAME   SURNAME   EMAIL
                  :field-names nil)
 => ("Andropov" "Boris" "Brezhnev" "Chernenko" "Gorbachev" "Josef" "Konstantin"
     "Kruschev" "Lenin" "Leon" "Leonid" "Mikhail" "Nikita" "Putin" "Stalin"
-    "Trotsky" "Vladamir" "Yeltsin" "Yuri")
+    "Trotsky" "Vladimir" "Yeltsin" "Yuri")
       </screen>
     </refsect1>
     <refsect1>
@@ -1680,7 +1825,7 @@ ID FORENAME   SURNAME   EMAIL
                 :order-by [last-name]]
       collect (concatenate 'string forename " " surname))
 => ("Yuri Andropov" "Leonid Brezhnev" "Konstantin Chernenko" "Mikhail Gorbachev"
-    "Nikita Kruschev" "Vladamir Lenin" "Vladamir Putin" "Josef Stalin"
+    "Nikita Kruschev" "Vladimir Lenin" "Vladimir Putin" "Josef Stalin"
     "Leon Trotsky" "Boris Yeltsin")
 
 (loop for (e) being the records in 
@@ -1888,8 +2033,8 @@ ID FORENAME   SURNAME   EMAIL
            [select [first-name] [last-name] :from [employee] 
                    :order-by [last-name]])
 => (("Yuri" "Andropov") ("Leonid" "Brezhnev") ("Konstantin" "Chernenko")
-    ("Mikhail" "Gorbachev") ("Nikita" "Kruschev") ("Vladamir" "Lenin")
-    ("Vladamir" "Putin") ("Josef" "Stalin") ("Leon" "Trotsky") 
+    ("Mikhail" "Gorbachev") ("Nikita" "Kruschev") ("Vladimir" "Lenin")
+    ("Vladimir" "Putin") ("Josef" "Stalin") ("Leon" "Trotsky") 
     ("Boris" "Yeltsin"))
 
 (map-query 'list #'last-name [select 'employee :order-by [emplid]])