save sdk name and version

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-07 22:21:22 +02:00
committed by Carl-Gerhard Lindesvärd
parent 41e46570b7
commit ccfddc215f
12 changed files with 96 additions and 57 deletions

View File

@@ -6,6 +6,7 @@ import type { IChartEventFilter } from '@openpanel/validation';
import { profileBuffer } from '../buffers';
import {
ch,
chQuery,
formatClickhouseDate,
TABLE_NAMES,
@@ -170,6 +171,29 @@ export function transformProfile({
};
}
export async function createProfileAlias({
projectId,
alias,
profileId,
}: {
projectId: string;
alias: string;
profileId: string;
}) {
await ch.insert({
table: TABLE_NAMES.alias,
format: 'JSONEachRow',
values: [
{
projectId,
profile_id: profileId,
alias,
created_at: new Date(),
},
],
});
}
export async function upsertProfile({
id,
firstName,