The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: remove unnecessary metadata data selection
TzeYiing254787243d1c
diff --git a/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx b/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsxindex 1754db68099..179d182710d 100644--- a/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx+++ b/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx@@ -6,9 +6,9 @@ export default [<div className="flex h-full w-full items-center justify-between gap-3"><TimestampLocalFormatter value={data.row.timestamp!} /><div className="flex h-full w-full items-center gap-4">- <ResponseCodeFormatter row={data} value={data.row.status_code} />- <span className="text-xs w-14">{data.row.request.method}</span>- <span className="font-mono text-xs">{data.row.request.path}</span>+ <ResponseCodeFormatter value={data.row.status_code} />+ <span className="text-xs w-14">{data.row.method}</span>+ <span className="font-mono text-xs">{data.row.path}</span></div></div>),diff --git a/studio/components/interfaces/Settings/Logs/Logs.utils.ts b/studio/components/interfaces/Settings/Logs/Logs.utils.tsindex 5c2fbe368e5..5d53b0e1185 100644--- a/studio/components/interfaces/Settings/Logs/Logs.utils.ts+++ b/studio/components/interfaces/Settings/Logs/Logs.utils.ts@@ -120,7 +120,7 @@ export const genDefaultQuery = (table: LogsTableName, filters: Filters) => {switch (table) {case 'edge_logs':- return `select id, timestamp, event_message, request, response, request.method, request.path, response.status_code+ return `select id, timestamp, event_message, request.method, request.path, response.status_codefrom ${table}cross join unnest(metadata) as mcross join unnest(m.request) as request@@ -145,7 +145,7 @@ export const genDefaultQuery = (table: LogsTableName, filters: Filters) => {`case 'function_edge_logs':- return `select id, ${table}.timestamp, event_message, response.status_code, response, request, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from ${table}+ return `select id, ${table}.timestamp, event_message, response.status_code, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from ${table}cross join unnest(metadata) as mcross join unnest(m.response) as responsecross join unnest(m.request) as requestdiff --git a/studio/tests/pages/projects/LogTable.test.js b/studio/tests/pages/projects/LogTable.test.jsindex a100c65921a..804bfdbe685 100644--- a/studio/tests/pages/projects/LogTable.test.js+++ b/studio/tests/pages/projects/LogTable.test.js@@ -94,6 +94,21 @@ test.each([includes: [/uncaughtException/],excludes: [/ERROR/],},+ {+ queryType: 'api',+ data: [+ {+ event_message: 'This is a uncaughtException\n',+ path: 'this-is-some-path',+ method: 'POST',+ status_code: 500,+ timestamp: 1659545029083869,+ id: '4475cf6f-2929-4296-ab44-ce2c17069937',+ },+ ],+ includes: [/POST/, 'this-is-some-path'],+ excludes: [],+ },])('table col renderer for $queryType', async ({ queryType, data, includes, excludes }) => {render(<LogTable queryType={queryType} data={data} />)diff --git a/studio/tests/pages/projects/LogsPreviewer.test.js b/studio/tests/pages/projects/LogsPreviewer.test.jsindex a380a1c65e7..6e4a6722dc0 100644--- a/studio/tests/pages/projects/LogsPreviewer.test.js+++ b/studio/tests/pages/projects/LogsPreviewer.test.js@@ -87,13 +87,14 @@ test.each([{queryType: 'api',tableName: undefined,- allLog: logDataFixture({+ tableLog: logDataFixture({id: 'some-id',- request: { path: 'some-path', method: 'POST' },+ path: 'some-path',+ method: 'POST',status_code: '400',metadata: undefined,}),- singleLog: {+ selectionLog: {id: 'some-id',metadata: [{ request: [{ method: 'POST' }] }],},@@ -103,7 +104,7 @@ test.each([// TODO: add more tests for each type of ui])('selection $queryType $tableName , can display log data and metadata',- async ({ queryType, tableName, allLog, singleLog, tableTexts, selectionTexts }) => {+ async ({ queryType, tableName, tableLog, selectionLog, tableTexts, selectionTexts }) => {get.mockImplementation((url) => {// countsif (url.includes('count')) {@@ -111,10 +112,10 @@ test.each([}// singleif (url.includes('where+id')) {- return { result: [singleLog] }+ return { result: [selectionLog] }}- // all- return { result: [allLog] }+ // table+ return { result: [tableLog] }})render(<LogsPreviewer projectRef="123" queryType={queryType} tableName={tableName} />)