1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel arrays namespaces sequences continuations
7 TUPLE: db-pool < pool db params ;
9 : <db-pool> ( params db -- pool )
14 : with-db-pool ( db params quot -- )
15 >r <db-pool> r> with-pool ; inline
17 M: db-pool make-connection ( pool -- )
18 [ params>> ] [ db>> ] bi make-db db-open ;
20 : with-pooled-db ( pool quot -- )
21 [ db swap with-variable ] curry with-pooled-connection ; inline