The DDLDatabase has a configuration option called defaultNameCase, which governs the name case for unquoted identifiers. This is relevant when e.g. a statement like
create table x (i int);
Is executed. Depending on the dialect, this would produce either a table X (e.g. Oracle) or a table x (e.g. PostgreSQL).
This feature needs to be moved into the core as a Settings, such that new functionality, like DDL simulation can decide what case it should translate unquoted identifiers to.
The different options are:
AS_IS (Abc -> Abc)
UPPER (Abc -> ABC)
UPPER_IF_UNQUOTED (Abc -> ABC)
LOWER (Abc -> abc)
LOWER_IF_UNQUOTED (Abc -> abc)
DEFAULT (this depends on the parseDialect)
The different values for DEFAULT are:
a
parseDialect
parseNameCase
✅
DEFAULT
UPPER_IF_UNQUOTED (as specified in the SQL standard)
✅
ACCESS
AS_IS (?)
✅
ASE
AS_IS
✅
COCKROACHDB
LOWER_IF_UNQUOTED
✅
DB2
UPPER_IF_UNQUOTED
✅
DERBY
UPPER_IF_UNQUOTED
✅
FIREBIRD
UPPER_IF_UNQUOTED
✅
H2
UPPER_IF_UNQUOTED
✅
HANA
UPPER_IF_UNQUOTED (?)
✅
HSQLDB
UPPER_IF_UNQUOTED
✅
INFORMIX
LOWER_IF_UNQUOTED
✅
INGRES
UPPER_IF_UNQUOTED (?)
✅
MARIADB
AS_IS (table names in fact depend on the lower_case_table_names flag, see #9795)
✅
MEMSQL
AS_IS (table names in fact depend on the lower_case_table_names flag, see #9795)
✅
MYSQL
AS_IS (table names in fact depend on the lower_case_table_names flag, see #9795)
✅
ORACLE
UPPER_IF_UNQUOTED
✅
POSTGRES
LOWER_IF_UNQUOTED
✅
REDSHIFT
LOWER (will be fixed through #9865)
✅
SQLDATAWAREHOUSE
AS_IS
✅
SQLITE
AS_IS
✅
SQLSERVER
AS_IS
✅
SYBASE
AS_IS
✅
TERADATA
UPPER_IF_UNQUOTED (?)
✅
VERTICA
LOWER_IF_UNQUOTED
We could use the Settings.renderLocale for this, but probably it would be better to also introduce a separate, independent Settings.parseLocale
The
DDLDatabase
has a configuration option calleddefaultNameCase
, which governs the name case for unquoted identifiers. This is relevant when e.g. a statement likeIs executed. Depending on the dialect, this would produce either a table
X
(e.g. Oracle) or a tablex
(e.g. PostgreSQL).This feature needs to be moved into the core as a
Settings
, such that new functionality, like DDL simulation can decide what case it should translate unquoted identifiers to.The different options are:
AS_IS
(Abc
->Abc
)UPPER
(Abc
->ABC
)UPPER_IF_UNQUOTED
(Abc
->ABC
)LOWER
(Abc
->abc
)LOWER_IF_UNQUOTED
(Abc
->abc
)DEFAULT
(this depends on theparseDialect
)The different values for
DEFAULT
are:parseDialect
parseNameCase
DEFAULT
UPPER_IF_UNQUOTED
(as specified in the SQL standard)ACCESS
AS_IS
(?)ASE
AS_IS
COCKROACHDB
LOWER_IF_UNQUOTED
DB2
UPPER_IF_UNQUOTED
DERBY
UPPER_IF_UNQUOTED
FIREBIRD
UPPER_IF_UNQUOTED
H2
UPPER_IF_UNQUOTED
HANA
UPPER_IF_UNQUOTED
(?)HSQLDB
UPPER_IF_UNQUOTED
INFORMIX
LOWER_IF_UNQUOTED
INGRES
UPPER_IF_UNQUOTED
(?)MARIADB
AS_IS
(table names in fact depend on thelower_case_table_names
flag, see #9795)MEMSQL
AS_IS
(table names in fact depend on thelower_case_table_names
flag, see #9795)MYSQL
AS_IS
(table names in fact depend on thelower_case_table_names
flag, see #9795)ORACLE
UPPER_IF_UNQUOTED
POSTGRES
LOWER_IF_UNQUOTED
REDSHIFT
LOWER
(will be fixed through #9865)SQLDATAWAREHOUSE
AS_IS
SQLITE
AS_IS
SQLSERVER
AS_IS
SYBASE
AS_IS
TERADATA
UPPER_IF_UNQUOTED
(?)VERTICA
LOWER_IF_UNQUOTED
We could use the
Settings.renderLocale
for this, but probably it would be better to also introduce a separate, independentSettings.parseLocale