diff options
Diffstat (limited to 'db-sqlite3/sqlite3-methods.lisp')
-rw-r--r-- | db-sqlite3/sqlite3-methods.lisp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db-sqlite3/sqlite3-methods.lisp b/db-sqlite3/sqlite3-methods.lisp new file mode 100644 index 0000000..5ce0ac2 --- /dev/null +++ b/db-sqlite3/sqlite3-methods.lisp @@ -0,0 +1,20 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- + +(in-package #:clsql-sys) + + +(defmethod database-pkey-constraint ((class standard-db-class) + (database clsql-sqlite3:sqlite3-database)) + (let* ((keys (keyslots-for-class class)) + (cons (when (= 1 (length keys)) + (view-class-slot-db-constraints (first keys))))) + ;; This method generates primary key constraints part of the table + ;; definition. For Sqlite autoincrement primary keys to work properly + ;; this part of the table definition must be left out (IFF autoincrement) . + (when (or (null cons) ;; didnt have constraints to check + ;; didnt have auto-increment + (null (intersection + +auto-increment-names+ + (listify cons)))) + (call-next-method)))) + |