MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getProfiles

Function getProfiles

packages/db/src/services/profile.service.ts:162–179  ·  view source on GitHub ↗
(ids: string[], projectId: string)

Source from the content-addressed store, hash-verified

160}
161
162export async function getProfiles(ids: string[], projectId: string) {
163 const filteredIds = uniq(ids.filter((id) => id !== ''));
164
165 if (filteredIds.length === 0) {
166 return [];
167 }
168
169 const data = await chQuery<IClickhouseProfile>(
170 `SELECT ${PROFILE_COLUMNS}
171 FROM ${TABLE_NAMES.profiles} FINAL
172 WHERE
173 project_id = ${sqlstring.escape(projectId)} AND
174 id IN (${filteredIds.map((id) => sqlstring.escape(id)).join(',')})
175 `
176 );
177
178 return data.map(transformProfile);
179}
180
181export const getProfilesCached = cacheable(getProfiles, 60 * 5);
182

Callers 4

listCohortMemberProfilesFunction · 0.90
getGroupMemberProfilesFunction · 0.90
realtime.tsFile · 0.90
profile.tsFile · 0.90

Calls 2

joinMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected