mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 22:29:11 +03:00
* fix metadata not showing in Raw tab in log detail * fix rows not filling up horizontal space * show collection loader only when fetching collections, since the query can be disabled * simplify language in create collection modal * fix create collection modal copy in cta * rm typecast, add tooltip on collection creation * improve copy on empty collection * improve copy on colelction empty state * rm unused code * prompt users to refresh, add button to refresh, after sending first events to a collection * use generic mr skelington instead of supalogo * add template for search in event message * hide field reference when source is warehouse * rm font bold on selected log * update curl example * add focusable prop to codeblock * change focus border color in codeblock * make codeblock focusable by default * move refresh btn * rm unnecessary focusable i codeblcok * fix raw log rendering * add search * update plceholder * add timerange search * improve empty state copy in wh * add open in warehouse explorer button * update test conection dialog ui * Update apps/studio/components/interfaces/DataWarehouse/TestCollectionDialog.tsx Co-authored-by: Joshen Lim <joshenlimek@gmail.com> * Update apps/studio/components/interfaces/DataWarehouse/WarehouseCollectionDetail.tsx Co-authored-by: Joshen Lim <joshenlimek@gmail.com> * Update apps/studio/components/interfaces/DataWarehouse/WarehouseCollectionDetail.tsx Co-authored-by: Joshen Lim <joshenlimek@gmail.com> * rm clog * Update apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx Co-authored-by: Joshen Lim <joshenlimek@gmail.com> * fix loading state in collections sidebar * fix test collection sheet layout * add some keyboard shortcuts to filters * use isLoading in wh log detail to prevent double loaders * make search input longr * truncate titles * truncat sidebar names * rename dayjs * update copy from warehouse to collections * update remove collection copy --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
27 lines
954 B
TypeScript
27 lines
954 B
TypeScript
export type WarehouseQueryTemplate = {
|
|
query: string
|
|
name: string
|
|
description: string
|
|
}
|
|
|
|
export function createWarehouseQueryTemplates(
|
|
collections: { name: string }[]
|
|
): WarehouseQueryTemplate[] {
|
|
return collections.flatMap((collection) => [
|
|
{
|
|
query: `select count(*) as event_count from \`${collection.name}\`
|
|
where timestamp > timestamp_sub(current_timestamp(), interval 1 day)`,
|
|
name: `${collection.name} - Daily Event Count`,
|
|
description: `Count events in the last 24 hours from ${collection.name} collection`,
|
|
},
|
|
{
|
|
query: `select id, timestamp, event_message from \`${collection.name}\`
|
|
where timestamp > timestamp_sub(current_timestamp(), interval 1 day)
|
|
and event_message like '%YOUR_TEXT_HERE%'
|
|
order by timestamp desc limit 10`,
|
|
name: `${collection.name} - Filter by text`,
|
|
description: `Select last 10 events from ${collection.name} collection`,
|
|
},
|
|
])
|
|
}
|