Remove snake_case.

This commit is contained in:
Brian Cao 2022-12-26 17:36:48 -08:00
parent e1f99a7d01
commit a91386434d
21 changed files with 86 additions and 100 deletions

View file

@ -9,20 +9,20 @@ export function getEvents(...args) {
});
}
function relationalQuery(websites, start_at) {
function relationalQuery(websites, startAt) {
return prisma.client.event.findMany({
where: {
websiteId: {
in: websites,
},
createdAt: {
gte: start_at,
gte: startAt,
},
},
});
}
function clickhouseQuery(websites, start_at) {
function clickhouseQuery(websites, startAt) {
const { rawQuery, getDateFormat, getCommaSeparatedStringFormat } = clickhouse;
return rawQuery(
@ -40,6 +40,6 @@ function clickhouseQuery(websites, start_at) {
? `website_id in (${getCommaSeparatedStringFormat(websites)})`
: '0 = 0'
}
and created_at >= ${getDateFormat(start_at)}`,
and created_at >= ${getDateFormat(startAt)}`,
);
}

View file

@ -9,20 +9,20 @@ export async function getPageviews(...args) {
});
}
async function relationalQuery(websites, start_at) {
async function relationalQuery(websites, startAt) {
return prisma.client.pageview.findMany({
where: {
websiteId: {
in: websites,
},
createdAt: {
gte: start_at,
gte: startAt,
},
},
});
}
async function clickhouseQuery(websites, start_at) {
async function clickhouseQuery(websites, startAt) {
const { rawQuery, getCommaSeparatedStringFormat } = clickhouse;
return rawQuery(
@ -38,6 +38,6 @@ async function clickhouseQuery(websites, start_at) {
? `website_id in (${getCommaSeparatedStringFormat(websites)})`
: '0 = 0'
}
and created_at >= ${clickhouse.getDateFormat(start_at)}`,
and created_at >= ${clickhouse.getDateFormat(startAt)}`,
);
}

View file

@ -9,7 +9,7 @@ export async function getSessions(...args) {
});
}
async function relationalQuery(websites, start_at) {
async function relationalQuery(websites, startAt) {
return prisma.client.session.findMany({
where: {
...(websites && websites.length > 0
@ -20,13 +20,13 @@ async function relationalQuery(websites, start_at) {
}
: {}),
createdAt: {
gte: start_at,
gte: startAt,
},
},
});
}
async function clickhouseQuery(websites, start_at) {
async function clickhouseQuery(websites, startAt) {
const { rawQuery, getDateFormat, getCommaSeparatedStringFormat } = clickhouse;
return rawQuery(
@ -47,6 +47,6 @@ async function clickhouseQuery(websites, start_at) {
? `website_id in (${getCommaSeparatedStringFormat(websites)})`
: '0 = 0'
}
and created_at >= ${getDateFormat(start_at)}`,
and created_at >= ${getDateFormat(startAt)}`,
);
}