Dot Command - Square Brackets
My understanding that SQL names that
- are SQL keywords OR
- contain special character such as space or hypen
The following work:
- .schema 1980-1982_F
- .schema "1980-1982_F"
- .schema [1980-1982_F]
Likewise for .dump
Is this inconsistency an -ism?
ought to return an error since 1980-1982_F contains special characters.
The [...] name quoting is a Sybase-ism. It is not standard SQL. SQLite does it for compatibility with (sybase-derived) MS SQL Server. The standard way to escape identifiers is double-quotes: "..."
The ".schema" command is part of the CLI, not the core SQLite database engine. The CLI does not implement the [...] Sybase-ism.
Why does this work without double quotes?
Because the ".schema" command is not SQL. It is a CLI built-in. All of the "dot-commands" are special in that way.
I think you are confused about the difference between SQL and the dot-commands in the CLI. The dot-commands are wrappers that transform into other (rather more complex) SQL statements and/or C-apis against the SQLite core. They are not part of the language. They do not follow the same rules.