It is not the same information.
I want to be able to determine "has the user bound all placeholder values
with data?".
The user provides this as input:
query="SELECT ?, ?10"
data={"0": "data-a", "10": "data-b"}
Note: This IS valid, as they have provided all data for placeholders.
Using the APIs you mentioned:
count=10
name(10) = "?10"
So according to the API, the indexes [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] are
placeholders in the query.
As you can see, only indexes [1, 10] are valid placeholders in the query.
So, as far as I can tell, it is not possible to get this from the API:
query="SELECT ?, ?10"
valid_placeholder_indexes=[1, 10]
It is only possible to get this:
query="SELECT ?, ?10"
maybe_placeholder_indexes=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
On Mon, Jul 22, 2019 at 11:06 AM Simon Slavin <[email protected]> wrote:
> On 22 Jul 2019, at 10:53am, test user <[email protected]>
> wrote:
>
> > A new function could be added:
> >
> > For query string "SELECT ?, ?10"
> >
> > `sqlite3_bind_parameter_valid_indexes() -> [1, 10]`
> >
> > How can I propose adding this?
>
> As given in my previous response, the SQLite library already contains
> these two:
>
> int sqlite3_bind_parameter_count(sqlite3_stmt*);
> const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
>
> Which provide the same information. If you want to create your own
> routine which calls them to make a list, that's fine.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users