X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fref.sgml;h=a24ae22b0d337952b4fba2c2af9f476c0c715c1d;hb=17c4d99ca97dbdec882028929d645e16164b4b0b;hp=71d6da3a3afb6af0053ac3b702df619b4c6e4226;hpb=8213ff48f5362c3d4792444c929f50bd128bd044;p=clsql.git diff --git a/doc/ref.sgml b/doc/ref.sgml index 71d6da3..a24ae22 100644 --- a/doc/ref.sgml +++ b/doc/ref.sgml @@ -1780,7 +1780,7 @@ Syntax - query query-expression &key database => result + query query-expression &key database types => result Arguments and Values @@ -1803,6 +1803,48 @@ of *default-database*. + + types + + A + field type + specififier. The default is &nil;. + + + The purpose of this argument is cause &clsql; to + import SQL numeric fields into numeric Lisp objects + rather than strings. This reduces the cost of + allocating a temporary string and the &clsql; users' + inconvenience of converting number strings into number + objects. + + + A value of :auto causes &clsql; + to automatically convert SQL fields into a + numeric format where applicable. The default value of + &nil; causes all fields to be returned as strings + regardless of the SQL type. Otherwise a list is expected + which has a element for each field that specifies the + conversion. If the list is shorter than the number + of fields, the a value of t is + assumed for the field. If the list is longer than + the number of fields, the extra elements are + ignored. + + :int Field is imported as a + signed integer, from 8-bits to 64-bits depending + upon the field type. + + :double Field is imported as a + double-float number. + + t Field is imported as a + string. + + + + + result @@ -1889,7 +1931,7 @@ Syntax - map-query output-type-spec function query-expression &key database => result + map-query output-type-spec function query-expression &key database types => result Arguments and Values @@ -1929,6 +1971,17 @@ of *default-database*. + + types + + + A field type specififier. + The default is &nil;. See query + for the semantics of this argument. + + + result @@ -1985,8 +2038,9 @@ (map-query '(vector double-float) #'(lambda (salary name) (declare (ignorable name)) - (coerce (read-from-string salary) 'double-float)) - "select salary,name from simple where salary > 8000") + (let ((*read-default-float-format* 'double-float)) + (coerce (read-from-string salary) 'double-float)) + "select salary,name from simple where salary > 8000")) => #(10000.0d0 8000.5d0) (type-of *) => (SIMPLE-ARRAY DOUBLE-FLOAT (2)) @@ -2048,7 +2102,7 @@ Syntax - do-query ((&rest args) query-expression &key database) &body body => nil + do-query ((&rest args) query-expression &key database types) &body body => nil Arguments and Values @@ -2078,6 +2132,17 @@ *default-database*. + + types + + + A field type specififier. + The default is &nil;. See query + for the semantics of this argument. + + + body @@ -2163,6 +2228,10 @@ query via a loop clause Loop Clause + + Compatibility + loop-for-as-tuples only works with &cmucl;. + Syntax var [type-spec] being {each | the} {record | records | tuple | tuples} {in | of} query [from database] @@ -2289,6 +2358,7 @@ + <symbol>CLSQL-SYS</symbol> @@ -2297,11 +2367,6 @@ exported from CLSQL. These symbols are part of the interface for database back-ends, but not part of the normal user-interface of &clsql;. - - This part has only one demonstration entry, since the - rest still has to be written. In the meantime, use the - source to understand the database back-end interface. -