12 {0:4}}CLSQL\endNode{}\endNode{} Users' Guide\endNode{}\Node%
18 {0:7}}Kevin\endNode{}\Node%
20 {0:8}}M.\endNode{}\Node%
22 {0:9}}Rosenberg\endNode{}\Node%
26 {0:11}}Maintainer of CLSQL\endNode{}\endNode{}\endNode{}\Node%
30 {0:13}}Pierre\endNode{}\Node%
32 {0:14}}R.\endNode{}\Node%
34 {0:15}}Mai\endNode{}\Node%
38 {0:17}}Author of Original MaiSQL Code\endNode{}\endNode{}\endNode{}\endNode{}\Node%
42 {0:19}}\$Date: 2002/04/23 21:30:27 $\endNode{}\Node%
44 {0:20}}\$Id: docbook.tex,v 1.1 2002/04/23 21:30:27 kevin Exp $\endNode{}\endNode{}\Node%
56 {0:26}}CLSQL\endNode{}\endNode{} is Copyright \Entity{copy} 2002 by Kevin M. Rosenberg and
57 Copyright \Entity{copy} 1999-\/2001 by Pierre R. Mai.\endNode{}\endNode{}\Node%
63 {0:29}}Allegro CL\endNode{}\Entity{reg} is a registered
64 trademark of Franz Inc.\endNode{}\endNode{}\Node%
70 {0:32}}Common SQL\endNode{},
73 {0:33}}LispWorks\endNode{} and
76 {0:34}}Xanalys\endNode{} are trademarks or
77 registered trademarks of Xanalys Inc.\endNode{}\endNode{}\Node%
84 Windows\endNode{}\Entity{reg} is a registered trademark of
85 Microsoft Inc.\endNode{}\endNode{}\Node%
90 product names are the registered trademarks or trademarks of
91 their respective holders.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
95 {0:41}}Preface\endNode{}\Node%
97 {0:42}}This guide provides reference
98 to the features of \Node%
102 {0:44}}CLSQL\endNode{}\endNode{}. The first
103 chapter provides an introduction to \Node%
107 {0:46}}CLSQL\endNode{}\endNode{} and installation
109 Following that chapter is the reference section for all user
110 accessible symbols of \Node%
114 {0:48}}CLSQL\endNode{}\endNode{} with examples of usage,
115 followed by the reference section for all accessible symbols of
116 the database back-\/end interface. At the end there you will find
117 a glossary of commonly used terms with their
118 definitions.\endNode{}\endNode{}\Node%
122 {0:50}}Introduction\endNode{}\Node%
126 {0:52}}Purpose\endNode{}\Node%
132 {0:55}}CLSQL\endNode{}\endNode{} is a Common Lisp interface to \Node%
134 {0:56}}SQL\endNode{} databases. A number of Common
135 Lisp implementations and SQL databases are supported.The general
140 {0:58}}CLSQL\endNode{}\endNode{} is based on the
143 {0:59}}CommonSQL\endNode{} package by Xanalys.\endNode{}\endNode{}\Node%
147 {0:61}}History\endNode{}\Node%
153 {0:64}}CLSQL\endNode{}\endNode{} is written by Kevin M. Rosenberg and based substantially
154 on Pierre R. Mai's excellent \Node%
158 {0:66}}MaiSQL\endNode{}\endNode{} package. The main changes from \Node%
162 {0:68}}MaiSQL\endNode{}\endNode{}
170 {0:71}}port from the \Node%
172 {0:72}}CMUCL\endNode{} FFI to \Node%
176 {0:74}}UFFI\endNode{}\endNode{}.\endNode{}\endNode{}\Node%
182 {0:77}}AllegroCL\endNode{} ODBC interface back-\/end.\endNode{}\endNode{}\Node%
186 {0:79}}compatibility layer for \Node%
188 {0:80}}CMUCL\endNode{} specific code.\endNode{}\endNode{}\Node%
192 {0:82}}much improved robustness for the \Node%
194 {0:83}}MySQL\endNode{} back-\/end.\endNode{}\endNode{}\Node%
198 {0:85}}improved system loading.\endNode{}\endNode{}\Node%
202 {0:87}}improved packages and symbol export.\endNode{}\endNode{}\endNode{}
203 \endNode{}\endNode{}\Node%
207 {0:89}}Prerequisites\endNode{}\Node%
213 {0:92}}Defsystem\endNode{}\endNode{}\Node%
219 {0:95}}CLSQL\endNode{}\endNode{} uses \Node%
221 {0:96}}Defsystem\endNode{} to compile and load its
224 {0:97}}Defsystem\endNode{} is included in the \Node%
232 {0:101}}CLOCC\endNode{}\endNode{}\endNode{}\endNode{} collection. The
233 version in the pre-\/packaged distribution is rather old and
234 may not function well. The version in CVS tree tree works quite
235 well. For convenience, a copy of the latest \Node%
237 {0:102}}Defsystem\endNode{} at the FTP
242 {0:104}}site\endNode{}\endNode{}
247 {0:106}}CLSQL\endNode{}\endNode{}.
248 \endNode{}\endNode{}\Node%
256 {0:110}}UFFI\endNode{}\endNode{}\endNode{}\Node%
262 {0:113}}CLSQL\endNode{}\endNode{} uses \Node%
270 {0:117}}UFFI\endNode{}\endNode{}\endNode{}\endNode{}
273 {0:118}}Foreign Function Interface\endNode{} (\Node%
275 {0:119}}FFI\endNode{}) to support multiple \Node%
277 {0:120}}ANSI Common Lisp\endNode{}
278 implementations.\endNode{}\Node%
280 {0:121}}You can download \Node%
284 {0:123}}UFFI\endNode{}\endNode{} from its FTP \Node%
288 {0:125}}site\endNode{}\endNode{}. There
289 are zip files for Microsoft Windows systems and gzipped tar files for
290 other systems.\endNode{}\endNode{}\Node%
294 {0:127}}Supported Common Lisp Implementation\endNode{}\Node%
296 {0:128}}The implementations that support \Node%
300 {0:130}}CLSQL\endNode{}\endNode{} is governed by the supported
301 implementations of \Node%
305 {0:132}}UFFI\endNode{}\endNode{}. The following implementations are supported:
314 {0:136}}AllegroCL\endNode{} v6.1 on Redhat Linux 7.2, FreeBSD 4.5, and Microsoft Windows XP.\endNode{}\endNode{}\Node%
320 {0:139}}Lispworks\endNode{} v4.2 on Redhat Linux 7.2 and Microsoft Windows XP.\endNode{}\endNode{}\Node%
326 {0:142}}CMUCL\endNode{} 18d-\/pre on Redhat Linux 7.2, FreeBSD 4.5, and Solaris 2.8.\endNode{}\endNode{}\endNode{}\endNode{}\Node%
330 {0:144}}Supported \Node%
332 {0:145}}SQL\endNode{} Implementation\endNode{}\Node%
334 {0:146}} Currently, \Node%
338 {0:148}}CLSQL\endNode{}\endNode{} supports the following databases:
347 {0:152}}MySQL\endNode{} v3.23.49.\endNode{}\endNode{}\Node%
353 {0:155}}PostgreSQL\endNode{} v7.2 with both direct API and TCP socket connections.\endNode{}\endNode{}\Node%
357 {0:157}}Allegro's ODBC interface (\Node%
359 {0:158}}AODBC\endNode{}) using iODBC ODBC manager.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
363 {0:160}}Installation\endNode{}\Node%
367 {0:162}}Ensure \Node%
369 {0:163}}Defsystem\endNode{} is loaded\endNode{}\Node%
371 {0:164}} Simply load the file \Node%
373 {0:165}}defsystem.lisp\endNode{}.
376 {0:166}}(load "defsystem.lisp")
378 \endNode{}\endNode{}\Node%
384 {0:169}}C\endNode{} helper libraries\endNode{}\Node%
390 {0:172}}CLSQL\endNode{}\endNode{} uses functions that require 64-\/bit integer
391 parameters and return values. The \Node%
393 {0:173}}FFI\endNode{} in most \Node%
397 {0:175}}CLSQL\endNode{}\endNode{}
398 implementations do not support 64-\/bit integers. Thus, C helper
399 libraries are required to break these 64-\/bit integers into two compatible
400 32-\/bit integers.\endNode{}\Node%
402 {0:176}}Makefiles for Microsoft Windows and GNU/Solaris systems
403 are supplied to build the libraries. Since many Microsoft Windows
404 users don't have access to a compiler, the \Node%
406 {0:177}}DLL\endNode{} and \Node%
408 {0:178}}LIB\endNode{}
409 files for Microsoft Windows are supplied with the distribution.\endNode{}\Node%
411 {0:179}}To build the libraries on a GNU or Solaris, use the shell and
412 change to the root directory of \Node%
416 {0:181}}CLSQL\endNode{}\endNode{}. You may need to edit the file
419 {0:182}}interfaces/mysql/Makefile\endNode{} to specify the location of your
420 MySQL installation. The default Makefiles are setup for shared library
421 linking on Linux. If you are using FreeBSD or Solaris, you will need
422 to change the linker setting as instructed in the Makefile.
423 Then, you can give the command
426 {0:183}}make libs\endNode{}
427 in the root directory of \Node%
431 {0:185}}CLSQL\endNode{}\endNode{} to build the libraries
434 {0:186}}interfaces/mysql/clsql-\/mysql.so\endNode{} and
437 {0:187}}interfaces/clsql-\/uffi/clsql-\/uffi.so\endNode{}.\endNode{}\endNode{}\Node%
445 {0:191}}UFFI\endNode{}\endNode{}\endNode{}\Node%
447 {0:192}} Unzip or untar the \Node%
451 {0:194}}UFFI\endNode{}\endNode{} distribution which creates a directory
456 {0:196}}UFFI\endNode{}\endNode{} files. Add that directory to Defsystem's \Node%
458 {0:197}}mk:*central-\/registry*\endNode{}.
459 You can do that by either pushing the pathname of the directory onto this variable, or
462 {0:198}}add-\/registry-\/location\endNode{} present in the newest versions of
465 {0:199}}Defsystem\endNode{}. The following example code assumes the \Node%
469 {0:201}}UFFI\endNode{}\endNode{} files reside in the
472 {0:202}}/usr/local/src/lisp/uffi\endNode{} directory.
475 {0:203}}(mk:add-\/registry-\/location \#P"/usr/local/src/lisp/uffi")
476 (mk:load-\/system :uffi)
478 \endNode{}\endNode{}\Node%
486 {0:207}}CLSQL\endNode{}\endNode{} modules\endNode{}\Node%
488 {0:208}} Unzip or untar the \Node%
492 {0:210}}CLSQL\endNode{}\endNode{} distribution which creates a directory
497 {0:212}}CLSQL\endNode{}\endNode{} files. Add that directory to Defsystem's \Node%
499 {0:213}}mk:*central-\/registry*\endNode{}.
500 You can do that by either pushing the pathname of the directory onto this variable, or
503 {0:214}}add-\/registry-\/location\endNode{} present in the newest versions of
506 {0:215}}Defsystem\endNode{}. The following example code assumes the \Node%
510 {0:217}}CLSQL\endNode{}\endNode{} files reside in the
513 {0:218}}/usr/local/src/lisp/clsql\endNode{} directory. You need to load, at a minimum,
516 {0:219}}:clsql\endNode{} system and at least one interface system.
519 {0:220}}(mk:add-\/registry-\/location \#P"/usr/local/src/lisp/clsql")
520 (mk:load-\/system :clsql) ; main clsql package
521 (mk:load-\/system :clsql-\/mysql) ; MySQL interface
522 (mk:load-\/system :clsql-\/postgresql) ; PostgreSQL interface
523 (mk:load-\/system :clsql-\/postgresql-\/socket) ; Socket PGSQL interface
524 (mk:load-\/system :clsql-\/aodbc) ; Allegro ODBC interface
526 \endNode{}\endNode{}\Node%
530 {0:222}}Run test suite\endNode{}\Node%
532 {0:223}} After loading \Node%
536 {0:225}}CLSQL\endNode{}\endNode{}, you can execute the test program in
539 {0:226}}./test-\/suite\endNode{}. The test file,
542 {0:227}}tester-\/clsql\endNode{}
543 has instructions for creating a \Node%
545 {0:228}}test.config\endNode{}.
546 After creating that file, simple load the test file with Lisp
547 and the tests should automatically execute.
548 \endNode{}\endNode{}\endNode{}\endNode{}\Node%
554 {0:231}}CLSQL\endNode{}\endNode{}\Node%
558 {0:233}}This part gives a reference to all the symbols exported
559 from the package \Node%
561 {0:234}}CLSQL-\/SYS\endNode{}, which are also
562 re-\/exported from the package \Node%
564 {0:235}}CLSQL\endNode{}. These
565 symbols constitute the normal user-\/interface of
570 {0:237}}CLSQL\endNode{}\endNode{}.\endNode{}\endNode{}\Node%
572 {0:MAISQL-CONDITION}}\Node%
576 {0:240}}CLSQL-\/CONDITION\endNode{}\Node%
578 {0:241}}the super-\/type of all
583 {0:243}}CLSQL\endNode{}\endNode{}-\/specific
584 conditions\endNode{}\Node%
586 {0:244}}Condition Type\endNode{}\endNode{}\Node%
590 {0:246}}Class Precedence List\endNode{}\Node%
598 {0:250}}maisql-\/condition\endNode{}\endNode{}\Node%
602 {0:252}}condition\endNode{}\endNode{}\Node%
606 {0:254}}t\endNode{}\endNode{}\endNode{}
607 \endNode{}\endNode{}\Node%
611 {0:256}}Description\endNode{}\Node%
613 {0:257}}This is the super-\/type of all
618 {0:259}}CLSQL\endNode{}\endNode{}-\/specific conditions
623 {0:261}}CLSQL\endNode{}\endNode{}, or any of it's
624 database-\/specific interfaces. There are no defined
625 initialization arguments nor any accessors.\endNode{}\endNode{}\endNode{}\Node%
627 {0:MAISQL-ERROR}}\Node%
631 {0:264}}CLSQL-\/ERROR\endNode{}\Node%
633 {0:265}}the super-\/type of all
638 {0:267}}CLSQL\endNode{}\endNode{}-\/specific
639 errors\endNode{}\Node%
641 {0:268}}Condition Type\endNode{}\endNode{}\Node%
645 {0:270}}Class Precedence List\endNode{}\Node%
653 {0:274}}maisql-\/error\endNode{}\endNode{}\Node%
657 {0:276}}error\endNode{}\endNode{}\Node%
661 {0:278}}serious-\/condition\endNode{}\endNode{}\Node%
665 {0:280}}maisql-\/condition\endNode{}\endNode{}\Node%
669 {0:282}}condition\endNode{}\endNode{}\Node%
673 {0:284}}t\endNode{}\endNode{}\endNode{}
674 \endNode{}\endNode{}\Node%
678 {0:286}}Description\endNode{}\Node%
680 {0:287}}This is the super-\/type of all
685 {0:289}}CLSQL\endNode{}\endNode{}-\/specific conditions that
686 represent errors, as defined by
691 {0:291}}CLSQL\endNode{}\endNode{}, or any of it's
692 database-\/specific interfaces. There are no defined
693 initialization arguments nor any accessors.\endNode{}\endNode{}\endNode{}\Node%
695 {0:MAISQL-SIMPLE-ERROR}}\Node%
699 {0:294}}CLSQL-\/SIMPLE-\/ERROR\endNode{}\Node%
701 {0:295}}Unspecific simple
706 {0:297}}CLSQL\endNode{}\endNode{} errors\endNode{}\Node%
708 {0:298}}Condition Type\endNode{}\endNode{}\Node%
712 {0:300}}Class Precedence List\endNode{}\Node%
720 {0:304}}maisql-\/simple-\/error\endNode{}\endNode{}\Node%
724 {0:306}}simple-\/condition\endNode{}\endNode{}\Node%
728 {0:308}}maisql-\/error\endNode{}\endNode{}\Node%
732 {0:310}}error\endNode{}\endNode{}\Node%
736 {0:312}}serious-\/condition\endNode{}\endNode{}\Node%
740 {0:314}}maisql-\/condition\endNode{}\endNode{}\Node%
744 {0:316}}condition\endNode{}\endNode{}\Node%
748 {0:318}}t\endNode{}\endNode{}\endNode{}
749 \endNode{}\endNode{}\Node%
753 {0:320}}Description\endNode{}\Node%
755 {0:321}}This condition is used in all instances of errors, where
756 there exists no \Node%
760 {0:323}}CLSQL\endNode{}\endNode{}-\/specific
761 condition that is more specific. The valid initialization
762 arguments and accessors are the same as for
765 {0:324}}simple-\/condition\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
767 {0:MAISQL-WARNING}}\Node%
771 {0:327}}CLSQL-\/WARNING\endNode{}\Node%
773 {0:328}}the super-\/type of all
778 {0:330}}CLSQL\endNode{}\endNode{}-\/specific
779 warnings\endNode{}\Node%
781 {0:331}}Condition Type\endNode{}\endNode{}\Node%
785 {0:333}}Class Precedence List\endNode{}\Node%
793 {0:337}}maisql-\/warning\endNode{}\endNode{}\Node%
797 {0:339}}warning\endNode{}\endNode{}\Node%
801 {0:341}}maisql-\/condition\endNode{}\endNode{}\Node%
805 {0:343}}condition\endNode{}\endNode{}\Node%
809 {0:345}}t\endNode{}\endNode{}\endNode{}
810 \endNode{}\endNode{}\Node%
814 {0:347}}Description\endNode{}\Node%
816 {0:348}}This is the super-\/type of all
821 {0:350}}CLSQL\endNode{}\endNode{}-\/specific conditions that
822 represent warnings, as defined by
827 {0:352}}CLSQL\endNode{}\endNode{}, or any of it's
828 database-\/specific interfaces. There are no defined
829 initialization arguments nor any accessors.\endNode{}\endNode{}\endNode{}\Node%
831 {0:MAISQL-SIMPLE-WARNING}}\Node%
835 {0:355}}CLSQL-\/SIMPLE-\/WARNING\endNode{}\Node%
837 {0:356}}Unspecific simple
842 {0:358}}CLSQL\endNode{}\endNode{} warnings\endNode{}\Node%
844 {0:359}}Condition Type\endNode{}\endNode{}\Node%
848 {0:361}}Class Precedence List\endNode{}\Node%
856 {0:365}}maisql-\/simple-\/warning\endNode{}\endNode{}\Node%
860 {0:367}}simple-\/condition\endNode{}\endNode{}\Node%
864 {0:369}}maisql-\/warning\endNode{}\endNode{}\Node%
868 {0:371}}warning\endNode{}\endNode{}\Node%
872 {0:373}}maisql-\/condition\endNode{}\endNode{}\Node%
876 {0:375}}condition\endNode{}\endNode{}\Node%
880 {0:377}}t\endNode{}\endNode{}\endNode{}
881 \endNode{}\endNode{}\Node%
885 {0:379}}Description\endNode{}\Node%
887 {0:380}}This condition is used in all instances of warnings,
888 where there exists no
893 {0:382}}CLSQL\endNode{}\endNode{}-\/specific condition that is
894 more specific. The valid initialization arguments and
895 accessors are the same as for
898 {0:383}}simple-\/condition\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
900 {0:MAISQL-INVALID-SPEC-ERROR}}\Node%
904 {0:386}}CLSQL-\/INVALID-\/SPEC-\/ERROR\endNode{}\Node%
906 {0:387}}condition representing errors because of invalid
907 connection specifications\endNode{}\Node%
909 {0:388}}Condition Type\endNode{}\endNode{}\Node%
913 {0:390}}Class Precedence List\endNode{}\Node%
921 {0:394}}maisql-\/invalid-\/spec-\/error\endNode{}\endNode{}\Node%
925 {0:396}}maisql-\/error\endNode{}\endNode{}\Node%
929 {0:398}}error\endNode{}\endNode{}\Node%
933 {0:400}}serious-\/condition\endNode{}\endNode{}\Node%
937 {0:402}}maisql-\/condition\endNode{}\endNode{}\Node%
941 {0:404}}condition\endNode{}\endNode{}\Node%
945 {0:406}}t\endNode{}\endNode{}\endNode{}
946 \endNode{}\endNode{}\Node%
950 {0:408}}Description\endNode{}\Node%
952 {0:409}}This condition represents errors that occur because the
953 user supplies an invalid connection specification to either
956 {0:410}}database-\/name-\/from-\/spec\endNode{} or
959 {0:411}}connect\endNode{}. The following initialization
960 arguments and accessors exist:\endNode{}\Node%
964 {0:413}}Initarg\endNode{}\Node%
966 {0:414}}Accessor\endNode{}\Node%
968 {0:415}}Description\endNode{}\Node%
974 {0:418}}:connection-\/spec\endNode{}\endNode{}\Node%
978 {0:420}}maisql-\/invalid-\/spec-\/error-\/connection-\/spec\endNode{}\endNode{}\Node%
980 {0:421}}The invalid connection specification used.\endNode{}\endNode{}\Node%
986 {0:424}}:database-\/type\endNode{}\endNode{}\Node%
990 {0:426}}maisql-\/invalid-\/spec-\/error-\/database-\/type\endNode{}\endNode{}\Node%
992 {0:427}}The Database type used in the attempt.\endNode{}\endNode{}\Node%
998 {0:430}}:template\endNode{}\endNode{}\Node%
1002 {0:432}}maisql-\/invalid-\/spec-\/error-\/template\endNode{}\endNode{}\Node%
1004 {0:433}}An argument describing the template that a valid
1005 connection specification must match for this database type.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
1007 {0:MAISQL-CONNECT-ERROR}}\Node%
1011 {0:436}}CLSQL-\/CONNECT-\/ERROR\endNode{}\Node%
1013 {0:437}}condition representing errors during
1014 connection\endNode{}\Node%
1016 {0:438}}Condition Type\endNode{}\endNode{}\Node%
1020 {0:440}}Class Precedence List\endNode{}\Node%
1028 {0:444}}maisql-\/connect-\/error\endNode{}\endNode{}\Node%
1032 {0:446}}maisql-\/error\endNode{}\endNode{}\Node%
1036 {0:448}}error\endNode{}\endNode{}\Node%
1040 {0:450}}serious-\/condition\endNode{}\endNode{}\Node%
1044 {0:452}}maisql-\/condition\endNode{}\endNode{}\Node%
1048 {0:454}}condition\endNode{}\endNode{}\Node%
1052 {0:456}}t\endNode{}\endNode{}\endNode{}
1053 \endNode{}\endNode{}\Node%
1057 {0:458}}Description\endNode{}\Node%
1059 {0:459}}This condition represents errors that occur while trying
1060 to connect to a database. The following initialization
1061 arguments and accessors exist:\endNode{}\Node%
1065 {0:461}}Initarg\endNode{}\Node%
1067 {0:462}}Accessor\endNode{}\Node%
1069 {0:463}}Description\endNode{}\Node%
1075 {0:466}}:database-\/type\endNode{}\endNode{}\Node%
1079 {0:468}}maisql-\/connect-\/error-\/database-\/type\endNode{}\endNode{}\Node%
1081 {0:469}}Database type for the connection attempt\endNode{}\endNode{}\Node%
1087 {0:472}}:connection-\/spec\endNode{}\endNode{}\Node%
1091 {0:474}}maisql-\/connect-\/error-\/connection-\/spec\endNode{}\endNode{}\Node%
1093 {0:475}}The connection specification used in the
1094 connection attempt.\endNode{}\endNode{}\Node%
1100 {0:478}}:errno\endNode{}\endNode{}\Node%
1104 {0:480}}maisql-\/connect-\/error-\/errno\endNode{}\endNode{}\Node%
1106 {0:481}}The numeric or symbolic error specification
1107 returned by the database back-\/end. The values and
1108 semantics of this are interface specific.\endNode{}\endNode{}\Node%
1114 {0:484}}:error\endNode{}\endNode{}\Node%
1118 {0:486}}maisql-\/connect-\/error-\/error\endNode{}\endNode{}\Node%
1120 {0:487}}A string describing the problem that occurred,
1121 possibly one returned by the database back-\/end.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
1123 {0:MAISQL-SQL-ERROR}}\Node%
1127 {0:490}}CLSQL-\/SQL-\/ERROR\endNode{}\Node%
1129 {0:491}}condition representing errors during query or
1130 command execution\endNode{}\Node%
1132 {0:492}}Condition Type\endNode{}\endNode{}\Node%
1136 {0:494}}Class Precedence List\endNode{}\Node%
1144 {0:498}}maisql-\/sql-\/error\endNode{}\endNode{}\Node%
1148 {0:500}}maisql-\/error\endNode{}\endNode{}\Node%
1152 {0:502}}error\endNode{}\endNode{}\Node%
1156 {0:504}}serious-\/condition\endNode{}\endNode{}\Node%
1160 {0:506}}maisql-\/condition\endNode{}\endNode{}\Node%
1164 {0:508}}condition\endNode{}\endNode{}\Node%
1168 {0:510}}t\endNode{}\endNode{}\endNode{}
1169 \endNode{}\endNode{}\Node%
1173 {0:512}}Description\endNode{}\Node%
1175 {0:513}}This condition represents errors that occur while
1176 executing SQL statements, either as part of query operations
1177 or command execution, either explicitly or implicitly, as
1178 caused e.g. by \Node%
1180 {0:514}}with-\/transaction\endNode{}.
1181 The following initialization arguments and accessors exist:\endNode{}\Node%
1185 {0:516}}Initarg\endNode{}\Node%
1187 {0:517}}Accessor\endNode{}\Node%
1189 {0:518}}Description\endNode{}\Node%
1195 {0:521}}:database\endNode{}\endNode{}\Node%
1199 {0:523}}maisql-\/sql-\/error-\/database\endNode{}\endNode{}\Node%
1201 {0:524}}The database object that was involved in the
1202 incident.\endNode{}\endNode{}\Node%
1208 {0:527}}:expression\endNode{}\endNode{}\Node%
1212 {0:529}}maisql-\/sql-\/error-\/expression\endNode{}\endNode{}\Node%
1214 {0:530}}The SQL expression whose execution caused the error.\endNode{}\endNode{}\Node%
1220 {0:533}}:errno\endNode{}\endNode{}\Node%
1224 {0:535}}maisql-\/sql-\/error-\/errno\endNode{}\endNode{}\Node%
1226 {0:536}}The numeric or symbolic error specification
1227 returned by the database back-\/end. The values and
1228 semantics of this are interface specific.\endNode{}\endNode{}\Node%
1234 {0:539}}:error\endNode{}\endNode{}\Node%
1238 {0:541}}maisql-\/sql-\/error-\/error\endNode{}\endNode{}\Node%
1240 {0:542}}A string describing the problem that occurred,
1241 possibly one returned by the database back-\/end.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
1243 {0:MAISQL-EXISTS-CONDITION}}\Node%
1247 {0:545}}CLSQL-\/EXISTS-\/CONDITION\endNode{}\Node%
1249 {0:546}}condition indicating situations arising because of
1250 existing connections\endNode{}\Node%
1252 {0:547}}Condition Type\endNode{}\endNode{}\Node%
1256 {0:549}}Class Precedence List\endNode{}\Node%
1264 {0:553}}maisql-\/exists-\/condition\endNode{}\endNode{}\Node%
1268 {0:555}}maisql-\/condition\endNode{}\endNode{}\Node%
1272 {0:557}}condition\endNode{}\endNode{}\Node%
1276 {0:559}}t\endNode{}\endNode{}\endNode{}
1277 \endNode{}\endNode{}\Node%
1281 {0:561}}Description\endNode{}\Node%
1283 {0:562}}This condition is the super-\/type of all conditions which
1284 represents problems that occur during calls to
1287 {0:563}}connect\endNode{}, if a connection to the
1288 database exists already. Depending on the value of
1291 {0:564}}if-\/exists\endNode{} to the call of
1294 {0:565}}connect\endNode{}, either a warning, an error or
1295 no condition at all is signalled. If a warning or error is
1299 {0:566}}maisql-\/exists-\/warning\endNode{} or
1302 {0:567}}maisql-\/exists-\/error\endNode{} is signalled,
1303 which are subtypes of
1306 {0:568}}maisql-\/exists-\/condition\endNode{} and
1309 {0:569}}maisql-\/warning\endNode{} or
1312 {0:570}}maisql-\/error\endNode{}.
1315 {0:571}}maisql-\/exists-\/condition\endNode{} is never
1316 signalled itself.\endNode{}\Node%
1318 {0:572}} The following initialization arguments and accessors exist:\endNode{}\Node%
1322 {0:574}}Initarg\endNode{}\Node%
1324 {0:575}}Accessor\endNode{}\Node%
1326 {0:576}}Description\endNode{}\Node%
1332 {0:579}}:old-\/db\endNode{}\endNode{}\Node%
1336 {0:581}}maisql-\/exists-\/condition-\/old-\/db\endNode{}\endNode{}\Node%
1338 {0:582}}The database object that represents the existing
1339 connection. This slot is always filled.\endNode{}\endNode{}\Node%
1345 {0:585}}:new-\/db\endNode{}\endNode{}\Node%
1349 {0:587}}maisql-\/exists-\/condition-\/new-\/db\endNode{}\endNode{}\Node%
1351 {0:588}}The database object that will be used and returned by
1352 this call to connect, if execution continues normally.
1353 This can be either \Node%
1355 {0:589}}nil\endNode{}, indicating that
1356 a new database object is to be created on continuation,
1357 or a database object representing the newly created
1358 continuation, or the same database object as
1361 {0:590}}old-\/db\endNode{}, indicating that the existing
1362 database object will be reused. This slot is always
1363 filled and defaults to \Node%
1365 {0:591}}nil\endNode{}.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
1367 {0:MAISQL-EXISTS-WARNING}}\Node%
1371 {0:594}}CLSQL-\/EXISTS-\/WARNING\endNode{}\Node%
1373 {0:595}}condition representing warnings arising because of
1374 existing connections\endNode{}\Node%
1376 {0:596}}Condition Type\endNode{}\endNode{}\Node%
1380 {0:598}}Class Precedence List\endNode{}\Node%
1388 {0:602}}maisql-\/exists-\/warning\endNode{}\endNode{}\Node%
1392 {0:604}}maisql-\/exists-\/condition\endNode{}\endNode{}\Node%
1396 {0:606}}maisql-\/warning\endNode{}\endNode{}\Node%
1400 {0:608}}warning\endNode{}\endNode{}\Node%
1404 {0:610}}maisql-\/condition\endNode{}\endNode{}\Node%
1408 {0:612}}condition\endNode{}\endNode{}\Node%
1412 {0:614}}t\endNode{}\endNode{}\endNode{}
1413 \endNode{}\endNode{}\Node%
1417 {0:616}}Description\endNode{}\Node%
1419 {0:617}}This condition is a subtype of
1422 {0:618}}maisql-\/exists-\/condition\endNode{}, and is
1423 signalled during calls to \Node%
1425 {0:619}}connect\endNode{} when
1426 there is an existing connection, and
1429 {0:620}}if-\/exists\endNode{} is either
1432 {0:621}}:warn-\/new\endNode{} or \Node%
1434 {0:622}}:warn-\/old\endNode{}.
1435 In the former case, \Node%
1437 {0:623}}new-\/db\endNode{} will be the
1438 newly created database object, in the latter case it will be
1439 the existing old database object.\endNode{}\Node%
1441 {0:624}} The initialization arguments and accessors are the same as
1444 {0:625}}maisql-\/exists-\/condition\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
1446 {0:MAISQL-EXISTS-ERROR}}\Node%
1450 {0:628}}CLSQL-\/EXISTS-\/ERROR\endNode{}\Node%
1452 {0:629}}condition representing errors arising because of
1453 existing connections\endNode{}\Node%
1455 {0:630}}Condition Type\endNode{}\endNode{}\Node%
1459 {0:632}}Class Precedence List\endNode{}\Node%
1467 {0:636}}maisql-\/exists-\/error\endNode{}\endNode{}\Node%
1471 {0:638}}maisql-\/exists-\/condition\endNode{}\endNode{}\Node%
1475 {0:640}}maisql-\/error\endNode{}\endNode{}\Node%
1479 {0:642}}error\endNode{}\endNode{}\Node%
1483 {0:644}}serious-\/condition\endNode{}\endNode{}\Node%
1487 {0:646}}maisql-\/condition\endNode{}\endNode{}\Node%
1491 {0:648}}condition\endNode{}\endNode{}\Node%
1495 {0:650}}t\endNode{}\endNode{}\endNode{}
1496 \endNode{}\endNode{}\Node%
1500 {0:652}}Description\endNode{}\Node%
1502 {0:653}}This condition is a subtype of
1505 {0:654}}maisql-\/exists-\/condition\endNode{}, and is
1506 signalled during calls to \Node%
1508 {0:655}}connect\endNode{} when
1509 there is an existing connection, and
1512 {0:656}}if-\/exists\endNode{} is \Node%
1514 {0:657}}:error\endNode{}.
1515 In this case, \Node%
1517 {0:658}}new-\/db\endNode{} will be
1520 {0:659}}nil\endNode{}, indicating that the database object to
1521 be returned by \Node%
1523 {0:660}}connect\endNode{} depends on user
1524 action in continuing from this correctable error.\endNode{}\Node%
1526 {0:661}} The initialization arguments and accessors are the same as
1529 {0:662}}maisql-\/exists-\/condition\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
1531 {0:MAISQL-CLOSED-ERROR}}\Node%
1535 {0:665}}CLSQL-\/CLOSED-\/ERROR\endNode{}\Node%
1537 {0:666}}condition representing errors because the database
1538 has already been closed\endNode{}\Node%
1540 {0:667}}Condition Type\endNode{}\endNode{}\Node%
1544 {0:669}}Class Precedence List\endNode{}\Node%
1552 {0:673}}maisql-\/closed-\/error\endNode{}\endNode{}\Node%
1556 {0:675}}maisql-\/error\endNode{}\endNode{}\Node%
1560 {0:677}}error\endNode{}\endNode{}\Node%
1564 {0:679}}serious-\/condition\endNode{}\endNode{}\Node%
1568 {0:681}}maisql-\/condition\endNode{}\endNode{}\Node%
1572 {0:683}}condition\endNode{}\endNode{}\Node%
1576 {0:685}}t\endNode{}\endNode{}\endNode{}
1577 \endNode{}\endNode{}\Node%
1581 {0:687}}Description\endNode{}\Node%
1583 {0:688}}This condition represents errors that occur because the
1584 user invokes an operation on the given database object,
1585 although the database is invalid because
1588 {0:689}}disconnect\endNode{} has already been called on
1589 this database object.\endNode{}\Node%
1591 {0:690}}Functions which signal this error when called with a
1592 closed database will usually provide a
1595 {0:691}}continue\endNode{} restart, that will just return nil
1596 from the function.\endNode{}\Node%
1598 {0:692}} The following initialization arguments and accessors exist:\endNode{}\Node%
1602 {0:694}}Initarg\endNode{}\Node%
1604 {0:695}}Accessor\endNode{}\Node%
1606 {0:696}}Description\endNode{}\Node%
1612 {0:699}}:database\endNode{}\endNode{}\Node%
1616 {0:701}}maisql-\/closed-\/error-\/database\endNode{}\endNode{}\Node%
1618 {0:702}}The database object that was involved in the
1619 incident.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
1621 {0:DEFAULT-DATABASE-TYPE}}\Node%
1625 {0:705}}*DEFAULT-\/DATABASE-\/TYPE*\endNode{}\Node%
1627 {0:706}}The default database type to use\endNode{}\Node%
1629 {0:707}}Variable\endNode{}\endNode{}\Node%
1633 {0:709}}Value Type\endNode{}\Node%
1635 {0:710}}Any keyword representing a valid database back-\/end of
1640 {0:712}}CLSQL\endNode{}\endNode{}, or
1643 {0:713}}nil\endNode{}.\endNode{}\endNode{}\Node%
1647 {0:715}}Initial Value\endNode{}\Node%
1651 {0:717}}nil\endNode{}\endNode{}\endNode{}\Node%
1655 {0:719}}Description\endNode{}\Node%
1657 {0:720}}The value of this variable is used in calls to
1660 {0:721}}initialize-\/database-\/type\endNode{} and
1663 {0:722}}connect\endNode{} as the default
1666 {0:723}}database-\/type\endNode{}
1667 parameter.\endNode{}\Node%
1671 {0:725}}If the value of this variable is \Node%
1673 {0:726}}nil\endNode{},
1677 {0:727}}initialize-\/database-\/type\endNode{} or
1680 {0:728}}connect\endNode{} will have to specify the
1683 {0:729}}database-\/type\endNode{} to use, or a
1684 general-\/purpose error will be signalled.\endNode{}\endNode{}\endNode{}\Node%
1688 {0:731}}Examples\endNode{}\Node%
1690 {0:732}}(setf *default-\/database-\/type* :mysql)
1692 (initialize-\/database-\/type)
1694 \endNode{}\endNode{}\Node%
1698 {0:734}}Affected By\endNode{}\Node%
1700 {0:735}}None.\endNode{}\endNode{}\Node%
1704 {0:737}}See Also\endNode{}\Node%
1706 {0:738}}None.\endNode{}\endNode{}\Node%
1710 {0:740}}Notes\endNode{}\Node%
1712 {0:741}}None.\endNode{}\endNode{}\endNode{}\Node%
1714 {0:INITIALIZED-DATABASE-TYPES}}\Node%
1718 {0:744}}*INITIALIZED-\/DATABASE-\/TYPES*\endNode{}\Node%
1720 {0:745}}List of all initialized database types\endNode{}\Node%
1722 {0:746}}Variable\endNode{}\endNode{}\Node%
1726 {0:748}}Value Type\endNode{}\Node%
1728 {0:749}}A list of all initialized database types, each of which
1729 represented by it's corresponding keyword.\endNode{}\endNode{}\Node%
1733 {0:751}}Initial Value\endNode{}\Node%
1737 {0:753}}nil\endNode{}\endNode{}\endNode{}\Node%
1741 {0:755}}Description\endNode{}\Node%
1743 {0:756}}This variable is updated whenever
1746 {0:757}}initialize-\/database-\/type\endNode{} is called for a
1747 database type which hasn't already been initialized before,
1748 as determined by this variable. In that case the keyword
1749 representing the database type is pushed onto the list
1753 {0:758}}*INITIALIZED-\/DATABASE-\/TYPES*\endNode{}.\endNode{}\Node%
1757 {0:760}}Attempts to modify the value of this variable will
1758 result in undefined behaviour.\endNode{}\endNode{}\endNode{}\Node%
1762 {0:762}}Examples\endNode{}\Node%
1764 {0:763}}(setf *default-\/database-\/type* :mysql)
1766 (initialize-\/database-\/type)
1768 *initialized-\/database-\/types*
1770 \endNode{}\endNode{}\Node%
1774 {0:765}}Affected By\endNode{}\Node%
1782 {0:769}}initialize-\/database-\/type\endNode{}\endNode{}\endNode{}
1783 \endNode{}\endNode{}\Node%
1787 {0:771}}See Also\endNode{}\Node%
1789 {0:772}}None.\endNode{}\endNode{}\Node%
1793 {0:774}}Notes\endNode{}\Node%
1795 {0:775}}Direct access to this variable is primarily provided
1796 because of compatibility with Harlequin's \Node%
1799 SQL\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
1801 {0:INITIALIZE-DATABASE-TYPE}}\Node%
1805 {0:779}}INITIALIZE-\/DATABASE-\/TYPE\endNode{}\Node%
1807 {0:780}}Initializes a database type\endNode{}\Node%
1809 {0:781}}Function\endNode{}\endNode{}\Node%
1813 {0:783}}Syntax\endNode{}\Node%
1817 {0:785}}initialize-\/database-\/type\endNode{} \Entity{amp}key \Node%
1819 {0:786}}database-\/type\endNode{} =>\/ \Node%
1821 {0:787}}result\endNode{}\endNode{}\endNode{}\Node%
1825 {0:789}}Arguments and Values\endNode{}\Node%
1833 {0:793}}database-\/type\endNode{}\endNode{}\Node%
1837 {0:795}}The database type to initialize, i.e. a keyword
1838 symbol denoting a known database back-\/end. Defaults to
1842 {0:796}}*default-\/database-\/type*\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
1848 {0:799}}result\endNode{}\endNode{}\Node%
1852 {0:801}}Either \Node%
1854 {0:802}}nil\endNode{} if the initialization
1855 attempt fails, or \Node%
1857 {0:803}}t\endNode{} otherwise.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
1861 {0:805}}Description\endNode{}\Node%
1863 {0:806}}If the back-\/end specified by
1866 {0:807}}database-\/type\endNode{} has not already been
1867 initialized, as seen from
1870 {0:808}}*initialized-\/database-\/types*\endNode{}, an attempt is
1871 made to initialize the database. If this attempt succeeds,
1872 or the back-\/end has already been initialized, the function
1873 returns t, and places the keyword denoting the database type
1874 onto the list stored in
1877 {0:809}}*initialized-\/database-\/types*\endNode{}, if not
1878 already present.\endNode{}\Node%
1880 {0:810}}If initialization fails, the function returns
1883 {0:811}}nil\endNode{}, and/or signals an error of type
1886 {0:812}}maisql-\/error\endNode{}. The kind of action
1887 taken depends on the back-\/end and the cause of the
1888 problem.\endNode{}\endNode{}\Node%
1892 {0:814}}Examples\endNode{}\Node%
1894 {0:815}}*initialized-\/database-\/types*
1896 (setf *default-\/database-\/type* :mysql)
1898 (initialize-\/database-\/type)
1899 >\/>\/ Compiling LAMBDA (\#:G897 \#:G898 \#:G901 \#:G902):
1900 >\/>\/ Compiling Top-\/Level Form:
1903 *initialized-\/database-\/types*
1905 (initialize-\/database-\/type)
1907 *initialized-\/database-\/types*
1909 \endNode{}\endNode{}\Node%
1913 {0:817}}Side Effects\endNode{}\Node%
1915 {0:818}}The database back-\/end corresponding to the database type
1916 specified is initialized, unless it has already been
1917 initialized. This can involve any number of other side
1918 effects, as determined by the back-\/end implementation (like
1919 e.g. loading of foreign code, calling of foreign code,
1920 networking operations, etc.). If initialization is
1921 attempted and succeeds, the
1924 {0:819}}database-\/type\endNode{} is pushed onto the list
1928 {0:820}}*initialized-\/database-\/types*\endNode{}.\endNode{}\endNode{}\Node%
1932 {0:822}}Affected by\endNode{}\Node%
1940 {0:826}}*default-\/database-\/type*\endNode{}\endNode{}\Node%
1944 {0:828}}*initialized-\/database-\/types*\endNode{}\endNode{}\endNode{}
1945 \endNode{}\endNode{}\Node%
1949 {0:830}}Exceptional Situations\endNode{}\Node%
1951 {0:831}}If an error is encountered during the initialization
1952 attempt, the back-\/end may signal errors of kind
1955 {0:832}}maisql-\/error\endNode{}.\endNode{}\endNode{}\Node%
1959 {0:834}}See Also\endNode{}\Node%
1961 {0:835}}None.\endNode{}\endNode{}\Node%
1965 {0:837}}Notes\endNode{}\Node%
1967 {0:838}}None.\endNode{}\endNode{}\endNode{}\Node%
1969 {0:CONNECT-IF-EXISTS}}\Node%
1973 {0:841}}*CONNECT-\/IF-\/EXISTS*\endNode{}\Node%
1975 {0:842}}Default value for the
1978 {0:843}}if-\/exists\endNode{} parameter of
1981 {0:844}}connect\endNode{}.\endNode{}\Node%
1983 {0:845}}Variable\endNode{}\endNode{}\Node%
1987 {0:847}}Value Type\endNode{}\Node%
1989 {0:848}}A valid argument to the \Node%
1991 {0:849}}if-\/exists\endNode{}
1994 {0:850}}connect\endNode{}, i.e. one of
2001 {0:853}}:new\endNode{}\endNode{}\Node%
2005 {0:855}}:warn-\/new\endNode{}\endNode{}\Node%
2009 {0:857}}:error\endNode{}\endNode{}\Node%
2013 {0:859}}:warn-\/old\endNode{}\endNode{}\Node%
2017 {0:861}}:old\endNode{}\endNode{}\endNode{}.
2018 \endNode{}\endNode{}\Node%
2022 {0:863}}Initial Value\endNode{}\Node%
2026 {0:865}}:error\endNode{}\endNode{}\endNode{}\Node%
2030 {0:867}}Description\endNode{}\Node%
2032 {0:868}}The value of this variable is used in calls to
2035 {0:869}}connect\endNode{} as the default
2038 {0:870}}if-\/exists\endNode{}
2039 parameter. See \Node%
2043 {0:872}}connect\endNode{}\endNode{} for
2044 the semantics of the valid values for this variable.\endNode{}\endNode{}\Node%
2048 {0:874}}Examples\endNode{}\Node%
2050 {0:875}}None.\endNode{}\endNode{}\Node%
2054 {0:877}}Affected By\endNode{}\Node%
2056 {0:878}}None.\endNode{}\endNode{}\Node%
2060 {0:880}}See Also\endNode{}\Node%
2070 {0:885}}connect\endNode{}\endNode{}\endNode{}\endNode{}
2071 \endNode{}\endNode{}\Node%
2075 {0:887}}Notes\endNode{}\Node%
2077 {0:888}}None.\endNode{}\endNode{}\endNode{}\Node%
2079 {0:CONNECTED-DATABASES}}\Node%
2083 {0:891}}CONNECTED-\/DATABASES\endNode{}\Node%
2085 {0:892}}Return the list of active database
2086 objects.\endNode{}\Node%
2088 {0:893}}Function\endNode{}\endNode{}\Node%
2092 {0:895}}Syntax\endNode{}\Node%
2096 {0:897}}connected-\/databases\endNode{} =>\/ \Node%
2098 {0:898}}databases\endNode{}\endNode{}\endNode{}\Node%
2102 {0:900}}Arguments and Values\endNode{}\Node%
2110 {0:904}}databases\endNode{}\endNode{}\Node%
2114 {0:906}}The list of active database objects.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
2118 {0:908}}Description\endNode{}\Node%
2120 {0:909}}This function returns the list of active database
2121 objects, i.e. all those database objects created by calls to
2124 {0:910}}connect\endNode{}, which have not been closed by
2127 {0:911}}disconnect\endNode{} on them.\endNode{}\Node%
2131 {0:913}}The consequences of modifying the list returned by
2134 {0:914}}connected-\/databases\endNode{} are
2135 undefined.\endNode{}\endNode{}\endNode{}\Node%
2139 {0:916}}Examples\endNode{}\Node%
2141 {0:917}}(connected-\/databases)
2143 (connect '(nil "template1" "dent" nil) :database-\/type :postgresql)
2144 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{4830BC65\}>\/
2145 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
2146 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{4830C5AD\}>\/
2147 (connected-\/databases)
2148 =>\/ (\#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{4830C5AD\}>\/
2149 \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{4830BC65\}>\/)
2152 (connected-\/databases)
2153 =>\/ (\#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{4830BC65\}>\/)
2156 (connected-\/databases)
2158 \endNode{}\endNode{}\Node%
2162 {0:919}}Side Effects\endNode{}\Node%
2164 {0:920}}None.\endNode{}\endNode{}\Node%
2168 {0:922}}Affected By\endNode{}\Node%
2176 {0:926}}connect\endNode{}\endNode{}\Node%
2180 {0:928}}disconnect\endNode{}\endNode{}\endNode{}
2181 \endNode{}\endNode{}\Node%
2185 {0:930}}Exceptional Situations\endNode{}\Node%
2187 {0:931}}None.\endNode{}\endNode{}\Node%
2191 {0:933}}See Also\endNode{}\Node%
2193 {0:934}}None.\endNode{}\endNode{}\Node%
2197 {0:936}}Notes\endNode{}\Node%
2199 {0:937}}None.\endNode{}\endNode{}\endNode{}\Node%
2201 {0:DEFAULT-DATABASE}}\Node%
2205 {0:940}}*DEFAULT-\/DATABASE*\endNode{}\Node%
2207 {0:941}}The default database object to use\endNode{}\Node%
2209 {0:942}}Variable\endNode{}\endNode{}\Node%
2213 {0:944}}Value Type\endNode{}\Node%
2215 {0:945}}Any object of type \Node%
2217 {0:946}}database\endNode{}, or nil to
2218 indicate no default database.\endNode{}\endNode{}\Node%
2222 {0:948}}Initial Value\endNode{}\Node%
2226 {0:950}}nil\endNode{}\endNode{}\endNode{}\Node%
2230 {0:952}}Description\endNode{}\Node%
2232 {0:953}}Any function or macro in
2237 {0:955}}CLSQL\endNode{}\endNode{} that operates on a
2238 database uses the value of this variable as the default
2239 value for it's \Node%
2241 {0:956}}database\endNode{}
2242 parameter.\endNode{}\Node%
2244 {0:957}}The value of this parameter is changed by calls to
2247 {0:958}}connect\endNode{}, which sets
2250 {0:959}}*default-\/database*\endNode{} to the database object
2251 it returns. It is also changed by calls to
2254 {0:960}}disconnect\endNode{}, when the database object
2255 being disconnected is the same as the value of
2258 {0:961}}*default-\/database*\endNode{}. In this case
2261 {0:962}}disconnect\endNode{} sets
2264 {0:963}}*default-\/database*\endNode{} to the first database
2265 that remains in the list of active databases as returned by
2268 {0:964}}connected-\/databases\endNode{}, or
2271 {0:965}}nil\endNode{} if no further active databases
2272 exist.\endNode{}\Node%
2274 {0:966}}The user may change \Node%
2276 {0:967}}*default-\/database*\endNode{}
2277 at any time to a valid value of his choice.\endNode{}\Node%
2281 {0:969}}If the value of \Node%
2283 {0:970}}*default-\/database*\endNode{} is
2286 {0:971}}nil\endNode{}, then all calls to
2291 {0:973}}CLSQL\endNode{}\endNode{} functions on databases
2292 must provide a suitable \Node%
2294 {0:974}}database\endNode{}
2295 parameter, or an error will be signalled.\endNode{}\endNode{}\endNode{}\Node%
2299 {0:976}}Examples\endNode{}\Node%
2301 {0:977}}(connected-\/databases)
2303 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
2304 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48385F55\}>\/
2305 (connect '(nil "template1" "dent" nil) :database-\/type :postgresql)
2306 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{483868FD\}>\/
2307 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql :if-\/exists :new)
2308 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48387265\}>\/
2309 *default-\/database*
2310 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48387265\}>\/
2313 *default-\/database*
2314 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{483868FD\}>\/
2317 *default-\/database*
2318 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48385F55\}>\/
2321 *default-\/database*
2323 (connected-\/databases)
2325 \endNode{}\endNode{}\Node%
2329 {0:979}}Affected By\endNode{}\Node%
2339 {0:984}}connect\endNode{}\endNode{}\endNode{}\Node%
2345 {0:987}}disconnect\endNode{}\endNode{}\endNode{}\endNode{}
2346 \endNode{}\endNode{}\Node%
2350 {0:989}}See Also\endNode{}\Node%
2360 {0:994}}connected-\/databases\endNode{}\endNode{}\endNode{}\endNode{}
2361 \endNode{}\endNode{}\Node%
2365 {0:996}}Notes\endNode{}\Node%
2369 {0:998}}This variable is intended to facilitate working with
2374 {0:1000}}CLSQL\endNode{}\endNode{} in an interactive
2375 fashion at the top-\/level loop, and because of this,
2378 {0:1001}}connect\endNode{} and
2381 {0:1002}}disconnect\endNode{} provide some fairly
2382 complex behaviour to keep
2385 {0:1003}}*default-\/database*\endNode{} set to useful values.
2386 Programmatic use of \Node%
2390 {0:1005}}CLSQL\endNode{}\endNode{}
2391 should never depend on the value of
2394 {0:1006}}*default-\/database*\endNode{} and should provide
2395 correct database objects via the
2398 {0:1007}}database\endNode{} parameter to functions
2399 called.\endNode{}\endNode{}\endNode{}\endNode{}\Node%
2405 {0:1010}}DATABASE\endNode{}\Node%
2407 {0:1011}}The super-\/type of all
2412 {0:1013}}CLSQL\endNode{}\endNode{} databases\endNode{}\Node%
2414 {0:1014}}Class\endNode{}\endNode{}\Node%
2418 {0:1016}}Class Precedence List\endNode{}\Node%
2426 {0:1020}}database\endNode{}\endNode{}\Node%
2430 {0:1022}}standard-\/object\endNode{}\endNode{}\Node%
2434 {0:1024}}t\endNode{}\endNode{}\endNode{}
2435 \endNode{}\endNode{}\Node%
2439 {0:1026}}Description\endNode{}\Node%
2441 {0:1027}}This class is the superclass of all
2446 {0:1029}}CLSQL\endNode{}\endNode{} databases. The different
2447 database back-\/ends derive subclasses of this class to
2448 implement their databases. No instances of this class are
2449 ever created by \Node%
2453 {0:1031}}CLSQL\endNode{}\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
2455 {0:CLOSED-DATABASE}}\Node%
2459 {0:1034}}CLOSED-\/DATABASE\endNode{}\Node%
2461 {0:1035}}The class representing all closed
2466 {0:1037}}CLSQL\endNode{}\endNode{} databases\endNode{}\Node%
2468 {0:1038}}Class\endNode{}\endNode{}\Node%
2472 {0:1040}}Class Precedence List\endNode{}\Node%
2480 {0:1044}}closed-\/database\endNode{}\endNode{}\Node%
2484 {0:1046}}standard-\/object\endNode{}\endNode{}\Node%
2488 {0:1048}}t\endNode{}\endNode{}\endNode{}
2489 \endNode{}\endNode{}\Node%
2493 {0:1050}}Description\endNode{}\Node%
2499 {0:1053}}CLSQL\endNode{}\endNode{} \Node%
2501 {0:1054}}database\endNode{}
2502 instances are changed to this class via
2505 {0:1055}}change-\/class\endNode{} after they are closed via
2508 {0:1056}}disconnect\endNode{}. All functions and generic
2509 functions that take database objects as arguments will
2510 signal errors of type
2513 {0:1057}}maisql-\/closed-\/error\endNode{} when they are
2514 called on instances of \Node%
2516 {0:1058}}closed-\/database\endNode{}, with
2517 the exception of \Node%
2519 {0:1059}}database-\/name\endNode{}, which
2520 will continue to work as for instances of
2523 {0:1060}}database\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
2525 {0:DATABASE-NAME}}\Node%
2529 {0:1063}}DATABASE-\/NAME\endNode{}\Node%
2531 {0:1064}}Get the name of a database object\endNode{}\Node%
2533 {0:1065}}Generic Function\endNode{}\endNode{}\Node%
2537 {0:1067}}Syntax\endNode{}\Node%
2541 {0:1069}}database-\/name\endNode{} \Node%
2543 {0:1070}}database\endNode{} =>\/ \Node%
2545 {0:1071}}name\endNode{}\endNode{}\endNode{}\Node%
2549 {0:1073}}Arguments and Values\endNode{}\Node%
2557 {0:1077}}database\endNode{}\endNode{}\Node%
2561 {0:1079}}A database object, either of type
2564 {0:1080}}database\endNode{} or of type
2567 {0:1081}}closed-\/database\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
2573 {0:1084}}name\endNode{}\endNode{}\Node%
2577 {0:1086}}A string describing the identity of the database
2578 to which this database object is connected to.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
2582 {0:1088}}Description\endNode{}\Node%
2584 {0:1089}}This function returns the database name of the given
2585 database. The database name is a string which somehow
2586 describes the identity of the database to which this
2587 database object is or has been connected. The database name
2588 of a database object is determined at
2591 {0:1090}}connect\endNode{} time, when a call to
2594 {0:1091}}database-\/name-\/from-\/spec\endNode{} derives the
2595 database name from the connection specification passed to
2598 {0:1092}}connect\endNode{} in the
2601 {0:1093}}connection-\/spec\endNode{} parameter.\endNode{}\Node%
2603 {0:1094}}The database name is used via
2606 {0:1095}}find-\/database\endNode{} in
2609 {0:1096}}connect\endNode{} to determine whether database
2610 connections to the specified database exist already.\endNode{}\Node%
2612 {0:1097}}Usually the database name string will include
2613 indications of the host, database name, user, or port that
2614 where used during the connection attempt. The only
2615 important thing is that this string shall try to identify
2616 the database at the other end of the connection. Connection
2617 specifications parts like passwords and credentials shall
2618 not be used as part of the database name.\endNode{}\endNode{}\Node%
2622 {0:1099}}Examples\endNode{}\Node%
2624 {0:1100}}(database-\/name-\/from-\/spec '("dent" "newesim" "dent" "dent") :mysql)
2625 =>\/ "dent/newesim/dent"
2626 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
2627 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48391DCD\}>\/
2628 (database-\/name *default-\/database*)
2629 =>\/ "dent/newesim/dent"
2631 (database-\/name-\/from-\/spec '(nil "template1" "dent" nil) :postgresql)
2632 =>\/ "/template1/dent"
2633 (connect '(nil "template1" "dent" nil) :database-\/type :postgresql)
2634 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
2635 (database-\/name *default-\/database*)
2636 =>\/ "/template1/dent"
2638 (database-\/name-\/from-\/spec '("www.pmsf.de" "template1" "dent" nil) :postgresql)
2639 =>\/ "www.pmsf.de/template1/dent"
2640 \endNode{}\endNode{}\Node%
2644 {0:1102}}Side Effects\endNode{}\Node%
2646 {0:1103}}None.\endNode{}\endNode{}\Node%
2650 {0:1105}}Affected By\endNode{}\Node%
2660 {0:1110}}database-\/name-\/from-\/spec\endNode{}\endNode{}\endNode{}\endNode{}
2661 \endNode{}\endNode{}\Node%
2665 {0:1112}}Exceptional Situations\endNode{}\Node%
2667 {0:1113}}Will signal an error if the object passed as the
2670 {0:1114}}database\endNode{} parameter is neither of type
2673 {0:1115}}database\endNode{} nor of type
2676 {0:1116}}closed-\/database\endNode{}.\endNode{}\endNode{}\Node%
2680 {0:1118}}See Also\endNode{}\Node%
2690 {0:1123}}connect\endNode{}\endNode{}\endNode{}\Node%
2696 {0:1126}}find-\/database\endNode{}\endNode{}\endNode{}\endNode{}
2697 \endNode{}\endNode{}\Node%
2701 {0:1128}}Notes\endNode{}\Node%
2703 {0:1129}}None.\endNode{}\endNode{}\endNode{}\Node%
2705 {0:FIND-DATABASE}}\Node%
2709 {0:1132}}FIND-\/DATABASE\endNode{}\Node%
2711 {0:1133}}Locate a database object through it's
2712 name.\endNode{}\Node%
2714 {0:1134}}Function\endNode{}\endNode{}\Node%
2718 {0:1136}}Syntax\endNode{}\Node%
2722 {0:1138}}find-\/database\endNode{} \Node%
2724 {0:1139}}database\endNode{} \Entity{amp}optional \Node%
2726 {0:1140}}errorp\endNode{} =>\/ \Node%
2728 {0:1141}}result\endNode{}\endNode{}\endNode{}\Node%
2732 {0:1143}}Arguments and Values\endNode{}\Node%
2740 {0:1147}}database\endNode{}\endNode{}\Node%
2744 {0:1149}}A database object or a string, denoting a database
2745 name.\endNode{}\endNode{}\endNode{}\Node%
2751 {0:1152}}errorp\endNode{}\endNode{}\Node%
2755 {0:1154}}A generalized boolean. Defaults to
2758 {0:1155}}t\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
2764 {0:1158}}result\endNode{}\endNode{}\Node%
2768 {0:1160}}Either a database object, or, if
2771 {0:1161}}errorp\endNode{} is \Node%
2773 {0:1162}}nil\endNode{},
2776 {0:1163}}nil\endNode{}.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
2780 {0:1165}}Description\endNode{}\Node%
2784 {0:1167}}find-\/database\endNode{} locates an active
2785 database object given the specification in
2788 {0:1168}}database\endNode{}. If
2791 {0:1169}}database\endNode{} is an object of type
2794 {0:1170}}database\endNode{}, \Node%
2796 {0:1171}}find-\/database\endNode{}
2797 returns this. Otherwise it will search the active databases
2798 as indicated by the list returned by
2801 {0:1172}}connected-\/databases\endNode{} for a database
2802 whose name (as returned by
2805 {0:1173}}database-\/name\endNode{} is equal as per
2808 {0:1174}}string=\endNode{} to the string passed as
2811 {0:1175}}database\endNode{}. If it succeeds, it returns
2812 the first database found.\endNode{}\Node%
2814 {0:1176}}If it fails to find a matching database, it will signal
2815 an error of type \Node%
2817 {0:1177}}maisql-\/error\endNode{} if
2820 {0:1178}}errorp\endNode{} is true. If
2823 {0:1179}}errorp\endNode{} is \Node%
2825 {0:1180}}nil\endNode{}, it
2828 {0:1181}}nil\endNode{} instead.\endNode{}\endNode{}\Node%
2832 {0:1183}}Examples\endNode{}\Node%
2834 {0:1184}}(database-\/name-\/from-\/spec '("dent" "newesim" "dent" "dent") :mysql)
2835 =>\/ "dent/newesim/dent"
2836 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
2837 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48391DCD\}>\/
2838 (database-\/name *default-\/database*)
2839 =>\/ "dent/newesim/dent"
2841 (database-\/name-\/from-\/spec '(nil "template1" "dent" nil) :postgresql)
2842 =>\/ "/template1/dent"
2843 (connect '(nil "template1" "dent" nil) :database-\/type :postgresql)
2844 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
2845 (database-\/name *default-\/database*)
2846 =>\/ "/template1/dent"
2848 (database-\/name-\/from-\/spec '("www.pmsf.de" "template1" "dent" nil) :postgresql)
2849 =>\/ "www.pmsf.de/template1/dent"
2851 (find-\/database "dent/newesim/dent")
2852 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{484E91C5\}>\/
2853 (find-\/database "/template1/dent")
2854 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
2855 (find-\/database "www.pmsf.de/template1/dent" nil)
2857 (find-\/database **)
2858 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
2859 \endNode{}\endNode{}\Node%
2863 {0:1186}}Side Effects\endNode{}\Node%
2865 {0:1187}}None.\endNode{}\endNode{}\Node%
2869 {0:1189}}Affected By\endNode{}\Node%
2879 {0:1194}}connected-\/databases\endNode{}\endNode{}\endNode{}\endNode{}
2880 \endNode{}\endNode{}\Node%
2884 {0:1196}}Exceptional Situations\endNode{}\Node%
2886 {0:1197}}Will signal an error of type
2889 {0:1198}}maisql-\/error\endNode{} if no matching database
2890 can be found, and \Node%
2892 {0:1199}}errorp\endNode{} is true.
2893 Will signal an error if the value of
2896 {0:1200}}database\endNode{} is neither an object of type
2899 {0:1201}}database\endNode{} nor a string.\endNode{}\endNode{}\Node%
2903 {0:1203}}See Also\endNode{}\Node%
2913 {0:1208}}database-\/name\endNode{}\endNode{}\endNode{}\Node%
2919 {0:1211}}database-\/name-\/from-\/spec\endNode{}\endNode{}\endNode{}\endNode{}
2920 \endNode{}\endNode{}\Node%
2924 {0:1213}}Notes\endNode{}\Node%
2926 {0:1214}}None.\endNode{}\endNode{}\endNode{}\Node%
2932 {0:1217}}CONNECT\endNode{}\Node%
2934 {0:1218}}create a connection to a database\endNode{}\Node%
2936 {0:1219}}Function\endNode{}\endNode{}\Node%
2940 {0:1221}}Syntax\endNode{}\Node%
2944 {0:1223}}connect\endNode{} \Node%
2946 {0:1224}}connection-\/spec\endNode{} \Entity{amp}key \Node%
2948 {0:1225}}if-\/exists\endNode{} \Node%
2950 {0:1226}}database-\/type\endNode{} =>\/ \Node%
2952 {0:1227}}database\endNode{}\endNode{}\endNode{}\Node%
2956 {0:1229}}Arguments and Values\endNode{}\Node%
2964 {0:1233}}connection-\/spec\endNode{}\endNode{}\Node%
2968 {0:1235}}A connection specification\endNode{}\endNode{}\endNode{}\Node%
2974 {0:1238}}if-\/exists\endNode{}\endNode{}\Node%
2978 {0:1240}}This indicates the action to take if a connection
2979 to the same database exists already. See below for the
2980 legal values and actions. It defaults to the value of
2983 {0:1241}}*connect-\/if-\/exists*\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
2989 {0:1244}}database-\/type\endNode{}\endNode{}\Node%
2993 {0:1246}}A database type specifier, i.e. a keyword.
2994 This defaults to the value of
2997 {0:1247}}*default-\/database-\/type*\endNode{}\endNode{}\endNode{}\endNode{}\Node%
3003 {0:1250}}database\endNode{}\endNode{}\Node%
3007 {0:1252}}The database object representing the connection.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
3011 {0:1254}}Description\endNode{}\Node%
3013 {0:1255}}This function takes a connection specification and
3014 a database type and creates a connection to the database
3015 specified by those. The type and structure of the
3016 connection specification depend on the database type.\endNode{}\Node%
3018 {0:1256}}The parameter \Node%
3020 {0:1257}}if-\/exists\endNode{} specifies
3021 what to do if a connection to the database specified exists
3022 already, which is checked by calling
3025 {0:1258}}find-\/database\endNode{} on the database name
3028 {0:1259}}database-\/name-\/from-\/spec\endNode{}
3029 when called with the \Node%
3031 {0:1260}}connection-\/spec\endNode{}
3034 {0:1261}}database-\/type\endNode{} parameters. The
3035 possible values of \Node%
3037 {0:1262}}if-\/exists\endNode{} are:
3046 {0:1266}}:new\endNode{}\endNode{}\Node%
3050 {0:1268}}Go ahead and create a new connection.\endNode{}\endNode{}\endNode{}\Node%
3056 {0:1271}}:warn-\/new\endNode{}\endNode{}\Node%
3060 {0:1273}}This is just like \Node%
3062 {0:1274}}:new\endNode{}, but
3063 also signals a warning of type
3066 {0:1275}}maisql-\/exists-\/warning\endNode{},
3067 indicating the old and newly created
3068 databases.\endNode{}\endNode{}\endNode{}\Node%
3074 {0:1278}}:error\endNode{}\endNode{}\Node%
3078 {0:1280}}This will cause \Node%
3080 {0:1281}}connect\endNode{} to
3081 signal a correctable error of type
3084 {0:1282}}maisql-\/exists-\/error\endNode{}. The
3085 user may choose to proceed, either by indicating
3086 that a new connection shall be created, via the
3089 {0:1283}}create-\/new\endNode{}, or by
3090 indicating that the existing connection shall be
3091 used, via the restart
3094 {0:1284}}use-\/old\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
3100 {0:1287}}:old\endNode{}\endNode{}\Node%
3104 {0:1289}}This will cause \Node%
3106 {0:1290}}connect\endNode{} to
3107 use an old connection if one exists.\endNode{}\endNode{}\endNode{}\Node%
3113 {0:1293}}:warn-\/old\endNode{}\endNode{}\Node%
3117 {0:1295}}This is just like \Node%
3119 {0:1296}}:old\endNode{}, but
3120 also signals a warning of type
3123 {0:1297}}maisql-\/exists-\/warning\endNode{},
3124 indicating the old database used, via the slots
3127 {0:1298}}old-\/db\endNode{} and
3130 {0:1299}}new-\/db\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}
3133 {0:1300}}The database name of the returned database object will
3134 be the same under \Node%
3136 {0:1301}}string=\endNode{} as that which
3137 would be returned by a call to
3140 {0:1302}}database-\/name-\/from-\/spec\endNode{} with the given
3143 {0:1303}}connection-\/spec\endNode{} and
3146 {0:1304}}database-\/type\endNode{} parameters.\endNode{}\endNode{}\Node%
3150 {0:1306}}Examples\endNode{}\Node%
3152 {0:1307}}(database-\/name-\/from-\/spec '("dent" "newesim" "dent" "dent") :mysql)
3153 =>\/ "dent/newesim/dent"
3154 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
3155 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48036F6D\}>\/
3157 =>\/ "dent/newesim/dent"
3159 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
3160 >\/>\/ In call to CONNECT:
3161 >\/>\/ There is an existing connection \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48036F6D\}>\/ to database dent/newesim/dent.
3164 >\/>\/ 0: [CREATE-\/NEW] Create a new connection.
3165 >\/>\/ 1: [USE-\/OLD ] Use the existing connection.
3166 >\/>\/ 2: [ABORT ] Return to Top-\/Level.
3168 >\/>\/ Debug (type H for help)
3170 >\/>\/ (CONNECT ("dent" "newesim" "dent" "dent") :IF-\/EXISTS NIL :DATABASE-\/TYPE ...)
3172 >\/>\/ ; File: /prj/CLSQL/sql/sql.cl
3173 >\/>\/ (RESTART-\/CASE (ERROR 'CLSQL-\/EXISTS-\/ERROR :OLD-\/DB OLD-\/DB)
3174 >\/>\/ (CREATE-\/NEW NIL :REPORT "Create a new connection."
3175 >\/>\/ (SETQ RESULT \#))
3176 >\/>\/ (USE-\/OLD NIL :REPORT "Use the existing connection."
3177 >\/>\/ (SETQ RESULT OLD-\/DB)))
3179 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{480451F5\}>\/
3180 \endNode{}\endNode{}\Node%
3184 {0:1309}}Side Effects\endNode{}\Node%
3186 {0:1310}}A database connection is established, and the resultant
3187 database object is registered, so as to appear in the list
3190 {0:1311}}connected-\/databases\endNode{}.\endNode{}\endNode{}\Node%
3194 {0:1313}}Affected by\endNode{}\Node%
3202 {0:1317}}*default-\/database-\/type*\endNode{}\endNode{}\Node%
3206 {0:1319}}*connect-\/if-\/exists*\endNode{}\endNode{}\endNode{}
3207 \endNode{}\endNode{}\Node%
3211 {0:1321}}Exceptional Situations\endNode{}\Node%
3213 {0:1322}}If the connection specification is not syntactically or
3214 semantically correct for the given database type, an error
3217 {0:1323}}maisql-\/invalid-\/spec-\/error\endNode{} is
3218 signalled. If during the connection attempt an error is
3219 detected (e.g. because of permission problems, network
3220 trouble or any other cause), an error of type
3223 {0:1324}}maisql-\/connect-\/error\endNode{} is
3224 signalled.\endNode{}\Node%
3226 {0:1325}}If a connection to the database specified by
3229 {0:1326}}connection-\/spec\endNode{} exists already,
3230 conditions are signalled according to the
3233 {0:1327}}if-\/exists\endNode{} parameter, as described
3234 above.\endNode{}\endNode{}\Node%
3238 {0:1329}}See Also\endNode{}\Node%
3246 {0:1333}}connected-\/databases\endNode{}\endNode{}\Node%
3252 {0:1336}}disconnect\endNode{}\endNode{}\endNode{}\endNode{}
3253 \endNode{}\endNode{}\Node%
3257 {0:1338}}Notes\endNode{}\Node%
3259 {0:1339}}None.\endNode{}\endNode{}\endNode{}\Node%
3261 {0:DISCONNECT}}\Node%
3265 {0:1342}}DISCONNECT\endNode{}\Node%
3267 {0:1343}}close a database connection\endNode{}\Node%
3269 {0:1344}}Function\endNode{}\endNode{}\Node%
3273 {0:1346}}Syntax\endNode{}\Node%
3277 {0:1348}}disconnect\endNode{} \Entity{amp}key \Node%
3279 {0:1349}}database\endNode{} =>\/ \Node%
3281 {0:1350}}t\endNode{}\endNode{}\endNode{}\Node%
3285 {0:1352}}Arguments and Values\endNode{}\Node%
3293 {0:1356}}database\endNode{}\endNode{}\Node%
3297 {0:1358}}The database to disconnect, which defaults to the
3298 database indicated by
3301 {0:1359}}*default-\/database*\endNode{}.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
3305 {0:1361}}Description\endNode{}\Node%
3307 {0:1362}}This function takes a \Node%
3309 {0:1363}}database\endNode{} object as
3312 {0:1364}}connect\endNode{}, and closes the
3313 connection. The class of the object passed is changed to
3316 {0:1365}}closed-\/database\endNode{} after the disconnection
3317 succeeds, thereby preventing further use of the object as
3318 an argument to \Node%
3322 {0:1367}}CLSQL\endNode{}\endNode{} functions,
3323 with the exception of \Node%
3325 {0:1368}}database-\/name\endNode{}.
3326 If the user does pass a closed database object to any other
3331 {0:1370}}CLSQL\endNode{}\endNode{} function, an error of type
3334 {0:1371}}maisql-\/closed-\/error\endNode{} is
3335 signalled.\endNode{}\endNode{}\Node%
3339 {0:1373}}Examples\endNode{}\Node%
3341 {0:1374}}(disconnect :database (find-\/database "dent/newesim/dent"))
3343 \endNode{}\endNode{}\Node%
3347 {0:1376}}Side Effects\endNode{}\Node%
3349 {0:1377}}The database connection is closed, and the database
3350 object is removed from the list of connected databases as
3353 {0:1378}}connected-\/databases\endNode{}.\endNode{}\Node%
3355 {0:1379}}The class of the database object is changed to
3358 {0:1380}}closed-\/database\endNode{}.\endNode{}\Node%
3360 {0:1381}}If the database object passed is the same under
3363 {0:1382}}eq\endNode{} as the value of
3366 {0:1383}}*default-\/database*\endNode{}, then
3369 {0:1384}}*default-\/database*\endNode{} is set to the first
3370 remaining database from
3373 {0:1385}}connected-\/databases\endNode{} or to nil if no
3374 further active database exists.\endNode{}\endNode{}\Node%
3378 {0:1387}}Affected by\endNode{}\Node%
3386 {0:1391}}*default-\/database*\endNode{}\endNode{}\endNode{}
3387 \endNode{}\endNode{}\Node%
3391 {0:1393}}Exceptional Situations\endNode{}\Node%
3393 {0:1394}}If during the disconnection attempt an error is
3394 detected (e.g. because of network trouble or any other
3395 cause), an error of type \Node%
3397 {0:1395}}maisql-\/error\endNode{}
3398 might be signalled.\endNode{}\endNode{}\Node%
3402 {0:1397}}See Also\endNode{}\Node%
3412 {0:1402}}connect\endNode{}\endNode{}\endNode{}\Node%
3418 {0:1405}}closed-\/database\endNode{}\endNode{}\endNode{}\endNode{}
3419 \endNode{}\endNode{}\Node%
3423 {0:1407}}Notes\endNode{}\Node%
3425 {0:1408}}None.\endNode{}\endNode{}\endNode{}\Node%
3427 {0:DATABASE-NAME-FROM-SPEC}}\Node%
3431 {0:1411}}DATABASE-\/NAME-\/FROM-\/SPEC\endNode{}\Node%
3433 {0:1412}}Return the database name string corresponding to
3434 the given connection specification.\endNode{}\Node%
3436 {0:1413}}Generic Function\endNode{}\endNode{}\Node%
3440 {0:1415}}Syntax\endNode{}\Node%
3444 {0:1417}}database-\/name-\/from-\/spec\endNode{} \Node%
3446 {0:1418}}connection-\/spec\endNode{} \Node%
3448 {0:1419}}database-\/type\endNode{} =>\/ \Node%
3450 {0:1420}}name\endNode{}\endNode{}\endNode{}\Node%
3454 {0:1422}}Arguments and Values\endNode{}\Node%
3462 {0:1426}}connection-\/spec\endNode{}\endNode{}\Node%
3466 {0:1428}}A connection specification, whose structure and
3467 interpretation are dependent on the
3470 {0:1429}}database-\/type\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
3476 {0:1432}}database-\/type\endNode{}\endNode{}\Node%
3480 {0:1434}}A database type specifier, i.e. a keyword.\endNode{}\endNode{}\endNode{}\Node%
3486 {0:1437}}name\endNode{}\endNode{}\Node%
3490 {0:1439}}A string denoting a database name.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
3494 {0:1441}}Description\endNode{}\Node%
3496 {0:1442}}This generic function takes a connection specification
3497 and a database type and returns the database name of the
3498 database object that would be created had
3501 {0:1443}}connect\endNode{} been called with the given
3502 connection specification and database types.\endNode{}\Node%
3504 {0:1444}}This function is useful in determining a database name
3505 from the connection specification, since the way the
3506 connection specification is converted into a database name
3507 is dependent on the database type.\endNode{}\endNode{}\Node%
3511 {0:1446}}Examples\endNode{}\Node%
3513 {0:1447}}(database-\/name-\/from-\/spec '("dent" "newesim" "dent" "dent") :mysql)
3514 =>\/ "dent/newesim/dent"
3515 (connect '("dent" "newesim" "dent" "dent") :database-\/type :mysql)
3516 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{48391DCD\}>\/
3517 (database-\/name *default-\/database*)
3518 =>\/ "dent/newesim/dent"
3520 (database-\/name-\/from-\/spec '(nil "template1" "dent" nil) :postgresql)
3521 =>\/ "/template1/dent"
3522 (connect '(nil "template1" "dent" nil) :database-\/type :postgresql)
3523 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
3524 (database-\/name *default-\/database*)
3525 =>\/ "/template1/dent"
3527 (database-\/name-\/from-\/spec '("www.pmsf.de" "template1" "dent" nil) :postgresql)
3528 =>\/ "www.pmsf.de/template1/dent"
3530 (find-\/database "dent/newesim/dent")
3531 =>\/ \#\Entity{lt}CLSQL-\/MYSQL:MYSQL-\/DATABASE \{484E91C5\}>\/
3532 (find-\/database "/template1/dent")
3533 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
3534 (find-\/database "www.pmsf.de/template1/dent" nil)
3536 (find-\/database **)
3537 =>\/ \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{48392D2D\}>\/
3538 \endNode{}\endNode{}\Node%
3542 {0:1449}}Side Effects\endNode{}\Node%
3544 {0:1450}}None.\endNode{}\endNode{}\Node%
3548 {0:1452}}Affected by\endNode{}\Node%
3550 {0:1453}}None.\endNode{}\endNode{}\Node%
3554 {0:1455}}Exceptional Situations\endNode{}\Node%
3556 {0:1456}}If the value of \Node%
3558 {0:1457}}connection-\/spec\endNode{}
3559 is not a valid connection specification for the given
3560 database type, an error of type
3563 {0:1458}}maisql-\/invalid-\/spec-\/error\endNode{} might be
3564 signalled.\endNode{}\endNode{}\Node%
3568 {0:1460}}See Also\endNode{}\Node%
3578 {0:1465}}connect\endNode{}\endNode{}\endNode{}\endNode{}
3579 \endNode{}\endNode{}\Node%
3583 {0:1467}}Notes\endNode{}\Node%
3585 {0:1468}}None.\endNode{}\endNode{}\endNode{}\Node%
3587 {0:EXECUTE-COMMAND}}\Node%
3591 {0:1471}}EXECUTE-\/COMMAND\endNode{}\Node%
3593 {0:1472}}Execute an SQL command which returns no
3594 values.\endNode{}\Node%
3596 {0:1473}}Function\endNode{}\endNode{}\Node%
3600 {0:1475}}Syntax\endNode{}\Node%
3604 {0:1477}}execute-\/command\endNode{} \Node%
3606 {0:1478}}sql-\/expression\endNode{} \Entity{amp}key \Node%
3608 {0:1479}}database\endNode{} =>\/ \Node%
3610 {0:1480}}t\endNode{}\endNode{}\endNode{}\Node%
3614 {0:1482}}Arguments and Values\endNode{}\Node%
3622 {0:1486}}sql-\/expression\endNode{}\endNode{}\Node%
3629 expression\endNode{} that represents an SQL
3630 statement which will return no values.\endNode{}\endNode{}\endNode{}\Node%
3636 {0:1492}}database\endNode{}\endNode{}\Node%
3644 object\endNode{}. This will default to the value
3647 {0:1496}}*default-\/database*\endNode{}.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
3651 {0:1498}}Description\endNode{}\Node%
3653 {0:1499}}This will execute the command given by
3656 {0:1500}}sql-\/expression\endNode{} in the
3659 {0:1501}}database\endNode{} specified. If the execution
3660 succeeds it will return \Node%
3662 {0:1502}}t\endNode{}, otherwise an
3663 error of type \Node%
3665 {0:1503}}maisql-\/sql-\/error\endNode{} will
3666 be signalled.\endNode{}\endNode{}\Node%
3670 {0:1505}}Examples\endNode{}\Node%
3672 {0:1506}}(execute-\/command "create table eventlog (time char(30),event char(70))")
3675 (execute-\/command "create table eventlog (time char(30),event char(70))")
3677 >\/>\/ While accessing database \#\Entity{lt}CLSQL-\/POSTGRESQL:POSTGRESQL-\/DATABASE \{480B2B6D\}>\/
3678 >\/>\/ with expression "create table eventlog (time char(30),event char(70))":
3679 >\/>\/ Error NIL: ERROR: amcreate: eventlog relation already exists
3680 >\/>\/ has occurred.
3683 >\/>\/ 0: [ABORT] Return to Top-\/Level.
3685 >\/>\/ Debug (type H for help)
3687 >\/>\/ (CLSQL-\/POSTGRESQL::|(PCL::FAST-\/METHOD DATABASE-\/EXECUTE-\/COMMAND (T POSTGRESQL-\/DATABASE))|
3688 >\/>\/ \#\Entity{lt}unused-\/arg>\/
3689 >\/>\/ \#\Entity{lt}unused-\/arg>\/
3690 >\/>\/ \#\Entity{lt}unavailable-\/arg>\/
3691 >\/>\/ \#\Entity{lt}unavailable-\/arg>\/)
3692 >\/>\/ Source: (ERROR 'CLSQL-\/SQL-\/ERROR :DATABASE DATABASE :EXPRESSION ...)
3695 (execute-\/command "drop table eventlog")
3697 \endNode{}\endNode{}\Node%
3701 {0:1508}}Side Effects\endNode{}\Node%
3703 {0:1509}}Whatever effects the execution of the SQL statement has
3704 on the underlying database, if any.\endNode{}\endNode{}\Node%
3708 {0:1511}}Affected by\endNode{}\Node%
3710 {0:1512}}None.\endNode{}\endNode{}\Node%
3714 {0:1514}}Exceptional Situations\endNode{}\Node%
3716 {0:1515}}If the execution of the SQL statement leads to any
3717 errors, an error of type
3720 {0:1516}}maisql-\/sql-\/error\endNode{} is signalled.\endNode{}\endNode{}\Node%
3724 {0:1518}}See Also\endNode{}\Node%
3734 {0:1523}}query\endNode{}\endNode{}\endNode{}\endNode{}
3735 \endNode{}\endNode{}\Node%
3739 {0:1525}}Notes\endNode{}\Node%
3741 {0:1526}}None.\endNode{}\endNode{}\endNode{}\Node%
3747 {0:1529}}QUERY\endNode{}\Node%
3749 {0:1530}}Execute an SQL query and return the tuples as a
3750 list\endNode{}\Node%
3752 {0:1531}}Function\endNode{}\endNode{}\Node%
3756 {0:1533}}Syntax\endNode{}\Node%
3760 {0:1535}}query\endNode{} \Node%
3762 {0:1536}}query-\/expression\endNode{} \Entity{amp}key \Node%
3764 {0:1537}}database\endNode{} \Node%
3766 {0:1538}}types\endNode{} =>\/ \Node%
3768 {0:1539}}result\endNode{}\endNode{}\endNode{}\Node%
3772 {0:1541}}Arguments and Values\endNode{}\Node%
3780 {0:1545}}query-\/expression\endNode{}\endNode{}\Node%
3787 expression\endNode{} that represents an SQL
3788 query which is expected to return a (possibly empty)
3789 result set.\endNode{}\endNode{}\endNode{}\Node%
3795 {0:1551}}database\endNode{}\endNode{}\Node%
3803 object\endNode{}. This will default to the value
3806 {0:1555}}*default-\/database*\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
3812 {0:1558}}types\endNode{}\endNode{}\Node%
3820 specififier\endNode{}. The default is \Node%
3822 {0:1562}}NIL\endNode{}.
3825 {0:1563}} The purpose of this argument is cause \Node%
3829 {0:1565}}CLSQL\endNode{}\endNode{} to
3830 import SQL numeric fields into numeric Lisp objects
3831 rather than strings. This reduces the cost of
3832 allocating a temporary string and the \Node%
3836 {0:1567}}CLSQL\endNode{}\endNode{} users'
3837 inconvenience of converting number strings into number
3841 {0:1568}} A value of \Node%
3843 {0:1569}}:auto\endNode{} causes \Node%
3847 {0:1571}}CLSQL\endNode{}\endNode{}
3848 to automatically convert SQL fields into a
3849 numeric format where applicable. The default value of
3852 {0:1572}}NIL\endNode{} causes all fields to be returned as strings
3853 regardless of the SQL type. Otherwise a list is expected
3854 which has a element for each field that specifies the
3855 conversion. If the list is shorter than the number
3856 of fields, the a value of \Node%
3858 {0:1573}}t\endNode{} is
3859 assumed for the field. If the list is longer than
3860 the number of fields, the extra elements are
3868 {0:1576}}:int\endNode{} Field is imported as a
3869 signed integer, from 8-\/bits to 64-\/bits depending
3870 upon the field type.
3875 {0:1578}}:double\endNode{} Field is imported as a
3876 double-\/float number.
3881 {0:1580}}t\endNode{} Field is imported as a
3883 \endNode{}\endNode{}
3884 \endNode{}\endNode{}\endNode{}\Node%
3890 {0:1583}}result\endNode{}\endNode{}\Node%
3894 {0:1585}}A list representing the result set obtained. For
3895 each tuple in the result set, there is an element in
3896 this list, which is itself a list of all the attribute
3897 values in the tuple.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
3901 {0:1587}}Description\endNode{}\Node%
3903 {0:1588}}This will execute the query given by
3906 {0:1589}}query-\/expression\endNode{} in the
3909 {0:1590}}database\endNode{} specified. If the execution
3910 succeeds it will return the result set returned by the
3911 database, otherwise an error of type
3914 {0:1591}}maisql-\/sql-\/error\endNode{} will
3915 be signalled.\endNode{}\endNode{}\Node%
3919 {0:1593}}Examples\endNode{}\Node%
3921 {0:1594}}(execute-\/command "create table simple (name char(50), salary numeric(10,2))")
3923 (execute-\/command "insert into simple values ('Mai, Pierre',10000)")
3925 (execute-\/command "insert into simple values ('Hacker, Random J.',8000.50)")
3927 (query "select * from simple")
3928 =>\/ (("Mai, Pierre" "10000.00") ("Hacker, Random J." "8000.50"))
3929 (query "select salary from simple")
3930 =>\/ (("10000.00") ("8000.50"))
3931 (query "select salary from simple where salary >\/ 10000")
3933 (query "select salary,name from simple where salary >\/ 10000")
3935 (query "select salary,name from simple where salary >\/ 9000")
3936 =>\/ (("10000.00" "Mai, Pierre"))
3937 (query "select salary,name from simple where salary >\/ 8000")
3938 =>\/ (("10000.00" "Mai, Pierre") ("8000.50" "Hacker, Random J."))
3940 ;; MySQL-\/specific:
3941 (query "show tables")
3942 =>\/ (("demo") ("log") ("newlog") ("simple") ("spacetrial"))
3943 \endNode{}\endNode{}\Node%
3947 {0:1596}}Side Effects\endNode{}\Node%
3949 {0:1597}}Whatever effects the execution of the SQL query has
3950 on the underlying database, if any.\endNode{}\endNode{}\Node%
3954 {0:1599}}Affected by\endNode{}\Node%
3956 {0:1600}}None.\endNode{}\endNode{}\Node%
3960 {0:1602}}Exceptional Situations\endNode{}\Node%
3962 {0:1603}}If the execution of the SQL query leads to any
3963 errors, an error of type
3966 {0:1604}}maisql-\/sql-\/error\endNode{} is signalled.\endNode{}\endNode{}\Node%
3970 {0:1606}}See Also\endNode{}\Node%
3980 {0:1611}}execute-\/command\endNode{}\endNode{}\endNode{}\endNode{}
3981 \endNode{}\endNode{}\Node%
3985 {0:1613}}Notes\endNode{}\Node%
3987 {0:1614}}None.\endNode{}\endNode{}\endNode{}\Node%
3989 {0:MAP-QUERY}}\Node%
3993 {0:1617}}MAP-\/QUERY\endNode{}\Node%
3995 {0:1618}}Map a function over all the tuples from a
3996 query\endNode{}\Node%
3998 {0:1619}}Function\endNode{}\endNode{}\Node%
4002 {0:1621}}Syntax\endNode{}\Node%
4006 {0:1623}}map-\/query\endNode{} \Node%
4008 {0:1624}}output-\/type-\/spec\endNode{} \Node%
4010 {0:1625}}function\endNode{} \Node%
4012 {0:1626}}query-\/expression\endNode{} \Entity{amp}key \Node%
4014 {0:1627}}database\endNode{} \Node%
4016 {0:1628}}types\endNode{} =>\/ \Node%
4018 {0:1629}}result\endNode{}\endNode{}\endNode{}\Node%
4022 {0:1631}}Arguments and Values\endNode{}\Node%
4030 {0:1635}}output-\/type-\/spec\endNode{}\endNode{}\Node%
4034 {0:1637}}A sequence type specifier or \Node%
4036 {0:1638}}nil\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
4042 {0:1641}}function\endNode{}\endNode{}\Node%
4046 {0:1643}}A function designator.
4049 {0:1644}}function\endNode{} must take as many
4050 arguments as are attributes in the result set returned
4051 by executing the SQL
4054 {0:1645}}query-\/expression\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
4060 {0:1648}}query-\/expression\endNode{}\endNode{}\Node%
4067 expression\endNode{} that represents an SQL
4068 query which is expected to return a (possibly empty)
4069 result set, where each tuple has as many attributes as
4072 {0:1652}}function\endNode{} takes arguments.\endNode{}\endNode{}\endNode{}\Node%
4078 {0:1655}}database\endNode{}\endNode{}\Node%
4086 object\endNode{}. This will default to the value
4089 {0:1659}}*default-\/database*\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
4095 {0:1662}}types\endNode{}\endNode{}\Node%
4101 {0:1665}}field type specififier\endNode{}.
4102 The default is \Node%
4104 {0:1666}}NIL\endNode{}. See \Node%
4108 {0:1668}}query\endNode{}\endNode{}
4109 for the semantics of this argument.
4110 \endNode{}\endNode{}\endNode{}\Node%
4116 {0:1671}}result\endNode{}\endNode{}\Node%
4122 {0:1674}}output-\/type-\/spec\endNode{} is a
4123 type specifier other than \Node%
4125 {0:1675}}nil\endNode{}, then a
4126 sequence of the type it denotes. Otherwise
4129 {0:1676}}nil\endNode{} is returned.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
4133 {0:1678}}Description\endNode{}\Node%
4135 {0:1679}}Applies \Node%
4137 {0:1680}}function\endNode{} to the
4138 attributes of successive tuples in the result set returned
4139 by executing the SQL
4142 {0:1681}}query-\/expression\endNode{}. If the
4145 {0:1682}}output-\/type-\/spec\endNode{} is
4148 {0:1683}}nil\endNode{}, then the result of each application
4151 {0:1684}}function\endNode{} is discarded, and
4154 {0:1685}}map-\/query\endNode{} returns
4157 {0:1686}}nil\endNode{}. Otherwise the result of each
4158 successive application of \Node%
4160 {0:1687}}function\endNode{} is
4161 collected in a sequence of type
4164 {0:1688}}output-\/type-\/spec\endNode{}, where the jths
4165 element is the result of applying
4168 {0:1689}}function\endNode{} to the attributes of the
4169 jths tuple in the result set. The collected sequence is the
4170 result of the call to \Node%
4172 {0:1690}}map-\/query\endNode{}.
4175 {0:1691}}If the \Node%
4177 {0:1692}}output-\/type-\/spec\endNode{} is a
4180 {0:1693}}list\endNode{}, the result will be a
4183 {0:1694}}list\endNode{}.\endNode{}\Node%
4185 {0:1695}}If the \Node%
4187 {0:1696}}result-\/type\endNode{} is a subtype
4190 {0:1697}}vector\endNode{}, then if the implementation can
4191 determine the element type specified for the
4194 {0:1698}}result-\/type\endNode{}, the element type of the
4195 resulting array is the result of
4198 {0:1699}}upgrading\endNode{} that element type; or, if the
4199 implementation can determine that the element type is
4200 unspecified (or \Node%
4202 {0:1700}}*\endNode{}), the element type of the
4203 resulting array is \Node%
4205 {0:1701}}t\endNode{}; otherwise, an error is
4206 signaled.\endNode{}\endNode{}\Node%
4210 {0:1703}}Examples\endNode{}\Node%
4212 {0:1704}}(map-\/query 'list \#'(lambda (salary name)
4213 (declare (ignorable name))
4214 (read-\/from-\/string salary))
4215 "select salary,name from simple where salary >\/ 8000")
4216 =>\/ (10000.0 8000.5)
4218 (map-\/query '(vector double-\/float)
4219 \#'(lambda (salary name)
4220 (declare (ignorable name))
4221 (let ((*read-\/default-\/float-\/format* 'double-\/float))
4222 (coerce (read-\/from-\/string salary) 'double-\/float))
4223 "select salary,name from simple where salary >\/ 8000"))
4224 =>\/ \#(10000.0d0 8000.5d0)
4226 =>\/ (SIMPLE-\/ARRAY DOUBLE-\/FLOAT (2))
4229 (values (map-\/query nil \#'(lambda (salary name)
4230 (push (cons name (read-\/from-\/string salary)) list))
4231 "select salary,name from simple where salary >\/ 8000")
4234 =>\/ (("Hacker, Random J." . 8000.5) ("Mai, Pierre" . 10000.0))
4235 \endNode{}\endNode{}\Node%
4239 {0:1706}}Side Effects\endNode{}\Node%
4241 {0:1707}}Whatever effects the execution of the SQL query has
4242 on the underlying database, if any.\endNode{}\endNode{}\Node%
4246 {0:1709}}Affected by\endNode{}\Node%
4248 {0:1710}}None.\endNode{}\endNode{}\Node%
4252 {0:1712}}Exceptional Situations\endNode{}\Node%
4254 {0:1713}}If the execution of the SQL query leads to any
4255 errors, an error of type
4258 {0:1714}}maisql-\/sql-\/error\endNode{} is signalled.\endNode{}\Node%
4260 {0:1715}}An error of type \Node%
4262 {0:1716}}type-\/error\endNode{} must
4263 be signaled if the \Node%
4265 {0:1717}}output-\/type-\/spec\endNode{} is
4266 not a recognizable subtype of \Node%
4268 {0:1718}}list\endNode{}, not a
4269 recognizable subtype of \Node%
4271 {0:1719}}vector\endNode{}, and not
4274 {0:1720}}nil\endNode{}.\endNode{}\Node%
4276 {0:1721}}An error of type \Node%
4278 {0:1722}}type-\/error\endNode{}
4279 should be signaled if
4282 {0:1723}}output-\/type-\/spec\endNode{} specifies the number
4283 of elements and the size of the result set is different from
4284 that number.\endNode{}\endNode{}\Node%
4288 {0:1725}}See Also\endNode{}\Node%
4298 {0:1730}}query\endNode{}\endNode{}\endNode{}\Node%
4304 {0:1733}}do-\/query\endNode{}\endNode{}\endNode{}\endNode{}
4305 \endNode{}\endNode{}\Node%
4309 {0:1735}}Notes\endNode{}\Node%
4311 {0:1736}}None.\endNode{}\endNode{}\endNode{}\Node%
4317 {0:1739}}DO-\/QUERY\endNode{}\Node%
4319 {0:1740}}Iterate over all the tuples of a
4320 query\endNode{}\Node%
4322 {0:1741}}Macro\endNode{}\endNode{}\Node%
4326 {0:1743}}Syntax\endNode{}\Node%
4330 {0:1745}}do-\/query\endNode{} ((\Entity{amp}rest \Node%
4332 {0:1746}}args\endNode{}) \Node%
4334 {0:1747}}query-\/expression\endNode{} \Entity{amp}key \Node%
4336 {0:1748}}database\endNode{} \Node%
4338 {0:1749}}types\endNode{}) \Entity{amp}body \Node%
4340 {0:1750}}body\endNode{} =>\/ \Node%
4342 {0:1751}}nil\endNode{}\endNode{}\endNode{}\Node%
4346 {0:1753}}Arguments and Values\endNode{}\Node%
4354 {0:1757}}args\endNode{}\endNode{}\Node%
4358 {0:1759}}A list of variable names.\endNode{}\endNode{}\endNode{}\Node%
4364 {0:1762}}query-\/expression\endNode{}\endNode{}\Node%
4371 expression\endNode{} that represents an SQL
4372 query which is expected to return a (possibly empty)
4373 result set, where each tuple has as many attributes as
4376 {0:1766}}function\endNode{} takes arguments.\endNode{}\endNode{}\endNode{}\Node%
4382 {0:1769}}database\endNode{}\endNode{}\Node%
4390 object\endNode{}. This will default to
4393 {0:1773}}*default-\/database*\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
4399 {0:1776}}types\endNode{}\endNode{}\Node%
4405 {0:1779}}field type specififier\endNode{}.
4406 The default is \Node%
4408 {0:1780}}NIL\endNode{}. See \Node%
4412 {0:1782}}query\endNode{}\endNode{}
4413 for the semantics of this argument.
4414 \endNode{}\endNode{}\endNode{}\Node%
4420 {0:1785}}body\endNode{}\endNode{}\Node%
4424 {0:1787}}A body of Lisp code, like in a
4427 {0:1788}}destructuring-\/bind\endNode{} form.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
4431 {0:1790}}Description\endNode{}\Node%
4433 {0:1791}}Executes the \Node%
4435 {0:1792}}body\endNode{} of code
4436 repeatedly with the variable names in
4439 {0:1793}}args\endNode{} bound to the attributes of each
4440 tuple in the result set returned by executing the SQL
4443 {0:1794}}query-\/expression\endNode{} on the
4446 {0:1795}}database\endNode{} specified.\endNode{}\Node%
4448 {0:1796}}The body of code is executed in a block named
4451 {0:1797}}nil\endNode{} which may be returned from prematurely
4454 {0:1798}}return\endNode{} or
4457 {0:1799}}return-\/from\endNode{}. In this case the result
4458 of evaluating the \Node%
4460 {0:1800}}do-\/query\endNode{} form will be
4461 the one supplied to \Node%
4463 {0:1801}}return\endNode{} or
4466 {0:1802}}return-\/from\endNode{}. Otherwise the result will
4469 {0:1803}}nil\endNode{}.\endNode{}\Node%
4471 {0:1804}}The body of code appears also is if wrapped in a
4474 {0:1805}}destructuring-\/bind\endNode{} form, thus allowing
4475 declarations at the start of the body, especially those
4476 pertaining to the bindings of the variables named in
4479 {0:1806}}args\endNode{}.\endNode{}\endNode{}\Node%
4483 {0:1808}}Examples\endNode{}\Node%
4485 {0:1809}}(do-\/query ((salary name) "select salary,name from simple")
4486 (format t "\char126{}30A gets \$\char126{}2,5\$\char126{}\%" name (read-\/from-\/string salary)))
4487 >\/>\/ Mai, Pierre gets \$10000.00
4488 >\/>\/ Hacker, Random J. gets \$08000.50
4491 (do-\/query ((salary name) "select salary,name from simple")
4492 (return (cons salary name)))
4493 =>\/ ("10000.00" . "Mai, Pierre")
4494 \endNode{}\endNode{}\Node%
4498 {0:1811}}Side Effects\endNode{}\Node%
4500 {0:1812}}Whatever effects the execution of the SQL query has
4501 on the underlying database, if any.\endNode{}\endNode{}\Node%
4505 {0:1814}}Affected by\endNode{}\Node%
4507 {0:1815}}None.\endNode{}\endNode{}\Node%
4511 {0:1817}}Exceptional Situations\endNode{}\Node%
4513 {0:1818}}If the execution of the SQL query leads to any
4514 errors, an error of type
4517 {0:1819}}maisql-\/sql-\/error\endNode{} is signalled.\endNode{}\Node%
4519 {0:1820}}If the number of variable names in
4522 {0:1821}}args\endNode{} and the number of attributes in
4523 the tuples in the result set don't match up, an error is
4524 signalled.\endNode{}\endNode{}\Node%
4528 {0:1823}}See Also\endNode{}\Node%
4538 {0:1828}}query\endNode{}\endNode{}\endNode{}\Node%
4544 {0:1831}}map-\/query\endNode{}\endNode{}\endNode{}\endNode{}
4545 \endNode{}\endNode{}\Node%
4549 {0:1833}}Notes\endNode{}\Node%
4551 {0:1834}}None.\endNode{}\endNode{}\endNode{}\Node%
4553 {0:LOOP-TUPLES}}\Node%
4557 {0:1837}}LOOP-\/FOR-\/AS-\/TUPLES\endNode{}\Node%
4559 {0:1838}}Iterate over all the tuples of a
4560 query via a loop clause\endNode{}\Node%
4562 {0:1839}}Loop Clause\endNode{}\endNode{}\Node%
4566 {0:1841}}Compatibility\endNode{}\Node%
4572 {0:1844}}loop-\/for-\/as-\/tuples\endNode{} only works with \Node%
4574 {0:1845}}CMUCL\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
4578 {0:1847}}Syntax\endNode{}\Node%
4582 {0:1849}}var\endNode{} [\Node%
4584 {0:1850}}type-\/spec\endNode{}] being \{each | the\} \{record | records | tuple | tuples\} \{in | of\} \Node%
4586 {0:1851}}query\endNode{} [from \Node%
4588 {0:1852}}database\endNode{}]\endNode{}\endNode{}\Node%
4592 {0:1854}}Arguments and Values\endNode{}\Node%
4600 {0:1858}}var\endNode{}\endNode{}\Node%
4606 {0:1861}}d-\/var-\/spec\endNode{}, as defined in the
4609 {0:1862}}loop\endNode{}-\/clauses in the
4610 ANSI Standard for Common Lisp. This allows for the
4611 usual loop-\/style destructuring.\endNode{}\endNode{}\endNode{}\Node%
4617 {0:1865}}type-\/spec\endNode{}\endNode{}\Node%
4621 {0:1867}}An optional \Node%
4623 {0:1868}}type-\/spec\endNode{} either
4624 simple or destructured, as defined in the grammar for
4627 {0:1869}}loop\endNode{}-\/clauses in the ANSI Standard
4628 for Common Lisp.\endNode{}\endNode{}\endNode{}\Node%
4634 {0:1872}}query\endNode{}\endNode{}\Node%
4641 expression\endNode{} that represents an SQL
4642 query which is expected to return a (possibly empty)
4643 result set, where each tuple has as many attributes as
4646 {0:1876}}function\endNode{} takes arguments.\endNode{}\endNode{}\endNode{}\Node%
4652 {0:1879}}database\endNode{}\endNode{}\Node%
4656 {0:1881}}An optional
4660 object\endNode{}. This will default to the value
4663 {0:1883}}*default-\/database*\endNode{}.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
4667 {0:1885}}Description\endNode{}\Node%
4669 {0:1886}}This clause is an iteration driver for
4672 {0:1887}}loop\endNode{}, that binds the given variable
4673 (possibly destructured) to the consecutive tuples (which are
4674 represented as lists of attribute values) in the result set
4675 returned by executing the SQL \Node%
4677 {0:1888}}query\endNode{}
4678 expression on the \Node%
4680 {0:1889}}database\endNode{}
4681 specified.\endNode{}\endNode{}\Node%
4685 {0:1891}}Examples\endNode{}\Node%
4687 {0:1892}}(defvar *my-\/db* (connect '("dent" "newesim" "dent" "dent"))
4690 (loop with time-\/graph = (make-\/hash-\/table :test \#'equal)
4691 with event-\/graph = (make-\/hash-\/table :test \#'equal)
4692 for (time event) being the tuples of "select time,event from log"
4695 (incf (gethash time time-\/graph 0))
4696 (incf (gethash event event-\/graph 0))
4698 (flet ((show-\/graph (k v) (format t "\char126{}40A =>\/ \char126{}5D\char126{}\%" k v)))
4699 (format t "\char126{}\Entity{amp}Time-\/Graph:\char126{}\%===========\char126{}\%")
4700 (maphash \#'show-\/graph time-\/graph)
4701 (format t "\char126{}\Entity{amp}\char126{}\%Event-\/Graph:\char126{}\%============\char126{}\%")
4702 (maphash \#'show-\/graph event-\/graph))
4703 (return (values time-\/graph event-\/graph)))
4704 >\/>\/ Time-\/Graph:
4708 >\/>\/ test-\/me =>\/ 3000
4710 >\/>\/ Event-\/Graph:
4712 >\/>\/ CLOS Benchmark entry. =>\/ 9000
4713 >\/>\/ Demo Text... =>\/ 3
4714 >\/>\/ doit-\/text =>\/ 3000
4715 >\/>\/ C Benchmark entry. =>\/ 12000
4716 >\/>\/ CLOS Benchmark entry =>\/ 32000
4717 =>\/ \#\Entity{lt}EQUAL hash table, 3 entries \{48350A1D\}>\/
4718 =>\/ \#\Entity{lt}EQUAL hash table, 5 entries \{48350FCD\}>\/
4719 \endNode{}\endNode{}\Node%
4723 {0:1894}}Side Effects\endNode{}\Node%
4725 {0:1895}}Whatever effects the execution of the SQL query has
4726 on the underlying database, if any.\endNode{}\endNode{}\Node%
4730 {0:1897}}Affected by\endNode{}\Node%
4732 {0:1898}}None.\endNode{}\endNode{}\Node%
4736 {0:1900}}Exceptional Situations\endNode{}\Node%
4738 {0:1901}}If the execution of the SQL query leads to any
4739 errors, an error of type
4742 {0:1902}}maisql-\/sql-\/error\endNode{} is signalled.\endNode{}\Node%
4744 {0:1903}}Otherwise, any of the exceptional situations of
4747 {0:1904}}loop\endNode{} applies.\endNode{}\endNode{}\Node%
4751 {0:1906}}See Also\endNode{}\Node%
4761 {0:1911}}query\endNode{}\endNode{}\endNode{}\Node%
4767 {0:1914}}map-\/query\endNode{}\endNode{}\endNode{}\Node%
4773 {0:1917}}do-\/query\endNode{}\endNode{}\endNode{}\endNode{}
4774 \endNode{}\endNode{}\Node%
4778 {0:1919}}Notes\endNode{}\Node%
4780 {0:1920}}None.\endNode{}\endNode{}\endNode{}\endNode{}\Node%
4786 {0:1923}}CLSQL-\/SYS\endNode{}\endNode{}\Node%
4790 {0:1925}}This part gives a reference to all the symbols exported
4791 from the package \Node%
4793 {0:1926}}CLSQL-\/SYS\endNode{}, which are not also
4794 exported from \Node%
4796 {0:1927}}CLSQL\endNode{}. These symbols are part of
4797 the interface for database back-\/ends, but not part of the normal
4798 user-\/interface of \Node%
4802 {0:1929}}CLSQL\endNode{}\endNode{}.\endNode{}\endNode{}\Node%
4804 {0:DATABASE-INITIALIZE-DATABASE-TYPE}}\Node%
4808 {0:1932}}DATABASE-\/INITIALIZE-\/DATABASE-\/TYPE\endNode{}\Node%
4810 {0:1933}}Back-\/end part of \Node%
4814 {0:1935}}initialize-\/database-\/type\endNode{}\endNode{}.\endNode{}\Node%
4816 {0:1936}}Generic Function\endNode{}\endNode{}\Node%
4820 {0:1938}}Syntax\endNode{}\Node%
4824 {0:1940}}database-\/initialize-\/database-\/type\endNode{} \Node%
4826 {0:1941}}database-\/type\endNode{} =>\/ \Node%
4828 {0:1942}}result\endNode{}\endNode{}\endNode{}\Node%
4832 {0:1944}}Arguments and Values\endNode{}\Node%
4840 {0:1948}}database-\/type\endNode{}\endNode{}\Node%
4844 {0:1950}}A keyword indicating the database type to
4845 initialize.\endNode{}\endNode{}\endNode{}\Node%
4851 {0:1953}}result\endNode{}\endNode{}\Node%
4855 {0:1955}}Either \Node%
4857 {0:1956}}t\endNode{} if the initialization
4860 {0:1957}}nil\endNode{} if it fails.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
4864 {0:1959}}Description\endNode{}\Node%
4866 {0:1960}}This generic function implements the main part of the
4867 database type initialization performed by
4870 {0:1961}}initialize-\/database-\/type\endNode{}. After
4873 {0:1962}}initialize-\/database-\/type\endNode{} has checked
4874 that the given database type has not been initialized
4875 before, as indicated by
4878 {0:1963}}*initialized-\/database-\/types*\endNode{}, it will call
4879 this function with the database type as it's sole
4880 parameter. Database back-\/ends are required to define a
4881 method on this generic function which is specialized via an
4882 eql-\/specializer to the keyword representing their database
4883 type.\endNode{}\Node%
4885 {0:1964}}Database back-\/ends shall indicate successful
4886 initialization by returning \Node%
4888 {0:1965}}t\endNode{} from their
4891 {0:1966}}nil\endNode{} otherwise. Methods for
4892 this generic function are allowed to signal errors of type
4895 {0:1967}}maisql-\/error\endNode{} or subtypes thereof.
4896 They may also signal other types of conditions, if
4897 appropriate, but have to document this.\endNode{}\endNode{}\Node%
4901 {0:1969}}Examples\endNode{}\Node%
4903 {0:1970}}\endNode{}\endNode{}\Node%
4907 {0:1972}}Side Effects\endNode{}\Node%
4909 {0:1973}}All necessary side effects to initialize the database
4910 instance.\endNode{}\endNode{}\Node%
4914 {0:1975}}Affected By\endNode{}\Node%
4916 {0:1976}}None.\endNode{}\endNode{}\Node%
4920 {0:1978}}Exceptional Situations\endNode{}\Node%
4922 {0:1979}}Conditions of type \Node%
4924 {0:1980}}maisql-\/error\endNode{}
4925 or other conditions may be signalled, depending on the
4926 database back-\/end.\endNode{}\endNode{}\Node%
4930 {0:1982}}See Also\endNode{}\Node%
4940 {0:1987}}initialize-\/database-\/type\endNode{}\endNode{}\endNode{}\Node%
4946 {0:1990}}*initialized-\/database-\/types*\endNode{}\endNode{}\endNode{}\endNode{}
4947 \endNode{}\endNode{}\Node%
4951 {0:1992}}Notes\endNode{}\Node%
4953 {0:1993}}None.\endNode{}\endNode{}\endNode{}\endNode{}\Node%
4957 {0:1995}}Database Back-\/ends\endNode{}\Node%
4961 {0:1997}}MySQL\endNode{}\Node%
4965 {0:1999}}Libraries\endNode{}\Node%
4967 {0:2000}}The MySQL back-\/end needs access to the MySQL C
4968 client library (\Node%
4970 {0:2001}}libmysqlclient.so\endNode{}).
4971 The location of this library is specified via
4974 {0:2002}}*mysql-\/so-\/load-\/path*\endNode{}, which defaults
4977 {0:2003}}/usr/lib/libmysqlclient.so\endNode{}.
4978 Additional flags to \Node%
4980 {0:2004}}ld\endNode{} needed for
4981 linking are specified via
4984 {0:2005}}*mysql-\/so-\/libraries*\endNode{},
4985 which defaults to \Node%
4987 {0:2006}}("-\/lc")\endNode{}.\endNode{}\endNode{}\Node%
4991 {0:2008}}Initialization\endNode{}\Node%
4996 {0:2010}}(mk:load-\/system :clsql-\/mysql)\endNode{}
4997 to load the MySQL back-\/end. The database type for the MySQL
4998 back-\/end is \Node%
5000 {0:2011}}:mysql\endNode{}.\endNode{}\endNode{}\Node%
5004 {0:2013}}Connection Specification\endNode{}\Node%
5008 {0:2015}}Syntax of connection-\/spec\endNode{}\Node%
5012 {0:2017}}host\endNode{} \Node%
5014 {0:2018}}db\endNode{} \Node%
5016 {0:2019}}user\endNode{} \Node%
5018 {0:2020}}password\endNode{})\endNode{}\endNode{}\Node%
5022 {0:2022}}Description of connection-\/spec\endNode{}\Node%
5030 {0:2026}}host\endNode{}\endNode{}\Node%
5034 {0:2028}}String representing the hostname or IP address
5035 the MySQL server resides on, or \Node%
5037 {0:2029}}nil\endNode{}
5038 to indicate the localhost.\endNode{}\endNode{}\endNode{}\Node%
5044 {0:2032}}db\endNode{}\endNode{}\Node%
5048 {0:2034}}String representing the name of the database on
5049 the server to connect to.\endNode{}\endNode{}\endNode{}\Node%
5055 {0:2037}}user\endNode{}\endNode{}\Node%
5059 {0:2039}}String representing the user name to use for
5060 authentication, or \Node%
5062 {0:2040}}nil\endNode{} to use the
5063 current Unix user ID.\endNode{}\endNode{}\endNode{}\Node%
5069 {0:2043}}password\endNode{}\endNode{}\Node%
5073 {0:2045}}String representing the unencrypted password to
5074 use for authentication, or \Node%
5076 {0:2046}}nil\endNode{} if
5077 the authentication record has an empty password
5078 field.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
5082 {0:2048}}AODBC\endNode{}\Node%
5086 {0:2050}}Libraries\endNode{}\Node%
5088 {0:2051}}The AODBC back-\/end requires access to the ODBC interface
5091 {0:2052}}AllegroCL\endNode{}.\endNode{}\endNode{}\Node%
5095 {0:2054}}Initialization\endNode{}\Node%
5100 {0:2056}}(mk:load-\/system :clsql-\/aodbc)\endNode{}
5101 to load the MySQL back-\/end. The database type for the AODBC
5102 back-\/end is \Node%
5104 {0:2057}}:aodbc\endNode{}.\endNode{}\endNode{}\Node%
5108 {0:2059}}Connection Specification\endNode{}\Node%
5112 {0:2061}}Syntax of connection-\/spec\endNode{}\Node%
5116 {0:2063}}dsn\endNode{} \Node%
5118 {0:2064}}user\endNode{} \Node%
5120 {0:2065}}password\endNode{})\endNode{}\endNode{}\Node%
5124 {0:2067}}Description of connection-\/spec\endNode{}\Node%
5132 {0:2071}}dsn\endNode{}\endNode{}\Node%
5136 {0:2073}}String representing the ODBC data source name.\endNode{}\endNode{}\endNode{}\Node%
5142 {0:2076}}user\endNode{}\endNode{}\Node%
5146 {0:2078}}String representing the user name to use for
5147 authentication.\endNode{}\endNode{}\endNode{}\Node%
5153 {0:2081}}password\endNode{}\endNode{}\Node%
5157 {0:2083}}String representing the unencrypted password to
5158 use for authentication.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
5162 {0:2085}}PostgreSQL\endNode{}\Node%
5166 {0:2087}}Libraries\endNode{}\Node%
5168 {0:2088}}The PostgreSQL back-\/end needs access to the PostgreSQL C
5169 client library (\Node%
5171 {0:2089}}libpq.so\endNode{}). The
5172 location of this library is specified via
5175 {0:2090}}*postgresql-\/so-\/load-\/path*\endNode{}, which defaults
5178 {0:2091}}/usr/lib/libpq.so\endNode{}. Additional flags
5181 {0:2092}}ld\endNode{} needed for linking are
5182 specified via \Node%
5184 {0:2093}}*postgresql-\/so-\/libraries*\endNode{},
5185 which defaults to \Node%
5187 {0:2094}}("-\/lcrypt" "-\/lc")\endNode{}.\endNode{}\endNode{}\Node%
5191 {0:2096}}Initialization\endNode{}\Node%
5196 {0:2098}}(mk:load-\/system :clsql-\/postgresql)\endNode{}
5197 to load the PostgreSQL back-\/end. The database type for the
5198 PostgreSQL back-\/end is \Node%
5200 {0:2099}}:postgresql\endNode{}.\endNode{}\endNode{}\Node%
5204 {0:2101}}Connection Specification\endNode{}\Node%
5208 {0:2103}}Syntax of connection-\/spec\endNode{}\Node%
5212 {0:2105}}host\endNode{} \Node%
5214 {0:2106}}db\endNode{} \Node%
5216 {0:2107}}user\endNode{} \Node%
5218 {0:2108}}password\endNode{} \Entity{amp}optional \Node%
5220 {0:2109}}port\endNode{} \Node%
5222 {0:2110}}options\endNode{} \Node%
5224 {0:2111}}tty\endNode{})\endNode{}\endNode{}\Node%
5228 {0:2113}}Description of connection-\/spec\endNode{}\Node%
5230 {0:2114}}For every parameter in the connection-\/spec,
5233 {0:2115}}nil\endNode{} indicates that the PostgreSQL default
5234 environment variables (see PostgreSQL documentation) will
5235 be used, or if those are unset, the compiled-\/in defaults
5236 of the C client library are used.\endNode{}\Node%
5244 {0:2119}}host\endNode{}\endNode{}\Node%
5248 {0:2121}}String representing the hostname or IP address
5249 the PostgreSQL server resides on. Use the empty
5250 string to indicate a connection to localhost via
5251 Unix-\/Domain sockets instead of TCP/IP.\endNode{}\endNode{}\endNode{}\Node%
5257 {0:2124}}db\endNode{}\endNode{}\Node%
5261 {0:2126}}String representing the name of the database on
5262 the server to connect to.\endNode{}\endNode{}\endNode{}\Node%
5268 {0:2129}}user\endNode{}\endNode{}\Node%
5272 {0:2131}}String representing the user name to use for
5273 authentication.\endNode{}\endNode{}\endNode{}\Node%
5279 {0:2134}}password\endNode{}\endNode{}\Node%
5283 {0:2136}}String representing the unencrypted password to
5284 use for authentication.\endNode{}\endNode{}\endNode{}\Node%
5290 {0:2139}}port\endNode{}\endNode{}\Node%
5294 {0:2141}}String representing the port to use for
5295 communication with the PostgreSQL server.\endNode{}\endNode{}\endNode{}\Node%
5301 {0:2144}}options\endNode{}\endNode{}\Node%
5305 {0:2146}}String representing further runtime options for
5306 the PostgreSQL server.\endNode{}\endNode{}\endNode{}\Node%
5312 {0:2149}}tty\endNode{}\endNode{}\Node%
5316 {0:2151}}String representing the tty or file to use for
5317 debugging messages from the PostgreSQL server.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
5321 {0:2153}}PostgreSQL Socket\endNode{}\Node%
5325 {0:2155}}Libraries\endNode{}\Node%
5327 {0:2156}}The PostgreSQL Socket back-\/end needs
5330 {0:2157}}no\endNode{} access to the PostgreSQL C
5331 client library, since it communicates directly with the
5332 PostgreSQL server using the published frontend/backend
5333 protocol, version 2.0. This eases installation and makes it
5334 possible to dump CMU CL images containing CLSQL and this
5335 backend, contrary to backends which require FFI code.\endNode{}\endNode{}\Node%
5339 {0:2159}}Initialization\endNode{}\Node%
5344 {0:2161}}(mk:load-\/system :clsql-\/postgresql-\/socket)\endNode{}
5345 to load the PostgreSQL Socket back-\/end. The database type for the
5346 PostgreSQL Socket back-\/end is
5349 {0:2162}}:postgresql-\/socket\endNode{}.\endNode{}\endNode{}\Node%
5353 {0:2164}}Connection Specification\endNode{}\Node%
5357 {0:2166}}Syntax of connection-\/spec\endNode{}\Node%
5361 {0:2168}}host\endNode{} \Node%
5363 {0:2169}}db\endNode{} \Node%
5365 {0:2170}}user\endNode{} \Node%
5367 {0:2171}}password\endNode{} \Entity{amp}optional \Node%
5369 {0:2172}}port\endNode{} \Node%
5371 {0:2173}}options\endNode{} \Node%
5373 {0:2174}}tty\endNode{})\endNode{}\endNode{}\Node%
5377 {0:2176}}Description of connection-\/spec\endNode{}\Node%
5385 {0:2180}}host\endNode{}\endNode{}\Node%
5389 {0:2182}}If this is a string, it represents the hostname or
5390 IP address the PostgreSQL server resides on. In
5391 this case communication with the server proceeds via
5392 a TCP connection to the given host and port.\endNode{}\Node%
5394 {0:2183}} If this is a pathname, then it is assumed to name the
5395 directory that contains the server's Unix-\/Domain
5396 sockets. The full name to the socket is then
5397 constructed from this and the port number passed,
5398 and communication will proceed via a connection to
5399 this unix-\/domain socket.\endNode{}\endNode{}\endNode{}\Node%
5405 {0:2186}}db\endNode{}\endNode{}\Node%
5409 {0:2188}}String representing the name of the database on
5410 the server to connect to.\endNode{}\endNode{}\endNode{}\Node%
5416 {0:2191}}user\endNode{}\endNode{}\Node%
5420 {0:2193}}String representing the user name to use for
5421 authentication.\endNode{}\endNode{}\endNode{}\Node%
5427 {0:2196}}password\endNode{}\endNode{}\Node%
5431 {0:2198}}String representing the unencrypted password to
5432 use for authentication. This can be the empty
5433 string if no password is required for
5434 authentication.\endNode{}\endNode{}\endNode{}\Node%
5440 {0:2201}}port\endNode{}\endNode{}\Node%
5444 {0:2203}}Integer representing the port to use for
5445 communication with the PostgreSQL server. This
5446 defaults to 5432.\endNode{}\endNode{}\endNode{}\Node%
5452 {0:2206}}options\endNode{}\endNode{}\Node%
5456 {0:2208}}String representing further runtime options for
5457 the PostgreSQL server.\endNode{}\endNode{}\endNode{}\Node%
5463 {0:2211}}tty\endNode{}\endNode{}\Node%
5467 {0:2213}}String representing the tty or file to use for
5468 debugging messages from the PostgreSQL server.\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\Node%
5474 {0:2216}}This glossary is still very thinly populated, and not all
5475 references in the main text have been properly linked and
5476 coordinated with this glossary. This will hopefully change in
5478 \endNode{}\endNode{}\Node%
5482 {0:2218}}Active database\endNode{}\Node%
5484 {0:2219}}\endNode{}\endNode{}\Node%
5488 {0:2221}}Connection\endNode{}\Node%
5490 {0:2222}}\endNode{}\endNode{}\Node%
5494 {0:2224}}Closed Database\endNode{}\Node%
5498 {0:2226}} An object of type \Node%
5500 {0:2227}}closed-\/database\endNode{}. This is
5501 in contrast to the terms connection, database, active
5504 {0:2228}}database object\endNode{}
5505 which don't include objects which are closed database.
5506 \endNode{}\endNode{}\endNode{}\Node%
5510 {0:2230}}database\endNode{}\Node%
5512 {0:2231}}\endNode{}\endNode{}\Node%
5514 {0:GLOSS-FFI}}\Node%
5516 {0:2233}}Foreign Function Interface
5519 {0:2234}}FFI\endNode{})
5524 {0:2236}} An interface from Common Lisp to a external library which
5525 contains compiled functions written in other programming
5526 languages, typically C.
5527 \endNode{}\endNode{}\endNode{}\Node%
5529 {0:GLOSS-DATABASE-OBJECT}}\Node%
5531 {0:2238}}Database Object\endNode{}\Node%
5535 {0:2240}}An object of type \Node%
5537 {0:2241}}database\endNode{}.\endNode{}\endNode{}\endNode{}\Node%
5539 {0:GLOSS-FIELD-TYPES}}\Node%
5541 {0:2243}}Field Types Specifier\endNode{}\Node%
5545 {0:2245}}A value that specifies the type of each field in a query.\endNode{}\endNode{}\endNode{}\Node%
5547 {0:GLOSS-SQL}}\Node%
5549 {0:2247}}Structured Query Language
5552 {0:2248}}SQL\endNode{})
5557 {0:2250}} An ANSI standard language for storing and retrieving data
5558 in a relational database.
5559 \endNode{}\endNode{}\endNode{}\Node%
5561 {0:GLOSS-SQL-EXPRESSION}}\Node%
5563 {0:2252}}SQL Expression\endNode{}\Node%
5567 {0:2254}}Either a string containing a valid SQL statement, or
5568 an object of type \Node%
5570 {0:2255}}sql-\/expression\endNode{}\Node%
5574 {0:2257}}This has not been implemented yet, so only strings
5575 are valid SQL expressions for the moment.\endNode{}\endNode{}
5576 \endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endNode{}\endFOT{}