made requested changes

This commit is contained in:
Kapil Yedidi 2021-02-02 14:07:06 -08:00
parent fd918f06b6
commit 1f16e6eb34
2 changed files with 8 additions and 0 deletions

View File

@ -390,6 +390,10 @@ class Table(object):
return self.table.c[column].like(value) return self.table.c[column].like(value)
if op in ("ilike",): if op in ("ilike",):
return self.table.c[column].ilike(value) return self.table.c[column].ilike(value)
if op in ("notlike",):
return self.table.c[column].notlike(value)
if op in ("notilike",):
return self.table.c[column].notilike(value)
if op in (">", "gt"): if op in (">", "gt"):
return self.table.c[column] > value return self.table.c[column] > value
if op in ("<", "lt"): if op in ("<", "lt"):
@ -404,6 +408,8 @@ class Table(object):
return self.table.c[column] != value return self.table.c[column] != value
if op in ("in",): if op in ("in",):
return self.table.c[column].in_(value) return self.table.c[column].in_(value)
if op in ("notin",):
return self.table.c[column].notin_(value)
if op in ("between", ".."): if op in ("between", ".."):
start, end = value start, end = value
return self.table.c[column].between(start, end) return self.table.c[column].between(start, end)

View File

@ -34,7 +34,9 @@ gte, >= Greater or equal
lte, <= Less or equal lte, <= Less or equal
!=, <>, not Not equal to a single value !=, <>, not Not equal to a single value
in Value is in the given sequence in Value is in the given sequence
notin Value is not in the given sequence
like, ilike Text search, ILIKE is case-insensitive. Use ``%`` as a wildcard like, ilike Text search, ILIKE is case-insensitive. Use ``%`` as a wildcard
notlike Like text search, except check if pattern does not exist
between, .. Value is between two values in the given tuple between, .. Value is between two values in the given tuple
startswith String starts with startswith String starts with
endswith String ends with endswith String ends with