On 9/13/2012 3:20 PM, Paul Vercellotti wrote:
I'm wondering if there's a way to get "incremental" results to a query after it's started, that includes new records added after the query began?
If records are added by the same transaction that runs the SELECT statements, then they may or may not be observed (imagine for example that the statement has an ORDER BY clause, and a new row is inserted that comes before the row that the statement is currently positioned at).
If records are added by a different transaction (possible in WAL mode), then they definitely will not be observed - that's the whole point of transaction isolation.
That is, we've got a UI view that's showing query results, while a background task is adding records to the database, some of which may match our query. We'd like update the query results view with new records as they're added, without having to repeat the whole query and weed out the results we're already showing?
Put a timestamp on each row, rerun the query with "timestamp > :lastSeenTimestamp" condition.
-- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users