racket/collects/db/sqlite3.rkt
Matthew Flatt 41e9e3e5ff db: add `sqlite3-available?'
Loading `db/sqlite3' no longer raises an exception if
the SQLite library isn't found. Instead, `sqlite3-connect'
raises an exception, while `sqlite3-available?' reports
whether it will work.

The dynamic test allows the documentation-help system
to continue to work if SQLite3 is not available. Currently,
though, `raco setup' still insists on using SQLite3 to
build the database of documented tags.
2012-11-23 18:44:51 -07:00

18 lines
538 B
Racket

#lang racket/base
(require racket/contract/base
"base.rkt"
"private/sqlite3/main.rkt")
;; FIXME: Contracts duplicated at main.rkt
(provide/contract
[sqlite3-connect
(->* (#:database (or/c path-string? 'memory 'temporary))
(#:mode (or/c 'read-only 'read/write 'create)
#:busy-retry-limit (or/c exact-nonnegative-integer? +inf.0)
#:busy-retry-delay (and/c rational? (not/c negative?))
#:use-place any/c
#:debug? any/c)
connection?)]
[sqlite3-available?
(-> boolean?)])