Will Leshner wrote:

On Dec 20, 2005, at 7:46 AM, John Stanton wrote:

I haven't looked closely at the problem, so these are just first ideas extending CM's approach. Basically there should be no reason to perform any analysis of the SQL since that has already been done and the metalanguage generated. My approach would be to prepare the SQL statement and then use the compiled SQL to generate an UPDATE statement. The existing SQLite VM gives you a model for the framework of your engine.


This sounds like a very interesting idea. Could you be more specific about how you would generate an UPDATE statement from the compiled SQL?
I have only browsed through the compiled SQL/VDBE so I cannot go into detail, but the general idea is you should be able to have your own interpreter which runs the compiled SQL and gives you what you want, a list of table/column names for what is actually read from the database. If any table/column is changed by the editor then you need to know the rowid/table name/column name/new value and that is all you need to construct an UPDATE, which would comprise one or more SQL UPDATE statements. You would also identify calculated values and make them non-changeable.

There may be some gotchas which would make the method difficult but you would achieve the ability to read an arbitrary data set using any SQL SELECT, edit it and write it back to the correct tables. The coding should be relatively simple, but the analysis would be fairly arduous but would leave you with a good knowledge of the SQLite VM.
JS

Reply via email to