File: sqlite3-methods.lisp

package info (click to toggle)
cl-sql 6.7.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 3,552 kB
  • sloc: lisp: 24,508; xml: 17,898; makefile: 487; ansic: 201; sh: 39; cpp: 9
file content (20 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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))))