removed with-datastack usage (using output>array)
made dirty-flag handling optionaldb4
parent
57b3801992
commit
8965b31325
|
@ -1,7 +1,7 @@
|
|||
|
||||
USING: accessors arrays assocs bson.constants classes classes.tuple
|
||||
combinators continuations fry kernel mongodb.driver sequences strings
|
||||
vectors words ;
|
||||
vectors words combinators.smart ;
|
||||
|
||||
IN: mongodb.tuple
|
||||
|
||||
|
@ -50,7 +50,7 @@ CONSTANT: MDB_COLLECTION_MAP "_mdb_col_map"
|
|||
PRIVATE>
|
||||
|
||||
: MDB_ADDON_SLOTS ( -- slots )
|
||||
{ } [ MDB_OID_FIELD MDB_META_FIELD ] with-datastack ; inline
|
||||
[ MDB_OID_FIELD MDB_META_FIELD ] output>array ; inline
|
||||
|
||||
: link-class ( collection class -- )
|
||||
over classes>>
|
||||
|
|
|
@ -7,8 +7,6 @@ SINGLETONS: +fieldindex+ +compoundindex+ +deepindex+ ;
|
|||
|
||||
IN: mongodb.tuple.index
|
||||
|
||||
FROM: mongodb.tuple => +fieldindex+ +compoundindex+ +deepindex+ ;
|
||||
|
||||
TUPLE: tuple-index name spec ;
|
||||
|
||||
<PRIVATE
|
||||
|
|
|
@ -52,12 +52,12 @@ TUPLE: cond-value value quot ;
|
|||
CONSTRUCTOR: cond-value ( value quot -- cond-value ) ;
|
||||
|
||||
: write-mdb-persistent ( value quot: ( tuple -- assoc ) -- value' )
|
||||
over needs-store?
|
||||
[ over [ (( tuple -- assoc )) call-effect ] dip
|
||||
[ tuple-collection name>> ] keep
|
||||
[ add-storable ] dip
|
||||
] [ drop ] if
|
||||
[ tuple-collection name>> ] [ _id>> ] bi <objref> ; inline
|
||||
over needs-store? mdb-dirty-handling? get and
|
||||
[ over [ (( tuple -- assoc )) call-effect ] dip
|
||||
[ tuple-collection name>> ] keep
|
||||
[ add-storable ] dip
|
||||
] [ drop ] if
|
||||
[ tuple-collection name>> ] [ _id>> ] bi <objref> ; inline
|
||||
|
||||
: write-field ( value quot: ( tuple -- assoc ) -- value' )
|
||||
<cond-value> {
|
||||
|
|
|
@ -12,6 +12,8 @@ CONSTANT: MDB_DIRTY_ADVICE "mdb-dirty-set"
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYMBOL: mdb-dirty-handling?
|
||||
|
||||
: advised-with? ( name word loc -- ? )
|
||||
word-prop key? ; inline
|
||||
|
||||
|
|
Loading…
Reference in New Issue