summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/coercions.py
diff options
context:
space:
mode:
authorMatias Martinez Rebori <matias.martinez@dinapi.gov.py>2022-09-07 12:36:06 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-09-08 12:15:23 -0400
commit93aaf16727f1750d74df1f37b86fcbc7f4a8b139 (patch)
treef9c7f122e7851ea7be00d52f4de5ef7575f0d4c2 /lib/sqlalchemy/sql/coercions.py
parent06fe424256a80b91e9ff87b3bbe12ea93bc59453 (diff)
downloadsqlalchemy-93aaf16727f1750d74df1f37b86fcbc7f4a8b139.tar.gz
implement icontains, istartswith, iendswith operators
Added long-requested case-insensitive string operators :meth:`_sql.ColumnOperators.icontains`, :meth:`_sql.ColumnOperators.istartswith`, :meth:`_sql.ColumnOperators.iendswith`, which produce case-insensitive LIKE compositions (using ILIKE on PostgreSQL, and the LOWER() function on all other backends) to complement the existing LIKE composition operators :meth:`_sql.ColumnOperators.contains`, :meth:`_sql.ColumnOperators.startswith`, etc. Huge thanks to Matias Martinez Rebori for their meticulous and complete efforts in implementing these new methods. Fixes: #3482 Closes: #8496 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8496 Pull-request-sha: 7287e2c436959fac4fef022f359fcc73d1528211 Change-Id: I9fcdd603716218067547cc92a2b07bd02a2c366b
Diffstat (limited to 'lib/sqlalchemy/sql/coercions.py')
-rw-r--r--lib/sqlalchemy/sql/coercions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py
index 0b250a28e..8074bcf8b 100644
--- a/lib/sqlalchemy/sql/coercions.py
+++ b/lib/sqlalchemy/sql/coercions.py
@@ -354,7 +354,11 @@ def expect(
if not isinstance(
element,
- (elements.ClauseElement, schema.SchemaItem, schema.FetchedValue),
+ (
+ elements.CompilerElement,
+ schema.SchemaItem,
+ schema.FetchedValue,
+ ),
):
resolved = None