File tree Expand file tree Collapse file tree 3 files changed +37
-10
lines changed
Expand file tree Collapse file tree 3 files changed +37
-10
lines changed Original file line number Diff line number Diff line change 11import { ClickHouseClient } from '@clickhouse/client'
22import type { WebClickHouseClient } from '@clickhouse/client-web/dist/client'
33
4+ const log = ( ...args : string [ ] ) => console . log ( `[/api/init] ${ args . join ( ' ' ) } ` )
5+ const error = ( ...args : string [ ] ) =>
6+ console . error ( `[/api/init] ${ args . join ( ' ' ) } ` )
7+
48export async function initTrackingTable (
59 client : WebClickHouseClient | ClickHouseClient
610) {
7- console . log ( '[Middleware] initializing system.monitoring_events' )
11+ log ( 'initializing system.monitoring_events' )
812
913 try {
1014 const response = await client . query ( {
@@ -20,14 +24,8 @@ export async function initTrackingTable(
2024 PARTITION BY event_date
2125 ORDER BY (kind, actor, event_time)` ,
2226 } )
23- console . log (
24- '[Middleware] Created table system.monitoring_events' ,
25- await response . text ( )
26- )
27- } catch ( error ) {
28- console . error (
29- '[Middleware] Error initializing table system.monitoring_events' ,
30- error
31- )
27+ log ( 'created table system.monitoring_events' , await response . text ( ) )
28+ } catch ( err ) {
29+ error ( 'error initializing table system.monitoring_events' , `${ err } ` )
3230 }
3331}
Original file line number Diff line number Diff line change 1+ import type { IconProps } from '@radix-ui/react-icons/dist/types'
2+ import type { LucideProps } from 'lucide-react'
3+
4+ declare const RadixOrLucide :
5+ | React . ForwardRefExoticComponent <
6+ IconProps & React . RefAttributes < SVGSVGElement >
7+ >
8+ | React . ForwardRefExoticComponent < LucideProps >
9+
10+ export type Icon = typeof RadixOrLucide
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type {
44 ColumnFormatOptions ,
55} from '@/components/data-table/column-defs'
66import type { PartialBy } from '@/lib/types/generic'
7+ import type { Icon } from '@/lib/types/icon'
78
89export interface QueryConfig {
910 name : string
@@ -41,6 +42,24 @@ export interface QueryConfig {
4142 * ```
4243 */
4344 defaultParams ?: Record < string , string | number | boolean >
45+ /**
46+ * Filter presets are predefined filters that can be applied to the query
47+ * For example:
48+ * ```ts
49+ * filterPresets: [
50+ * {
51+ * name: 'Changed only',
52+ * key: 'changed',
53+ * sql: 'changed = 1',
54+ * },
55+ * ]
56+ */
57+ filterParamPresets ?: {
58+ name : string
59+ key : string
60+ sql : string
61+ icon ?: Icon
62+ } [ ]
4463}
4564
4665export type QueryConfigNoName = PartialBy < QueryConfig , 'name' >
You can’t perform that action at this time.
0 commit comments