Skip to content

Commit

Permalink
ported to chicken 5 and prepare release 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
0-8-15 committed Aug 18, 2018
1 parent 3f71a2e commit 78df325
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
17 changes: 17 additions & 0 deletions sqlite3pth.egg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
;; -*- mode: Scheme; -*-
((category db)
(license "BSD")
(author "Jörg F. Wittenberger")
(synopsis "Run SQLite queries asynchronously in pthreads. Supports calling Scheme from SQLite's VFS to supply database block storage.")
(version "0.2.4")
(dependencies pthreads srfi-34 llrb-tree miscmacros srfi-1)
;(doc-from-wiki)
(components
(extension
sqlite3pth
(types-file)
(csc-options "-O3" "-lfa2" "-d2" "-Isqlite" "sqlite/sqlite3.c"
"-C" "-DSQLITE_ENABLE_FTS3"
"-C" "-DSQLITE_ENABLE_FTS3_PARENTHESIS"
)))
)
1 change: 1 addition & 0 deletions sqlite3pth.release-info
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(repo git "git://github.com/0-8-15/{egg-name}.git")
(uri targz "https://github.com/0-8-15/{egg-name}/tarball/{egg-release}")
(release "0.2.4")
(release "0.2.3")
(release "0.2.2")
(release "0.2.1")
Expand Down
32 changes: 25 additions & 7 deletions sqlite3pth.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

;; TODO: integrate with http://www.chust.org/fossils/dbi/index

(use srfi-1 srfi-34 pthreads llrb-tree)
(declare
(fixnum)
(usual-integrations)
Expand Down Expand Up @@ -1006,11 +1005,30 @@ EOF
sqlite3-debug-statements
)

(import scheme foreign
chicken ;; (except chicken add1 sub1 with-exception-handler condition?)
(except srfi-18 raise) srfi-34
srfi-1 extras #;pthreads)
(import scheme)
(cond-expand
(chicken-4
(import scheme foreign
chicken ;; (except chicken add1 sub1 with-exception-handler condition?)
(except srfi-18 raise)
srfi-1 extras)
(use srfi-1 srfi-34 pthreads llrb-tree))
(else
(import
(chicken base)
(chicken type)
(chicken foreign)
(chicken blob)
(chicken fixnum)
(chicken flonum)
(chicken format)
(except srfi-18 raise) srfi-34
(only srfi-1 reverse!)
(only (chicken time) current-milliseconds)
(only miscmacros ensure)
pthreads)))
;; (import util shrdprmtr)
(import (prefix llrb-tree llrb:))
(import (prefix llrb-string-table string-))

#;(define-syntax with-mutex
Expand Down Expand Up @@ -1203,9 +1221,9 @@ EOF
db query
(lambda (result rows cols)
(if (eqv? rows 0)
(apply values (append! seeds (setup-seeds result rows cols)))
(apply values (append seeds (setup-seeds result rows cols)))
(let ((cols (range cols)))
(let loop ((seeds (append! seeds (setup-seeds result rows cols)))
(let loop ((seeds (append seeds (setup-seeds result rows cols)))
(row 0))
(if (eqv? row rows)
(apply values seeds)
Expand Down
2 changes: 1 addition & 1 deletion sqlite3pth.setup
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
(install-extension
'sqlite3pth
'("sqlite3pth.so" "sqlite3pth.import.so" "sqlite3pth.types")
'((version "0.2.3")))
'((version "0.2.4")))
8 changes: 7 additions & 1 deletion tests/run.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
(use sqlite3pth lolevel)
(cond-expand
(chicken-4
(use sqlite3pth lolevel)
(import chicken))
(else
(import sqlite3pth)
(import (chicken memory))))

;; Backing-store is a string of 8x4096 bytes only.
(define-values (vfsfile backing-store)
Expand Down

0 comments on commit 78df325

Please sign in to comment.