#4 Add SQLITE_CONSTRAINT_UNIQUE; Add sqlite-busy-timeout.

Затворени
dannym заяви обединяване на 2 ревизии от dannym/20180324 във guile-sqlite3/master
променени са 2 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 12 0
      sqlite3.scm
  2. 2 0
      tests/basic.test

+ 12 - 0
sqlite3.scm

@@ -48,6 +48,7 @@
             sqlite-reset
             sqlite-finalize
             sqlite-bind-parameter-index
+            sqlite-busy-timeout
 
             SQLITE_OPEN_READONLY
             SQLITE_OPEN_READWRITE
@@ -511,6 +512,17 @@ Also bind named parameters to the respective ones."
             (lp (1+ i)))
           v))))
 
+(define sqlite-busy-timeout
+  (let ((f (pointer->procedure
+            int
+            (dynamic-func "sqlite3_busy_timeout" libsqlite3)
+            (list '* int))))
+    (lambda (db value)
+      (assert-live-db! db)
+      (let ((ret (f (db-pointer db) value)))
+        (when (not (zero? ret))
+          (check-error db 'sqlite-busy-timeout))))))
+
 (define sqlite-step
   (let ((step (pointer->procedure
                int

+ 2 - 0
tests/basic.test

@@ -41,6 +41,8 @@
                                         SQLITE_OPEN_READWRITE)))
 (format #t "~40tOk~%")
 
+(sqlite-busy-timeout db 20)
+
 (format #t "Creating table 'project':")
 (sqlite-exec
  db