QueryInsightsTable.constants.ts44 lines · main
1import { CircleAlert, Lightbulb } from 'lucide-react'
2import type { LucideIcon } from 'lucide-react'
3
4export const ISSUE_DOT_COLORS: Record<
5 string,
6 { border: string; background: string; color: string }
7> = {
8 error: {
9 border: 'border-destructive-500',
10 background: 'bg-destructive-200',
11 color: 'text-destructive-600',
12 },
13 index: {
14 border: 'border-warning-500',
15 background: 'bg-warning-200',
16 color: 'text-warning-600',
17 },
18 slow: {
19 border: 'border-strong',
20 background: 'bg-alternative dark:bg-muted',
21 color: 'text-foreground-lighter',
22 },
23}
24
25export const ISSUE_ICONS: Record<string, LucideIcon> = {
26 error: CircleAlert,
27 index: Lightbulb,
28 slow: CircleAlert,
29}
30
31export const QUERY_INSIGHTS_EXPLORER_COLUMNS = [
32 { id: 'query', name: 'Query', description: undefined, minWidth: 500 },
33 { id: 'prop_total_time', name: 'Time consumed', description: undefined, minWidth: 150 },
34 { id: 'calls', name: 'Calls', description: undefined, minWidth: 100 },
35 { id: 'max_time', name: 'Max time', description: undefined, minWidth: 100 },
36 { id: 'mean_time', name: 'Mean time', description: undefined, minWidth: 100 },
37 { id: 'min_time', name: 'Min time', description: undefined, minWidth: 100 },
38 { id: 'rows_read', name: 'Rows processed', description: undefined, minWidth: 130 },
39 { id: 'cache_hit_rate', name: 'Cache hit rate', description: undefined, minWidth: 130 },
40 { id: 'rolname', name: 'Role', description: undefined, minWidth: 200 },
41 { id: 'application_name', name: 'Source', description: undefined, minWidth: 200 },
42] as const
43
44export const NON_SORTABLE_COLUMNS = [] as const