mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Updated data query limits.
This commit is contained in:
parent
b6b1488ddf
commit
ffa954ee02
@ -189,7 +189,7 @@ async function rawQuery<T = unknown>(
|
||||
format: 'JSONEachRow',
|
||||
});
|
||||
|
||||
return resultSet.json() as T;
|
||||
return (await resultSet.json()) as T;
|
||||
}
|
||||
|
||||
async function insert(table: string, values: any[]) {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import debug from 'debug';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import prisma from '@umami/prisma-client';
|
||||
import moment from 'moment-timezone';
|
||||
@ -8,6 +9,8 @@ import { maxDate } from './date';
|
||||
import { QueryFilters, QueryOptions, PageParams } from './types';
|
||||
import { filtersToArray } from './params';
|
||||
|
||||
const log = debug('umami:prisma');
|
||||
|
||||
const MYSQL_DATE_FORMATS = {
|
||||
minute: '%Y-%m-%d %H:%i:00',
|
||||
hour: '%Y-%m-%d %H:00:00',
|
||||
@ -210,6 +213,11 @@ async function parseFilters(
|
||||
}
|
||||
|
||||
async function rawQuery(sql: string, data: object): Promise<any> {
|
||||
if (process.env.LOG_QUERY) {
|
||||
log('QUERY:\n', sql);
|
||||
log('PARAMETERS:\n', data);
|
||||
}
|
||||
|
||||
const db = getDatabaseType();
|
||||
const params = [];
|
||||
|
||||
|
@ -35,7 +35,7 @@ async function relationalQuery(
|
||||
${filterQuery}
|
||||
group by string_value
|
||||
order by 2 desc
|
||||
limit 500
|
||||
limit 100
|
||||
`,
|
||||
params,
|
||||
);
|
||||
@ -63,7 +63,7 @@ async function clickhouseQuery(
|
||||
${filterQuery}
|
||||
group by event_name, value
|
||||
order by 2 desc
|
||||
limit 500;
|
||||
limit 100
|
||||
`,
|
||||
params,
|
||||
).then(result => {
|
||||
|
@ -31,7 +31,7 @@ async function relationalQuery(
|
||||
${filterQuery}
|
||||
group by string_value
|
||||
order by 2 desc
|
||||
limit 500
|
||||
limit 100
|
||||
`,
|
||||
params,
|
||||
);
|
||||
@ -58,7 +58,7 @@ async function clickhouseQuery(
|
||||
${filterQuery}
|
||||
group by value
|
||||
order by 2 desc
|
||||
limit 500;
|
||||
limit 100
|
||||
`,
|
||||
params,
|
||||
).then(result => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user