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

SQLite partial indexes support #6643

Open
wants to merge 2 commits into
base: 4.3.x
Choose a base branch
from

Conversation

Vincentv92
Copy link

Q A
Type improvement
Fixed issues

Summary

This adds support for partial indexes to the SQLitePlatform. Similar as the PostgresPlatform provides.

Queries the sqlite_master instead of using PRAGMA because PRAGMA doesn't store the definition
if ($tableIndex['partial'] === 1) {
$idx['where'] = $this->connection->fetchOne(
<<<'SQL'
SELECT SUBSTR(sql, INSTR(sql, 'WHERE') + 6)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SELECT SUBSTR(sql, INSTR(sql, 'WHERE') + 6)
SELECT SUBSTR(sql, INSTR(sql, 'WHERE') + LENGTH('WHERE '))

Question: Is this query somehow affected by the collation of a database so that an all uppercase WHERE would end up in a wrong result?

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

Successfully merging this pull request may close these issues.

3 participants