cleaner default value handling

This commit is contained in:
Theo Guidoux 2021-08-16 10:47:05 +02:00
parent 40018eef7f
commit 16269c0d63
No known key found for this signature in database
GPG Key ID: AC97B26A222D0536

View File

@ -50,7 +50,6 @@ class SQLBackend(SingleTextQueryBackend):
)
def __init__(self, sigmaconfig, options):
super().__init__(sigmaconfig)
@ -62,7 +61,7 @@ class SQLBackend(SingleTextQueryBackend):
if "select" in options and options["select"]:
self.select_fields = options["select"].split(',')
else:
self.select_fields = list()
self.select_fields = list("*")
def generateANDNode(self, node):
generated = [ self.generateNode(val) for val in node ]
@ -197,10 +196,7 @@ class SQLBackend(SingleTextQueryBackend):
if self._recursiveFtsSearch(parsed.parsedSearch):
raise NotImplementedError("FullTextSearch not implemented for SQL Backend.")
result = self.generateNode(parsed.parsedSearch)
select = "*"
if self.select_fields:
select = ", ".join(self.select_fields)
select = ", ".join(self.select_fields)
if parsed.parsedAgg:
#Handle aggregation