Hi there,
Is it possible to get the columns operated on by a WHERE clause from the
sqlite3_stmt once it's been prepared ?
I'm trying to intelligently invalidate cached results after a database UPDATE,
where the results are cached by query. One of the ways the query can be
instantiated is with a variadic WHERE clause, although any writes have to
specify the column(s) being written (there's no variadic UPDATE clause) so as I
see it, I can either:
- invalidate all cached results whenever any write to the tables
involved happens
- force the API clients to specify the dependent columns in any
where... clause separately from the actual SQL
- inspect the sqlite3_stmt to see which columns it depends on, and only
invalidate any results that depend on the column just UPDATEd
- write a SQL WHERE clause parser. Yuk - it's already there!
I'm currently doing the first of these, would love to do the thithd, and I
guess could settle for the second (it's not very elegant though). Sqlite must
*know* which columns are the criteria parts of the query - I guess I just can't
see how to gain access to that information.
I looked at the sqlite3_set_authorizer, but it doesn't seem to have an action
code for examining WHERE - the only codes that use column/table info are UPDATE
(which I already know) and READ (I don't know what this is used for but it
sounds more general than I'd need).
Any help much appreciated :)
Simon
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users