tests/sql-oo-test.ss
(require (lib "class.ss")
         (prefix sql-oo: "../sql-oo.ss"))

(define wiki@
  (sql-oo:db-class@ "object_wiki"
                    (author body last_changed)))

(define the-sql-oo%
  (sql-oo:apply-units
   sql-oo:sql-oo%
   wiki@))

(define (test)
  (let ([db (new the-sql-oo% (db-path "/tmp/wiki-test.db"))])
    (send db init-db 'really)
    (let ([Random (send db object (format "/Random/~a" (random)) "object_wiki")]
          [Papers (send db object "/Papers" "object_wiki")])
      (send Random body! "Random body")
      (printf "~a ~a ~a ~a~n" (send Random path) (send Random author) (send Random body) (send Random last_changed))
      (printf "~a ~a~n" (send Papers path) (send Papers type))
      (printf "~a ~a ~a~n" (send Papers author) (send Papers body) (send Papers last_changed))
      (send Papers body! (format "New body ~a" (random)))
      (printf "~a ~a ~a~n" (send Papers author) (send Papers body) (send Papers last_changed)))))