Welcome to the CHICKEN Scheme pasting service

sqlite3 egg example added by wasamasa on Thu Nov 19 21:16:22 2020

;; adapted from sqlite3 tests
(define db-timeout 3000)
(define (call-with-database path proc #!optional finalize-statements?)
  (let ((db #f))
    (dynamic-wind
        (lambda ()
          (set! db (open-database path))
          (set-busy-handler! db (make-busy-timeout db-timeout)))
        (lambda ()
          (proc db))
        (lambda ()
          (and-let* ((d db))
            (set! db #f)
            (finalize! d finalize-statements?))))))

(call-with-database db-path
  (lambda (db)
    (execute db sql-statement sql-arg sql-arg2 sql-arg3)))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
       _     __       
  __ _| | __/ _|_ __  
 / _` | |/ / |_| '_ \ 
| (_| |   <|  _| | | |
 \__, |_|\_\_| |_| |_|
    |_|               
Visually impaired? Let me spell it for you (wav file) download WAV