The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: restrict how many requests are made by app to api when no sql is present for logs request
Jonathan Summers-Muira4eb67cdba59
diff --git a/studio/hooks/analytics/useLogsPreview.tsx b/studio/hooks/analytics/useLogsPreview.tsxindex e8d6bd8eaed..81125d0cbf9 100644--- a/studio/hooks/analytics/useLogsPreview.tsx+++ b/studio/hooks/analytics/useLogsPreview.tsx@@ -61,6 +61,13 @@ function useLogsPreview(// handle url generation for log paginationconst getKeyLogs: SWRInfiniteKeyLoader = (_pageIndex: number, prevPageData: Logs) => {let queryParams++ // check that SQL is ready for the logs request+ if(!params.sql || !params.rawSql) {+ // return empty url to restrict unnecessary requests to api+ return ''+ }+// if prev page data is 100 items, could possibly have more records that are not yet fetched within this intervalif (prevPageData === null) {// reduce interval window limit by using the timestamp of the last log