queriesFactory() — supabase Function Reference
Architecture documentation for the queriesFactory() function in Reports.utils.tsx from the supabase codebase.
Entity Profile
Relationship Graph
Source Code
apps/studio/components/interfaces/Reports/Reports.utils.tsx lines 27–48
export const queriesFactory = <T extends string>(
queries: BaseQueries<T>,
projectRef: string
): PresetHooks => {
const hooks: PresetHooks = Object.entries<ReportQuery>(queries).reduce(
(acc, [k, { sql, queryType }]) => {
if (queryType === 'db') {
return {
...acc,
[k]: () => useDbQuery({ sql }),
}
} else {
return {
...acc,
[k]: () => useLogsQuery(projectRef),
}
}
},
{}
)
return hooks
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free