Check-in [86bf6c2faf]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:use int64 instead of int for sqlite3 bind, minor fix in sqlite3_finalize
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 86bf6c2faf5798c2fc022e13d20925ba8bfc43f6
User & Date: aldo 2017-08-01 11:23:12
Context
2017-09-11
21:16
fixed escaped double quote bug in json parser check-in: 15097c3329 user: aldo tags: trunk
2017-08-01
11:23
use int64 instead of int for sqlite3 bind, minor fix in sqlite3_finalize check-in: 86bf6c2faf user: aldo tags: trunk
11:22
added (load/save)-bytevector to thunder-utils check-in: d396379ac9 user: aldo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to sqlite3.sls.

298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
	[(not (database-ptr x))
	 (void)]
	[(let loop ([stmt
		     (and
		      finalize-statements?
		      (sqlite3-next-stmt x))])
	   (if stmt
	       (or (sqlite3_finalize (statement-addr x))
		   (loop (sqlite3-next-stmt (statement-database x))))
	       (let ([f (foreign-procedure "sqlite3_close" (sqlite3:database*) int)])
		 (f (database-addr x)))))
	 => (abort-sqlite3-error 'finalize! x x)])]
      [(statement? x)
       (cond
	[(not (statement-ptr x))
	 (void)]
................................................................................
   (cond
    [(bytevector? v)
     (cond [((foreign-procedure "sqlite3_bind_blob" (sqlite3:statement* int u8* int void*) int)
             (statement-addr stmt) (fx+ i 1) v (bytevector-length v) SQLITE_TRANSIENT)
            => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]
    [(or (and (fixnum? v) v) (and (boolean? v) (if v 1 0)))
     => (lambda (v)
          (cond [((foreign-procedure "sqlite3_bind_int"
                                     (sqlite3:statement* int int) int)
                  (statement-addr stmt) (fx+ i 1) v)
                 => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)]))]
    [(real? v)
     (cond [((foreign-procedure "sqlite3_bind_double"
                                (sqlite3:statement* int double) int)
             (statement-addr stmt) (fx+ i 1) (exact->inexact v))
            => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]







|
|







 







|
|







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
	[(not (database-ptr x))
	 (void)]
	[(let loop ([stmt
		     (and
		      finalize-statements?
		      (sqlite3-next-stmt x))])
	   (if stmt
	       (or (sqlite3_finalize (statement-ptr stmt))
		   (loop (sqlite3-next-stmt (statement-database stmt))))
	       (let ([f (foreign-procedure "sqlite3_close" (sqlite3:database*) int)])
		 (f (database-addr x)))))
	 => (abort-sqlite3-error 'finalize! x x)])]
      [(statement? x)
       (cond
	[(not (statement-ptr x))
	 (void)]
................................................................................
   (cond
    [(bytevector? v)
     (cond [((foreign-procedure "sqlite3_bind_blob" (sqlite3:statement* int u8* int void*) int)
             (statement-addr stmt) (fx+ i 1) v (bytevector-length v) SQLITE_TRANSIENT)
            => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]
    [(or (and (fixnum? v) v) (and (boolean? v) (if v 1 0)))
     => (lambda (v)
          (cond [((foreign-procedure "sqlite3_bind_int64"
                                     (sqlite3:statement* int integer-64) int)
                  (statement-addr stmt) (fx+ i 1) v)
                 => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)]))]
    [(real? v)
     (cond [((foreign-procedure "sqlite3_bind_double"
                                (sqlite3:statement* int double) int)
             (statement-addr stmt) (fx+ i 1) (exact->inexact v))
            => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]