Minor DB cleanup, add an ensure-tables word

db4
Slava Pestov 2008-06-13 20:54:31 -05:00
parent 73aa216d0b
commit a949c10387
2 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,7 @@ M: sqlite-result-set dispose ( result-set -- )
M: sqlite-statement low-level-bind ( statement -- )
[ statement-bind-params ] [ statement-handle ] bi
swap [ [ key>> ] [ value>> ] [ type>> ] tri sqlite-bind-type ] with each ;
[ swap [ key>> ] [ value>> ] [ type>> ] tri sqlite-bind-type ] curry each ;
M: sqlite-statement bind-statement* ( statement -- )
sqlite-maybe-prepare

View File

@ -122,6 +122,9 @@ M: retryable execute-statement* ( statement type -- )
: ensure-table ( class -- )
[ create-table ] curry ignore-errors ;
: ensure-tables ( classes -- )
[ ensure-table ] each ;
: insert-db-assigned-statement ( tuple -- )
dup class
db get db-insert-statements [ <insert-db-assigned-statement> ] cache