projects
/
datasette-pytables.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06bdd1a
)
Parse PyTables expressions without group/order/limit keywords in the query
author
Javier Sancho
<jsf@jsancho.org>
Wed, 23 May 2018 10:08:51 +0000
(12:08 +0200)
committer
Javier Sancho
<jsf@jsancho.org>
Wed, 23 May 2018 10:08:51 +0000
(12:08 +0200)
datasette_pytables/__init__.py
patch
|
blob
|
history
diff --git
a/datasette_pytables/__init__.py
b/datasette_pytables/__init__.py
index 4a7c5c8c3e83af5c4ef5a1f35f97f64b84b2bb63..6e34774bc24e83688571fcac6645741a9c98ba28 100644
(file)
--- a/
datasette_pytables/__init__.py
+++ b/
datasette_pytables/__init__.py
@@
-41,12
+41,12
@@
def _parse_sql(sql, params):
parsed = parse(sql)
except:
# Propably it's a PyTables expression
- for token in ['group by', 'order by', 'limit']:
+ for token in ['group by', 'order by', 'limit'
, ''
]:
res = re.search('(?i)where (.*)' + token, sql)
if res:
modified_sql = re.sub('(?i)where (.*)(' + token + ')', '\g<2>', sql)
parsed = parse(modified_sql)
- parsed['where'] = res.group(1)
+ parsed['where'] = res.group(1)
.strip()
break
# Always a list of fields