"Noah Hart" <[EMAIL PROTECTED]> wrote:
> 
> However, I cannot find what is the purpose of the compiler option
> SSQLITE_OMIT_PARSER
> 
> Clearly it "Omits" the "Parser", but my real questions are:
> what is the purpose of the parser.
> What are the ramification of omitting it from sqlite?
> 

SQLite, like every other SQL database engine, can be divided
into two logical components.  The front-end or "compiler" reads 
SQL statements and compiles them into bytecode.  The back-end
interprets the bytecode in order to do whatever is the statement
requests.  (Note: SQLite really uses bytecode.  Other SQL engines
do different things - usually they build a tree of some kind and
then the backend walks the tree.  But the concept is the same.)

The frontend of SQLite is the larger of the two components.
The sqlite3_prepare() API is the interface to the front-end.
The sqlite3_stmt object that sqlite3_prepare() returns is
really a little computer program in byte code.  sqlite3_step()
is the interface to the backend.  sqlite3_step is a virtual
machine for interpreting the bytecode.

There is a proprietary extension for SQLite that allows you
to compile SQLite without the compiler frontend.  This makes
the library much smaller.  Sometimes that is important for
embedded devices.  The downside, is that the parser-less
SQLite does not understand SQL.  You have to feed it bytecode
that you generated on a workstation using a version of SQLite
that does have compiler built in.  Typically, the generated
bytecode is put into a special table in the database and you
then run statements by number.  In other words, the embedded
device says things like "I now what to run statement 43 with
parameters 1.43e17, 'hello', and NULL."

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to