Oh right, didn't really think about that one. What about binding the array though, maybe a bind_array call that specifies that a given parameter will be an array, and then push elements with the regular bind calls?
On Sat, Sep 16, 2017 at 8:51 AM Darren Duncan <dar...@darrenduncan.net> wrote: > I agree that being able to bind Array values is very useful, but this > shouldn't > need any new syntax in the SQL, the same ? should be acceptable; this > shouldn't > be any different than the distinction between binding a number vs text > etc. -- > Darren Duncan > > On 2017-09-15 11:40 PM, Wout Mertens wrote: > > I am wondering if the sqlite API could be changed to accommodate array > > parameters, for example when using the literal `@?`. > > > > This would be handy when specifying `INSERT INTO t(@?) VALUES(@?)` or > `SELECT > > * FROM t WHERE v IN (@?)`. > > > > Apart from the ease of use benefit, I think this will help with prepared > > statement reuse. > > > > I'm not sure what the bind interface would look like, since each array > > entry can have a different type. How about binding a value on the array > > parameter index pushes onto the parameter array value? So to populate the > > array value, call the bind functions on the same index, in array order. > > > > It would also be nice to have a way to detect if the API supports array > > parameters. How to do that, performing a query and see it fail, or is > there > > some function to request capabilities? > > > > The literals could accommodate naming and numbering parameters with > `@:AAA` > > and `@?NNN` syntaxes. > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users