You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ensure concat ops are used for contains / startswith / endswith independently of datatype #8253
datatypesthings to do with database types, like VARCHAR and othersuse casenot really a feature or a bug; can be support for new DB features or user use cases not anticipated
The existing documentation for these methods only has examples using strings. The examples are not applicable to VARBINARY columns where the queries fail.
When byte strings are stored in the database columns (eg. VARBINARY), you should use standard SQL wildcards with the like() method to represent .contains():
When byte strings are stored in the database columns (eg. VARBINARY), you should use standard SQL wildcards with the like() method to represent .startswith():
When byte strings are stored in the database columns (eg. VARBINARY), you should use standard SQL wildcards with the like() method to represent .endswith():
changed the title [-]Docs: VARBINARY column support for `.contains()`, `.like()`, etc. [/-][+]VARBINARY column support for `.contains()`, `.like()`, etc. [/+]on Jul 13, 2022
changed the title [-]VARBINARY column support for `.contains()`, `.like()`, etc. [/-][+]_Binary column support for string operations - should implement, or raise[/+]on Jul 13, 2022
changed the title [-]_Binary column support for string operations - should implement, or raise[/-][+]ensure concat ops are used for contains / startswith / endswith independently of datatype[/+]on Jul 17, 2022
datatypesthings to do with database types, like VARCHAR and othersuse casenot really a feature or a bug; can be support for new DB features or user use cases not anticipated
Activity
zzzeek commentedon Jul 13, 2022
So I dont think a document here is sufficient, because people tend not to find docs like these.
What I would prefer is:
1 is likely preferable
[-]Docs: VARBINARY column support for `.contains()`, `.like()`, etc. [/-][+]VARBINARY column support for `.contains()`, `.like()`, etc. [/+][-]VARBINARY column support for `.contains()`, `.like()`, etc. [/-][+]_Binary column support for string operations - should implement, or raise[/+]sqla-tester commentedon Jul 17, 2022
Mike Bayer has proposed a fix for this issue in the main branch:
use concat() directly for contains, startswith, endswith https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3996
sqla-tester commentedon Jul 17, 2022
Mike Bayer has proposed a fix for this issue in the rel_1_4 branch:
use concat() directly for contains, startswith, endswith https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3997
[-]_Binary column support for string operations - should implement, or raise[/-][+]ensure concat ops are used for contains / startswith / endswith independently of datatype[/+]use concat() directly for contains, startswith, endswith