1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
3 (in-package #:clsql-sys)
6 (defmethod database-pkey-constraint ((class standard-db-class)
7 (database clsql-sqlite3:sqlite3-database))
8 (let* ((keys (keyslots-for-class class))
9 (cons (when (= 1 (length keys))
10 (view-class-slot-db-constraints (first keys)))))
11 ;; This method generates primary key constraints part of the table
12 ;; definition. For Sqlite autoincrement primary keys to work properly
13 ;; this part of the table definition must be left out (IFF autoincrement) .
14 (when (or (null cons) ;; didnt have constraints to check
15 ;; didnt have auto-increment
17 +auto-increment-names+