Files
supabase/apps/studio/data/analytics/warehouse-collection-log-detail-query.ts
Jordi EnricandIvan Vasilov b6647d445c store selected logs to url (#29802)
* add selected logs to url

* Add mocks for nuqs package.

* fix layout issues n remove magic numbers for height

* fix chart height issue

* fix bug where logs not in first page wouldnt load correctly

* fix spacing between charts and header

* fix postgtres_logs issues, improve size in log detail

* fix borders

* fix default renderer

* fix detail width

* rm maxheight references

* fix tests

* fix typeerrs

* fix stories typerr

* improve colelctions empty state

* move state UP for logs and warehouse tables

* cleanup

* rm params

* rm params

* rm params

* fix log explorer selection

* fix tests types

* cleanup divs

* fix selected log delay

* use isEq for comparison in rows

* fix selection stuck open

* fix btnlink combo

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-10-25 12:40:14 +02:00

20 lines
502 B
TypeScript

import { useWarehouseQueryQuery } from './warehouse-query'
export function useWarehouseLogDetailQuery({
ref,
collectionName,
logId,
columns = ['id', 'timestamp'],
}: {
ref: string
collectionName?: string
logId?: string
columns?: string[]
}) {
const enabled = !!logId && !!collectionName
const sql = `select ${columns.join(',')} from \`${collectionName}\`
where id = '${logId}' and timestamp > '2024-01-01' limit 1`
return useWarehouseQueryQuery({ ref, sql }, { enabled })
}