+23 Jun 2004 Kevin Rosenberg <kevin@rosenberg.net>
+ * sql/oodml.lisp: Add keyword :transactions to def-view-from-class
+ to allow specifying transactionless table creation
+ * doc/ref-oodml.lisp: Add new keyword to signature of
+ DEF-VIEW-FROM-CLASS
+
18 Jun 2004 Marcus Pearce <m.t.pearce@city.ac.uk>
* Version 2.11.11
* sql/expressions.lisp: when removing duplicate table identifiers
;;
(defun create-view-from-class (view-class-name
- &key (database *default-database*))
+ &key (database *default-database*)
+ (transactions t))
"Creates a table as defined by the View Class VIEW-CLASS-NAME
in DATABASE which defaults to *DEFAULT-DATABASE*."
(let ((tclass (find-class view-class-name)))
(if tclass
(let ((*default-database* database))
- (%install-class tclass database))
+ (%install-class tclass database :transactions transactions))
(error "Class ~s not found." view-class-name)))
(values))
-(defmethod %install-class ((self standard-db-class) database &aux schemadef)
- (dolist (slotdef (ordered-class-slots self))
- (let ((res (database-generate-column-definition (class-name self)
- slotdef database)))
- (when res
- (push res schemadef))))
- (unless schemadef
- (error "Class ~s has no :base slots" self))
- (create-table (sql-expression :table (view-table self)) (nreverse schemadef)
- :database database
- :constraints (database-pkey-constraint self database))
- (push self (database-view-classes database))
+(defmethod %install-class ((self standard-db-class) database
+ &key (transactions t))
+ (let ((schemadef '()))
+ (dolist (slotdef (ordered-class-slots self))
+ (let ((res (database-generate-column-definition (class-name self)
+ slotdef database)))
+ (when res
+ (push res schemadef))))
+ (unless schemadef
+ (error "Class ~s has no :base slots" self))
+ (create-table (sql-expression :table (view-table self)) (nreverse schemadef)
+ :database database
+ :transactions transactions
+ :constraints (database-pkey-constraint self database))
+ (push self (database-view-classes database)))
t)
(defmethod database-pkey-constraint ((class standard-db-class) database)