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:
ColumnOperators.contains()
- 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.
ColumnOperators.startswith()
- 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.
ColumnOperators.endswith()
- 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
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.
Databases / Backends / Drivers targeted
N/A
Example Use
The respective sections of documentation should be updated with edited text equivalent to the suggestions below:
ColumnOperators.contains()
like()method to represent.contains():Using
.contains()with the same concatenations will produce an equivalent result.ColumnOperators.startswith()
like()method to represent.startswith():Using
.startswith()with the same concatenations will produce an equivalent result.ColumnOperators.endswith()
like()method to represent.endswith():Using
.endswith()with the same concatenations will produce an equivalent result.Additional context
N/A