Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong columnQuoteCharacter default in Schema for sqlite3 #20150

Closed
santilin opened this issue Apr 28, 2024 · 2 comments
Closed

Wrong columnQuoteCharacter default in Schema for sqlite3 #20150

santilin opened this issue Apr 28, 2024 · 2 comments

Comments

@santilin
Copy link
Contributor

Q A
Yii version 2.0.50
PHP version 8.2.18
Operating system linux

The default quote char for columns in sqlite3 is double quote.

From the docs:
"keyword" A keyword in double-quotes is an identifier.
keyword A keyword enclosed in grave accents (ASCII code 96) is an identifier. This is not standard SQL. This quoting mechanism is used by MySQL and is included in SQLite for compatibility.

Should it be changed?

In my extension yii2-sqlite3-full-support I have changed it to the correct value.

santilin added a commit to santilin/yii2-sqlite3-full-support that referenced this issue Apr 28, 2024
Set default identifier quotes to "
Fixed change and rename columns to allow any kind of quotes: ' " [ `
@Tigrov
Copy link
Member

Tigrov commented May 7, 2024

The proposal makes sense. Decided that it is not worth changing in Yii2, since it would be incompatible for already working code.

But this can be changed in Yii3 https://github.com/yiisoft/db-sqlite

@santilin
Copy link
Contributor Author

santilin commented May 7, 2024

I have tested it in Yii2 and the table quote character must be double quote or the queries will fail. This needs testing in Yii3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants