#lang racket
(require deta db threading)
(define db
(sqlite3-connect #:database "bug.db"
#:mode 'create))
(define-schema github-user
([id id/f #:primary-key #:auto-increment]
[user-id integer/f] ; racket-stories user-id
[github-id integer/f #:unique] ; github user id
[login string/f #:unique] ; github login (username)
[real-name string/f]
[email string/f]
[avatar-url string/f]
[blog-url string/f]))
(create-table! db 'github-user)
(lookup db (~> (from github-user #:as gu)
(where (= github-id 123))))
; prepare: no such column: GITHUB
; error code: 1
; Context:
; /Applications/Racket v7.4/collects/db/private/sqlite3/connection.rkt:466:0 handle-status*
; /Applications/Racket v7.4/collects/db/private/sqlite3/connection.rkt:422:8
; /Applications/Racket v7.4/collects/db/private/sqlite3/connection.rkt:225:4 prepare1* method in connection%
; /Users/soegaard/Library/Racket/7.4/pkgs/deta-lib/private/query.rkt:23:2
; /Applications/Racket v7.4/collects/db/private/generic/functions.rkt:90:0 compose-statement
; /Applications/Racket v7.4/share/pkgs/db-lib/db/private/generic/functions2.rkt:64:0
; /Users/soegaard/Library/Racket/7.4/pkgs/deta-lib/query.rkt:254:0 unpack219
; /Users/soegaard/Library/Racket/7.4/pkgs/deta-lib/query.rkt:267:0 lookup
; "/Users/soegaard/tmp/bug.rkt":1:1 [running body]
; [Due to errors, REPL is just module language, requires, and stub definitions]