Index: pages/changes.in ================================================================== --- pages/changes.in +++ pages/changes.in @@ -20,10 +20,17 @@ set xrefChng($date) $nChng incr nChng } chng {2019-07-00 (3.29.0)} { +
SQLite supports a limited subset of ALTER TABLE.
The ALTER TABLE command in SQLite allows the user to rename a table,
to rename a column within a table, or to add a new column to an existing table.
-
^(The RENAME TO syntax changes the name of
Beginning with release 3.25.0 ([dateof:3.25.0]), references to the table Index: pages/pragma.in ================================================================== --- pages/pragma.in +++ pages/pragma.in @@ -818,10 +818,13 @@ New applications should leave this flag turned off.
For compatibility with older [virtual table] implementations, this flag is turned on temporarily while the [sqlite3_module.xRename] method is being run. The value of this flag is restore after the [sqlite3_module.xRename] method finishes. +
The legacy alter table behavior can also be toggled on and off + using the [SQLITE_DBCONFIG_LEGACY_ALTER_TABLE] option to the + [sqlite3_db_config()] interface. } Pragma legacy_file_format {
^(PRAGMA legacy_file_format;
PRAGMA legacy_file_format = boolean
-The SQL standard says that one should use double-quotes around identifiers -and single-quotes around string literals. +The SQL standard requires double-quotes around identifiers +and single-quotes around string literals. For example:
SQLite accepts both of the above. But, in an effort to be compatible -with MySQL 3.x (which was very popular when SQLite was first being -designed) SQLite will also use content contained in double-quotes as a s -tring literal if the content does not match any valid identifier. +with MySQL 3.x (which was one of the most widely used RDBMSes +when SQLite was first being designed) SQLite will also interpret +a double-quotes string as +string literal if it does not match any valid identifier.
-An unfortunate side-effect of this is that a misspelled double-quoted +This misfeature means that a misspelled double-quoted identifier will be interpreted as a string literal, rather than generating an error. -Another problem is that this behavior allows developers who are new to -the SQL language to continue using double-quoted string literals when they +It also lures developers who are new to the SQL language into +bad habit of using double-quoted string literals when they really need to learn to use the correct single-quoted string literal form.
In hindsight, we should not have tried to make SQLite accept MySQL 3.x syntax, and should have never allowed double-quoted string literals. -However, we continue to support that capability to avoid breaking legacy -applications. +However, there are countless applications that make use of +double-quoted string literals and so we continue to support +that capability to avoid breaking legacy.
-Update: As of SQLite 3.27.0 ([dateof:3.27.0]) the use of a double-quoted +Updates: +
As of SQLite 3.27.0 ([dateof:3.27.0]) the use of a double-quoted string literal causes a warning message to be sent to the [error log]. +
As of SQLite 3.29.0 ([dateof:3.29.0]) the use of double-quoted +string literals inside of DDL statements ([CREATE TABLE], [CREATE INDEX], +and so forth) is disallowed and will cause a syntax error. Double quoted +strings needed to be deactivated in DDL statements as they were causing +problems for [ALTER TABLE]. +(See the ticket at [https://www.sqlite.org/src/info/9b78184be266f] for +details.) +If needed for compatibility, the older behavior can be restored by +disabling the [SQLITE_DBCONFIG_DQS_DDL] option on the +[sqlite3_db_config()] interface. +
The [SQLITE_DBCONFIG_DQS_DML] option the [sqlite3_db_config()] +interface is available as of SQLite 3.29.0 ([dateof:3.29.0]) and can be +used to disable double-quoted string literals for DML statements. +This setting is currently off by default, but might default on in future +releases of SQLite. Developers are encouraged to turn this setting on +now, in preparation for the future when it might be activated by default. +
The SQL language is rich in keywords.