[<<][sweb][>>][..]
Tue Sep 29 09:27:08 CEST 2009

Removed database files

hunk ./web-root/lib/db.ss 1
-#lang scheme
-(require (planet untyped/snooze:2:6)
-         (planet untyped/snooze:2:6/sqlite3/sqlite3))
-
-(define-snooze-interface
-  (make-snooze (make-database (string->path "/home/tom/test.db")))) ; TODO: arguments...)))
-  [_$_]
-(provide (all-from-out (planet untyped/snooze:2:6))
-         (snooze-interface-out)
-         (all-defined-out))
-
-         [_$_]
rmfile ./web-root/lib/db.ss
hunk ./web-root/lib/ramblings-dispatch.ss 58
-    (with-input-from-file path
-      (lambda () (read-line))))
+    (with-handlers ((exn:fail:filesystem? false))
+      (with-input-from-file path
+        (lambda () (read-line)))))
hunk ./web-root/lib/ramblings-dispatch.ss 68
-               (b blurbs))
+               (b blurbs)
+               #:when b)
hunk ./web-root/lib/sqlite.ss 1
-#lang scheme/base
-(require
- (planet "sqlite.ss" ("jaymccarthy" "sqlite.plt"))  ;; McCarthy + Welsh
- (planet "sqlite.ss" ("soegaard" "sqlite.plt")))
-
-
-(define db-file "/tmp/test.sqlite")
-
-(define db #f)
-
-(define (create-db!)  [_$_]
-  (begin
-    (with-handlers ((void void)) (delete-file db-file))
-    (set! db (open (string->path db-file)))))
-
-(define (create-table-entries)
- (exec/ignore
-  db
-  #<<SQL
-CREATE TABLE entries (
-  entry_id  INTEGER PRIMARY KEY,
-  title     TEXT,
-  url       TEXT,
-  score     INTEGER )
-SQL
-  ))
-
-(define (insert-entry title url score)
- (insert db (sql (INSERT INTO entries (title url score)
-                         VALUES (,title ,url ,score)))))
-
-(define (dump)
-  (select db (sql (SELECT (title url score)
-                          FROM entries))))
-
-(create-db!)
-(create-table-entries)
-
-(insert-entry "woa" "foofoo" 123)
-(insert-entry "mak" "wabba"  567)
-
rmfile ./web-root/lib/sqlite.ss
hunk ./web-root/lib/test-db.ss 1
-#lang scheme/base
-(require "db.ss")
-(define-syntax-rule (db . exprs) (call-with-connection (lambda () . exprs)))
-
-;; When updating the struct, add do this: "sqlite> ALTER TABLE post ADD date;"
-
-(define-persistent-struct post [_$_]
-  ((title type:string)
-   (date  type:time-utc)
-   (body  type:string)
-   ))
- [_$_]
-(define (all)
-  (let-alias ((P post))
-             (db (find-all (sql:select #:from P)))))
-
-(all)
rmfile ./web-root/lib/test-db.ss



[Reply][About]
[<<][sweb][>>][..]