Ticket #162 (closed defect)
Contracts not working or documentation incorrect
Reported by: | erast | Owned by: | jaymccarthy |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | jaymccarthy/sqlite.plt | Keywords: | |
Cc: | erich@… | Version: | (4 1) |
Racket Version: | 4.1.5 |
Description
Either I'm systematically doing something wrong, the documentation is not up-to-date, or there is a bug somewhere. The following code yields an error:
#lang scheme
(require (prefix-in sqlite3: (planet jaymccarthy/ sqlite:3)))
(define (test)
(define db (sqlite3:open (build-path "test")))
(sqlite3:exec/ignore
db
"CREATE TABLE ? (notesID INTEGER PRIMARY KEY, data TEXT, timeCreated DATE, timeModified DATE, misc BLOB);"
"test")
db)
(test)
==> procedure exec/ignore: expects 2 arguments, given 3: #<db> "CREATE TABLE ? (notesID INTEGER PRIMARY KEY, data TEXT, timeCreated DATE, timeM... "test"
Worse, I can't get parameter to work at all. Sqlite always reports a syntax error near "?" for the following code:
#lang scheme
(require (prefix-in sqlite3: (planet jaymccarthy/ sqlite:3)))
(define (test)
(define db (sqlite3:open (build-path "test")))
(define stm (sqlite3:prepare db "CREATE TABLE ? (notesID INTEGER PRIMARY KEY, data TEXT, timeCreated DATE, timeModified DATE, misc BLOB);"))
(sqlite3:load-params db stm "name"))
(test)
==> SQLite Error: near "?": syntax error
Are these bugs or am I missing something obvious?