Merge pull request #360 from kapily/master

More functions for generate clause
This commit is contained in:
Friedrich Lindenberg 2021-02-08 10:57:55 +01:00 committed by GitHub
commit d230a7912b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
if op in ("ilike",):
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"):
return self.table.c[column] > value
if op in ("<", "lt"):
@ -404,6 +408,8 @@ class Table(object):
return self.table.c[column] != value
if op in ("in",):
return self.table.c[column].in_(value)
if op in ("notin",):
return self.table.c[column].notin_(value)
if op in ("between", ".."):
start, end = value
return self.table.c[column].between(start, end)

View File

@ -34,7 +34,9 @@ gte, >= Greater or equal
lte, <= Less or equal
!=, <>, not Not equal to a single value
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
notlike Like text search, except check if pattern does not exist
between, .. Value is between two values in the given tuple
startswith String starts with
endswith String ends with