Fix metrics for apps, roles & users

This commit is contained in:
Denis Arh
2020-11-10 09:43:13 +01:00
parent ba753c068f
commit ee67a78f3d
9 changed files with 159 additions and 29 deletions
+3 -1
View File
@@ -18,8 +18,10 @@ func sqlFunctionHandler(f ql.Function) (ql.ASTNode, error) {
if len(f.Arguments) != 2 {
return nil, fmt.Errorf("expecting exactly two arguments for DATE_FORMAT function")
}
return ql.MakeFormattedNode("STRFTIME('%s', %s)", f.Arguments[0], f.Arguments[1]), nil
case "DATE":
// need to convert back to datetime so it can be converted to time.Time
return ql.MakeFormattedNode("STRFTIME('%%Y-%%m-%%dT00:00:00Z', %s)", f.Arguments...), nil
case "DATE_ADD", "DATE_SUB", "STD":
return nil, fmt.Errorf("%q function is currently unsupported in SQLite store backend", f.Name)
}