(ids: string[], projectId: string)
| 160 | } |
| 161 | |
| 162 | export 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 | |
| 181 | export const getProfilesCached = cacheable(getProfiles, 60 * 5); |
| 182 |
no test coverage detected