mirror of
https://github.com/alerta/alerta.git
synced 2025-05-16 14:21:42 +00:00
Replace mongo-specific query stirng syntax with database agnostic (#712)
This commit is contained in:
parent
cc0993d0b2
commit
aeba85a37a
13 changed files with 559 additions and 15 deletions
alerta/database/backends/postgres
|
@ -4,6 +4,7 @@ import pytz
|
|||
from flask import g
|
||||
from werkzeug.datastructures import MultiDict
|
||||
|
||||
from alerta.database.backends.postgres.parser import expression
|
||||
from alerta.database.base import QueryBuilder
|
||||
from alerta.utils.format import DateTime
|
||||
|
||||
|
@ -18,7 +19,8 @@ class QueryBuilderImpl(QueryBuilder):
|
|||
|
||||
# q
|
||||
if params.get('q', None):
|
||||
raise NotImplementedError("'q' search parameter is not currently supported")
|
||||
query = [repr(expression.parseString(params.get('q'))[0])]
|
||||
qvars = dict()
|
||||
else:
|
||||
query = ['1=1']
|
||||
qvars = dict()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue