Daniel Önnerby wrote:
> Hi everyone!
>
> I'm just a bit curios if it would be possible to make like a C
> precompiler or a macro of some kind that compiles/interpret the
> SQL-statements to bytecode just like the sqlite_prepare does but does
> this when compiling/precompiling your application instead of at
> runtime. Since most application written in C/C++ use static
> SQL-statements (unless you are building your SQL-strings on the fly)
> and then bind the values, I guess there would be several benefits for
> your compiled application:
> * Faster: Since the SQL-statement is already interpreted.
> * Smaller (not that sqlite needs to be smaller): The executable does
> not need to contain the part of sqlite that interprets the
> SQL-statements since this was made at compile time.
>
> Just a thought :)
>
> Best regards
> Daniel Önnerby
>
I second this. I use a lot of different database handles (due to a lot
of multi-threading), so there's no way I've seen yet to compile an sql
query that i can distribute to the different handles, so every statement
gets prepared just before run. Huge performance hit. If we could even
just pre-compile once per run, and attach to a database handle afterwards...

-- 
Bill King, Software Engineer
Trolltech, Brisbane Technology Park
26 Brandl St, Eight Mile Plains, 
QLD, Australia, 4113
Tel + 61 7 3219 9906 (x137)
Fax + 61 7 3219 9938
mobile: 0423 532 733

Reply via email to