added stack effect to quot argument to with-db

made key check in query benchmarks optional
db4
Sascha Matzke 2009-03-07 14:06:53 +01:00
parent ca2459f729
commit aaf887ab1d
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,8 @@ TUPLE: result doc collection index batch lasterror ;
: <result> ( -- ) result new result set ; inline
CONSTANT: CHECK-KEY f
CONSTANT: DOC-SMALL H{ }
CONSTANT: DOC-MEDIUM H{ { "integer" 5 }
@ -164,7 +166,7 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" }
[ '[ _ _ (insert-batch) ] ] [ '[ _ _ (insert) ] ] if ;
: check-for-key ( assoc key -- )
swap key? [ "ups... where's the key" throw ] unless ; inline
CHECK-KEY [ swap key? [ "ups... where's the key" throw ] unless ] [ 2drop ] if ; inline
: find-one ( -- quot: ( -- ) )
collection-name

View File

@ -51,7 +51,7 @@ SYMBOL: mdb-instance
: slave>> ( mdb -- inet )
nodes>> [ f ] dip at inet>> ;
: with-db ( mdb quot -- ... )
: with-db ( mdb quot: ( -- * ) -- * )
[ [ '[ _ [ mdb-instance set ensure-buffer ] keep master>>
[ remote-address set ] keep
binary <client>