4 May 2004 Kevin Rosenberg (kevin@rosenberg.net)
* Version 2.10.10-pre
+ * base/loop.lisp: Add object iteration. Use :result-type
+ :auto for result-set. Remove
+ duplicate (and non-correct) code for non-list variables by
+ simply making an atom variable into a list.
+ * sql/package.lisp: Remove unnecessary clsql-sys package
+ and replace it with clsql.
* sql/metaclasses.lisp: Properly store specified-type from
direct-slot-definition and then store translated type in
effective-slot-definition
- * sql/objects.lisp: Use specified type when invocating
- database-get-type-specifier. Return class for def-view-class.
+ * sql/classes.lisp: Don't output type in sql-output
+ for SQL-IDENT-ATTRIBUTE. This is in preparation for supporting
+ [foo :integer] as fields in SELECT.
+ * sql/query.lisp: Set default for :result-types to :auto in
+ FDML QUERY.
+ * sql/objects.lisp: Use specified-type when invocating
+ database-get-type-specifier. def-view-class macro now returns
+ the class instance.
* base/basic-sql.lisp: Make :AUTO the default value for
:RESULT-TYPES for MAP-QUERY and DO-QUERY.
* sql/objects.lisp: Add bigint type
- * base/loop.lisp: Add object iteration. Use :result-type
- :auto for result-set. Remove
- duplicate (and non-correct) code for non-list variables by
- simply making an atom variable into a list.
* test/tests-basic.lisp: Add tests for :result-types for
MAP-QUERY and DO-QUERY
* test/test-fdml.lisp: Add test for result-types in LOOP
and also using single symbol rather than a list for variables.
Add test that default :result-types is auto for FDML QUERY.
- * sql/query.lisp: Set default for :result-types to :auto in
- FDML QUERY.
- * test/test-oodml.lisp: Enable OO loop iteration test with
- slight change.
+ * test/test-syntax.lisp: Don't expect TYPE in the SQL-OUTPUT
+ of SQL-IDENT-ATTRIBUTE.
+ * test/test-oodml.lisp: Enable OO loop iteration test
4 May 2004 Marcus Pearce (m.t.pearce@city.ac.uk)
* Version 2.10.9
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
(defvar +empty-string+ "''")
(if (and (not qualifier) (not type))
(write-string (sql-escape (convert-to-db-default-case
(symbol-name name) database)) *sql-stream*)
+ ;;; KMR: The TYPE field is used by CommonSQL for type conversion -- it
+ ;;; should not be output in SQL statements
+ #+ignore
(format *sql-stream* "~@[~A.~]~A~@[ ~A~]"
(when qualifier
- (convert-to-db-default-case (sql-escape qualifier) database))
+ (convert-to-db-default-case (sql-escape qualifier) database))
(sql-escape (convert-to-db-default-case name database))
(when type
- (convert-to-db-default-case (symbol-name type) database))))
+ (convert-to-db-default-case (symbol-name type) database)))
+ (format *sql-stream* "~@[~A.~]~A"
+ (when qualifier
+ (convert-to-db-default-case (sql-escape qualifier) database))
+ (sql-escape (convert-to-db-default-case name database))))
t))
(defmethod output-sql-hash-key ((expr sql-ident-attribute) database)
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
(defgeneric select (&rest args)
(:documentation
;;;; This file was extracted from the KMRCL utilities
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
#+lispworks
(defun intern-eql-specializer (slot)
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
(eval-when (:compile-toplevel :load-toplevel :execute)
(when (>= (length (generic-function-lambda-list
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
(defclass standard-db-object ()
((view-database :initform nil :initarg :view-database :reader view-database
(defclass ,class ,supers ,slots
,@(if (find :metaclass `,cl-options :key #'car)
`,cl-options
- (cons '(:metaclass clsql-sys::standard-db-class) `,cl-options)))
+ (cons '(:metaclass clsql::standard-db-class) `,cl-options)))
(finalize-inheritance (find-class ',class))
(find-class ',class)))
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
;; Keep a hashtable for mapping symbols to sql generator functions,
;; for use by the bracketed reader syntax.
(eval-when (:compile-toplevel :load-toplevel :execute)
- (defpackage #:clsql-sys
+ (defpackage #:clsql
(:use #:common-lisp #:clsql-base
#+clsql-sbcl-mop #:sb-mop
#+clsql-cmucl-mop #:mop
(setf *packages-for-warn-on-redefinition*
(delete "SQL" *packages-for-warn-on-redefinition* :test 'string=))
-(defpackage #:clsql
- (:use #:common-lisp)
- (:import-from #:clsql-sys . #2#)
- (:export . #2#)
- (:documentation "This is the SQL-Interface package of CLSQL."))
-
(defpackage #:clsql-user
(:use #:common-lisp)
- (:import-from #:clsql-sys . #2#)
+ (:import-from #:clsql . #2#)
(:export . #2#)
(:documentation "This is the user package with CLSQL symbols."))
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
(defun synchronize-keys (src srckey dest destkey)
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
;;; Basic operations on databases
-
(defmethod database-query-result-set ((expr %sql-expression) database
&key full-set result-types)
(database-query-result-set (sql-output expr database) database
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-
-(in-package #:clsql-sys)
+(in-package #:clsql)
(defvar *original-reader-enter* nil)
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(in-package #:clsql-sys)
+(in-package #:clsql)
;; Utilities
(truncate-database :database *default-database*)
(setf *test-database-underlying-type*
- (clsql-sys:database-underlying-type *default-database*))
+ (clsql:database-underlying-type *default-database*))
*default-database*)
;; Ensure slots inherited from standard-classes are :virtual
(deftest :ooddl/metaclass/1
(values
- (clsql-sys::view-class-slot-db-kind
- (clsql-sys::slotdef-for-slot-with-class 'extraterrestrial
+ (clsql::view-class-slot-db-kind
+ (clsql::slotdef-for-slot-with-class 'extraterrestrial
(find-class 'person)))
- (clsql-sys::view-class-slot-db-kind
- (clsql-sys::slotdef-for-slot-with-class 'hobby (find-class 'person))))
+ (clsql::view-class-slot-db-kind
+ (clsql::slotdef-for-slot-with-class 'hobby (find-class 'person))))
:virtual :virtual)
;; Ensure all slots in view-class are view-class-effective-slot-definition
(deftest :ooddl/metaclass/2
(values
(every #'(lambda (slotd)
- (typep slotd 'clsql-sys::view-class-effective-slot-definition))
- (clsql-sys::class-slots (find-class 'person)))
+ (typep slotd 'clsql::view-class-effective-slot-definition))
+ (clsql::class-slots (find-class 'person)))
(every #'(lambda (slotd)
- (typep slotd 'clsql-sys::view-class-effective-slot-definition))
- (clsql-sys::class-slots (find-class 'employee)))
+ (typep slotd 'clsql::view-class-effective-slot-definition))
+ (clsql::class-slots (find-class 'employee)))
(every #'(lambda (slotd)
- (typep slotd 'clsql-sys::view-class-effective-slot-definition))
- (clsql-sys::class-slots (find-class 'company))))
+ (typep slotd 'clsql::view-class-effective-slot-definition))
+ (clsql::class-slots (find-class 'company))))
t t t)
(deftest :ooddl/join/1
(deftest :syntax/ident/5
(clsql:sql [foo :integer])
- "FOO INTEGER")
+ "FOO")
(deftest :syntax/ident/6
(clsql:sql [foo bar :integer])
- "FOO.BAR INTEGER")
+ "FOO.BAR")
(deftest :syntax/ident/7
(clsql:sql ["foo" bar :integer])
- "FOO.BAR INTEGER")
-
+ "FOO.BAR")
(deftest :syntax/value/1
(clsql:sql [any '(3 4)])