 
 : where-primary-key% ( specs -- )
     " where " 0%
-    find-primary-key dup sql-spec-column-name 0% " = " 0% bind% ;
+    find-primary-key dup column-name>> 0% " = " 0% bind% ;
 
 : where-clause ( specs -- )
     " where " 0%
-    [ " and " 0% ] [ dup sql-spec-column-name 0% " = " 0% bind% ] interleave ;
+    [ " and " 0% ] [ dup column-name>> 0% " = " 0% bind% ] interleave ;
 
 M: sqlite-db <update-tuple-statement> ( class -- statement )
     [

        0%
        " set " 0%
        dup remove-id
        [ ", " 0% ] [ dup sql-spec-column-name 0% " = " 0% bind% ] interleave
        where-primary-key%
    ] sqlite-make ;


        "delete from " 0% 0%
        " where " 0%
        find-primary-key
        dup column-name>> 0% " = " 0% bind%
    ] sqlite-make ;

! : select-interval ( interval name -- ) ;
! : select-sequence ( seq name -- ) ;

M: sqlite-db bind% ( spec -- )
    dup 1, column-name>> ":" prepend 0% ;

M: sqlite-db <select-by-slots-statement> ( tuple class -- statement )
    [
        "select " 0%
        over [ ", " 0% ]
        [ dup column-name>> 0% 2, ] interleave

        " from " 0% 0%
        [ column-name>> swap get-slot-named ] with subset
        dup empty? [ drop ] [ where-clause ] if ";" 0%
    ] sqlite-make ;

