         [ query>> "query" selector set-at ]
     } cleave selector ; inline
 
-: query-write-message ( message -- )
+: write-query-message ( message -- )
     [
         {
             [ flags>> write-int32 ]

        } cleave
    ] (write-message) ; inline

: killcursors-write-message ( message -- )
    [
       [ flags>> write-int32 ]
       [ cursors#>> write-int32 ]


: write-message ( message -- )
    {  
        { [ dup mdb-query-msg? ] [ write-query-message ] }
        { [ dup mdb-insert-msg? ] [ write-insert-message ] }
        { [ dup mdb-update-msg? ] [ write-update-message ] }
        { [ dup mdb-delete-msg? ] [ write-delete-message ] }
        { [ dup mdb-getmore-msg? ] [ write-getmore-message ] }
        { [ dup mdb-killcursors-msg? ] [ write-killcursors-message ] }
    } cond ;
