make postgresql pass unit tests

db4
Doug Coleman 2008-02-27 18:47:14 -06:00
parent fa162d843f
commit 3fcac9bd3d
2 changed files with 10 additions and 6 deletions

View File

@ -67,8 +67,8 @@ person "PERSON"
"billy" 10 3.14 <person> the-person1 set "billy" 10 3.14 <person> the-person1 set
"johnny" 10 3.14 <person> the-person2 set "johnny" 10 3.14 <person> the-person2 set
test-sqlite ! test-sqlite
! test-postgresql test-postgresql
person "PERSON" person "PERSON"
{ {
@ -81,8 +81,8 @@ person "PERSON"
1 "billy" 10 3.14 <assigned-person> the-person1 set 1 "billy" 10 3.14 <assigned-person> the-person1 set
2 "johnny" 10 3.14 <assigned-person> the-person2 set 2 "johnny" 10 3.14 <assigned-person> the-person2 set
test-sqlite ! test-sqlite
! test-postgresql test-postgresql
TUPLE: paste n summary author channel mode contents timestamp annotations ; TUPLE: paste n summary author channel mode contents timestamp annotations ;
TUPLE: annotation n paste-id summary author mode contents ; TUPLE: annotation n paste-id summary author mode contents ;

View File

@ -63,10 +63,14 @@ HOOK: insert-tuple* db ( tuple statement -- )
: sql-props ( class -- columns table ) : sql-props ( class -- columns table )
dup db-columns swap db-table ; dup db-columns swap db-table ;
: with-disposals ( seq quot -- )
[ with-disposal ] curry each ;
: create-table ( class -- ) : create-table ( class -- )
create-sql-statement [ execute-statement ] with-disposal ; create-sql-statement [ execute-statement ] with-disposals ;
: drop-table ( class -- ) : drop-table ( class -- )
drop-sql-statement [ execute-statement ] with-disposal ; drop-sql-statement [ execute-statement ] with-disposals ;
: insert-native ( tuple -- ) : insert-native ( tuple -- )
dup class <insert-native-statement> [ dup class <insert-native-statement> [