: sql-bind-command ( sequence string -- )
f f <statement> [
sqlite-maybe-prepare [
- handle>> '[ [ _ ] 2dip 1+ swap sqlite-bind-text ] each-index
+ handle>> swap sqlite-bind-sequence
] [
sqlite-result-set new-result-set advance-row
] bi
: sql-bind-query ( in-sequence string -- out-sequence )
f f <statement> [
sqlite-maybe-prepare [
- handle>> '[ [ _ ] 2dip 1+ swap sqlite-bind-text ] each-index
+ handle>> swap sqlite-bind-sequence
] [
statement>result-sequence
] bi
: ?when ( object quot -- object' ) dupd when ; inline
+: assoc-with ( object sequence quot -- obj curry )
+ swapd [ [ -rot ] dip call ] 2curry ; inline
+
: sqlite-check-result ( n -- )
{
{ SQLITE_OK [ ] }
: sqlite-next ( prepared -- ? )
sqlite3_step sqlite-step-has-more-rows? ;
+
+: sqlite-bind-sequence ( handle sequence -- )
+ [ 1+ swap sqlite-bind-text ] assoc-with each-index ;