update with-db usages
parent
67683dde20
commit
a7027700d1
|
@ -6,13 +6,12 @@ IN: db.pools
|
|||
|
||||
TUPLE: db-pool < pool db ;
|
||||
|
||||
: <db-pool> ( params db -- pool )
|
||||
: <db-pool> ( db -- pool )
|
||||
db-pool <pool>
|
||||
swap >>db
|
||||
swap >>params ;
|
||||
swap >>db ;
|
||||
|
||||
: with-db-pool ( db params quot -- )
|
||||
>r <db-pool> r> with-pool ; inline
|
||||
: with-db-pool ( db quot -- )
|
||||
[ <db-pool> ] dip with-pool ; inline
|
||||
|
||||
M: db-pool make-connection ( pool -- )
|
||||
db>> db-open ;
|
||||
|
|
|
@ -17,19 +17,17 @@ IN: furnace.alloy
|
|||
state-classes ensure-tables
|
||||
user ensure-table ;
|
||||
|
||||
: <alloy> ( responder db params -- responder' )
|
||||
[ [ init-furnace-tables ] with-db ]
|
||||
: <alloy> ( responder db -- responder' )
|
||||
[ [ init-furnace-tables ] with-db ] keep
|
||||
[
|
||||
[
|
||||
<asides>
|
||||
<conversations>
|
||||
<sessions>
|
||||
] 2dip
|
||||
<db-persistence>
|
||||
<check-form-submissions>
|
||||
] 2bi ;
|
||||
<asides>
|
||||
<conversations>
|
||||
<sessions>
|
||||
] dip
|
||||
<db-persistence>
|
||||
<check-form-submissions> ;
|
||||
|
||||
: start-expiring ( db params -- )
|
||||
: start-expiring ( db -- )
|
||||
'[
|
||||
_ _ [ state-classes [ expire-state ] each ] with-db
|
||||
_ [ state-classes [ expire-state ] each ] with-db
|
||||
] 5 minutes every drop ;
|
||||
|
|
|
@ -11,7 +11,7 @@ io.files accessors kernel ;
|
|||
|
||||
[ "auth-test.db" temp-file delete-file ] ignore-errors
|
||||
|
||||
"auth-test.db" temp-file sqlite-db [
|
||||
"auth-test.db" temp-file <sqlite-db> [
|
||||
|
||||
user ensure-table
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ IN: furnace.db
|
|||
|
||||
TUPLE: db-persistence < filter-responder pool ;
|
||||
|
||||
: <db-persistence> ( responder params db -- responder' )
|
||||
: <db-persistence> ( responder db -- responder' )
|
||||
<db-pool> db-persistence boa ;
|
||||
|
||||
M: db-persistence call-responder*
|
||||
|
|
|
@ -48,9 +48,9 @@ M: foo call-responder*
|
|||
<action>
|
||||
[ [ ] "text/plain" <content> exit-with ] >>display ;
|
||||
|
||||
[ "auth-test.db" temp-file sqlite-db delete-file ] ignore-errors
|
||||
[ "auth-test.db" temp-file delete-file ] ignore-errors
|
||||
|
||||
"auth-test.db" temp-file sqlite-db [
|
||||
"auth-test.db" temp-file <sqlite-db> [
|
||||
|
||||
<request> init-request
|
||||
session ensure-table
|
||||
|
|
|
@ -182,7 +182,7 @@ http.server.dispatchers db.tuples ;
|
|||
[ stop-server "Goodbye" "text/html" <content> ] >>display
|
||||
"quit" add-responder ;
|
||||
|
||||
: test-db "test.db" temp-file sqlite-db ;
|
||||
: test-db "test.db" temp-file <sqlite-db> ;
|
||||
|
||||
[ test-db drop delete-file ] ignore-errors
|
||||
|
||||
|
|
|
@ -195,5 +195,5 @@ posting "POSTINGS"
|
|||
<boilerplate>
|
||||
{ planet "planet-common" } >>template ;
|
||||
|
||||
: start-update-task ( db params -- )
|
||||
'[ _ _ [ update-cached-postings ] with-db ] 10 minutes every drop ;
|
||||
: start-update-task ( db -- )
|
||||
'[ _ [ update-cached-postings ] with-db ] 10 minutes every drop ;
|
||||
|
|
|
@ -26,7 +26,7 @@ webapps.user-admin
|
|||
webapps.help ;
|
||||
IN: websites.concatenative
|
||||
|
||||
: test-db ( -- params db ) "resource:test.db" sqlite-db ;
|
||||
: test-db ( -- params db ) "resource:test.db" <sqlite-db> ;
|
||||
|
||||
: init-factor-db ( -- )
|
||||
test-db [
|
||||
|
|
Loading…
Reference in New Issue