-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
datatypesthings to do with database types, like VARCHAR and othersthings 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 anticipatednot really a feature or a bug; can be support for new DB features or user use cases not anticipated
Milestone
Description
Describe the use case
The existing documentation for these methods only has examples using strings. The examples are not applicable to VARBINARY columns where the queries fail.
- ColumnOperators.contains()
- ColumnOperators.endswith()
- ColumnOperators.like()
- ColumnOperators.startswith()
Databases / Backends / Drivers targeted
N/A
Example Use
The respective sections of documentation should be updated with edited text equivalent to the suggestions below:
- When byte strings are stored in the database columns (eg. VARBINARY), you should use standard SQL wildcards with the
like()
method to represent.contains()
:
stmt = select(sometable).where(
sometable.like(func.concat(func.concat('%', 'foobar'.encode()), '%'))
)
Using .contains()
with the same concatenations will produce an equivalent result.
- When byte strings are stored in the database columns (eg. VARBINARY), you should use standard SQL wildcards with the
like()
method to represent.startswith()
:
stmt = select(sometable).where(
sometable.like(func.concat(func.concat('foobar'.encode()), '%'))
)
Using .startswith()
with the same concatenations will produce an equivalent result.
- When byte strings are stored in the database columns (eg. VARBINARY), you should use standard SQL wildcards with the
like()
method to represent.endswith()
:
stmt = select(sometable).where(
sometable.like(func.concat(func.concat('%', 'foobar'.encode())))
)
Using .endswith()
with the same concatenations will produce an equivalent result.
Additional context
N/A
Metadata
Metadata
Assignees
Labels
datatypesthings to do with database types, like VARCHAR and othersthings 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 anticipatednot really a feature or a bug; can be support for new DB features or user use cases not anticipated