Repository navigation
fix(sqlite): declare the LIKE escape once - #1082
Conversation
The SQLite builder appends ESCAPE '\' to every LIKE, because utopia-php/query declared none. A coming release of that package declares it itself (appwrite/appwrite#15328), and SQLite refuses the clause twice: LIKE ? ESCAPE '\' ESCAPE '\' is a syntax error. The builder now adds the clause only when the statement does not end in it already, so it works on both sides of that release. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Code review
The SQLite builder continues to add an explicit backslash escape clause for LIKE predicates. It now avoids appending the clause when the parent builder already returns it, supporting both query-builder versions. Walkthrough (1)
Reviewed Tip Comment |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|

The SQLite builder appends
ESCAPE '\'to everyLIKE, becauseutopia-php/querydeclared none. A coming release of that package declares it itself (appwrite/appwrite#15328), and SQLite refuses the clause twice:That is what
LIKE ? ESCAPE '\' ESCAPE '\'gives.What changes
src/Database/Builder/SQLite.php:compileLike()adds the clause only when the statement the parent returns does not already end in it.It works on both sides of the package release, so this can ship first and the package change can follow without a coordinated bump. Once
utopia-php/querywith the declared escape is the minimum version, the override and theESCAPEconstant can go.Tests
The unit suite, on this change:
utopia-php/query^0.7.2)The nine need a database server and fail the same way on main. The 54 that this fixes are the SQLite tests that run a
LIKE,SQLiteLikeEscapeTestamong them; no new test is needed to cover it.Context
appwrite/appwrite#15328 was merged and then taken back out of appwrite's main for this reason (appwrite/appwrite#15734). It re-lands once a release with this change is pinned there.
🤖 Generated with Claude Code
Summary by CodeRabbit