Olivier Mascia wrote:
> I have been puzzled about its habit to convert to upper case the beginning of 
> each schema statement
>
> Is there a functional reason to do this?

The documentatin <http://www.sqlite.org/fileformat2.html#sqlite_master>
says:
| The sqlite_master.sql column stores SQL text that describes the object.
| This SQL text is a CREATE TABLE, CREATE VIRTUAL TABLE, CREATE INDEX,
| CREATE VIEW, or CREATE TRIGGER statement that if evaluated against the
| database file when it is the main database of a database connection
| would recreate the object. The text is usually a copy of the original
| statement used to create the object but with normalizations applied so
| that the text conforms to the following rules:
|
| * The CREATE, TABLE, VIEW, TRIGGER, and INDEX keywords at the beginning
|   of the statement are converted to all upper case letters.
| * The TEMP or TEMPORARY keyword is removed if it occurs after the
|   initial CREATE keyword.
| * Any database name qualifier that occurs prior to the name of the
|   object being created is removed.
| * Leading spaces are removed.
| * All spaces following the first two keywords are converted into
|   a single space.
|
| The text in the sqlite_master.sql column is a copy of the original
| CREATE statement text that created the object, except normalized as
| described above and as modified by subsequent ALTER TABLE statements.

It does not say _why_ these normalizations are applied, but I'd guess it
makes searching for specific entries easier.


Regards,
Clemens

Reply via email to