|
|
|
@ -8,6 +8,12 @@ export function processSQLLimitOffset(sql: string, limit: number, offset: number
|
|
|
|
|
} |
|
|
|
|
sql = splits[0]; // removes ";" from EOL
|
|
|
|
|
|
|
|
|
|
const reAggregation = /\$__timeGroup(?:Alias)?\(\s*([^,]+)\s*,\s*\$__interval[^\)]*\)/igm; |
|
|
|
|
const occurence = reAggregation.exec(sql); |
|
|
|
|
if(occurence) { |
|
|
|
|
sql = sql.replace(reAggregation, occurence[1]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let relim = /limit [0-9]+/ig; |
|
|
|
|
let reoff = /offset [0-9]+/ig; |
|
|
|
|
|
|
|
|
|