Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ Run the CLI by prefixing each command with `npx` or `bunx`:
npx supabase --help
```

<Admonition type="caution">

The Supabase CLI requires **Node.js 20 or later** when run via `npx` or `npm`. Older Node.js versions, such as 16, are not supported and fail to start the CLI.

</Admonition>

You can also install the CLI as dev dependency via [npm](https://www.npmjs.com/package/supabase):

```sh
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"hast-util-to-html": "^9.0.0",
"icons": "workspace:*",
"isbot": "^5.1.2",
"js-yaml": "^3.14.1",
"js-yaml": "^3.14.2",
"jsrsasign": "^11.0.0",
"katex": "^0.16.21",
"libpg-query": "15.2.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/studio/data/analytics/infra-monitoring-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export type InfraMonitoringAttribute =
| 'realtime_channel_db_events'
| 'realtime_channel_presence_events'
| 'realtime_channel_joins'
| 'realtime_authorization_rls_execution_time'
| 'realtime_read_authorization_rls_execution_time'
| 'realtime_write_authorization_rls_execution_time'
| 'realtime_payload_size'
| 'realtime_sum_connections_connected'
| 'realtime_replication_connection_lag'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ export const useGetIndexAdvisorResult = <TData = GetIndexAdvisorResultData>(
typeof projectRef !== 'undefined' &&
typeof query !== 'undefined' &&
(query.startsWith('select') || query.startsWith('SELECT'))) ||
query.trim().toLowerCase().startsWith('with pgrst_source'),
(typeof query === 'string' && query.trim().toLowerCase().startsWith('with pgrst_source')),
...options,
})
178 changes: 126 additions & 52 deletions apps/studio/data/reports/v2/realtime.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,55 +36,50 @@ export const realtimeReports = ({
databaseIdentifier?: string
}): ReportConfig[] => [
{
id: 'client-to-realtime-connections',
label: 'Connections',
id: 'realtime_sum_connections_connected',
label: 'Connected Clients',
valuePrecision: 0,
hide: false,
showTooltip: false,
showSumAsDefaultHighlight: false,
showNewBadge: true,
showTooltip: true,
showLegend: false,
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'line',
titleTooltip: '',
titleTooltip: 'Total number of connected realtime clients.',
availableIn: ['free', 'pro', 'team', 'enterprise'],
dataProvider: async () => {
const data = await runInfraMonitoringQuery(
projectRef,
'realtime_connections_connected',
'realtime_sum_connections_connected',
startDate,
endDate,
interval,
databaseIdentifier
)

const transformedData = (data?.data ?? []).map((p) => {
const valueAsNumber = Number(p.realtime_connections_connected)
return {
...p,
realtime_connections_connected: Number.isNaN(valueAsNumber) ? 0 : valueAsNumber,
}
})

const attributes = [
{
attribute: 'realtime_connections_connected',
label: 'Connections',
attribute: 'realtime_sum_connections_connected',
label: 'Connected Clients',
},
]

return { data: transformedData, attributes }
return { data: data?.data || [], attributes }
},
},
{
id: 'channel-events',
label: 'Channel Events',
id: 'broadcast-events',
label: 'Broadcast Events',
valuePrecision: 0,
hide: false,
showNewBadge: true,
showTooltip: true,
showLegend: false,
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'line',
defaultChartStyle: 'bar',
titleTooltip: '',
availableIn: ['free', 'pro', 'team', 'enterprise'],
dataProvider: async () => {
Expand Down Expand Up @@ -112,6 +107,84 @@ export const realtimeReports = ({
return { data: transformedData || [], attributes }
},
},

{
id: 'presence-events',
label: 'Presence Events',
valuePrecision: 0,
hide: false,
showNewBadge: true,
showTooltip: true,
showLegend: false,
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'bar',
titleTooltip: '',
availableIn: ['free', 'pro', 'team', 'enterprise'],
dataProvider: async () => {
const { data } = await runInfraMonitoringQuery(
projectRef,
'realtime_channel_presence_events',
startDate,
endDate,
interval,
databaseIdentifier
)

const transformedData = data?.map((p) => ({
...p,
realtime_channel_presence_events: Number(p.realtime_channel_presence_events) || 0,
}))

const attributes = [
{
attribute: 'realtime_channel_presence_events',
label: 'Events',
},
]

return { data: transformedData || [], attributes }
},
},

{
id: 'db-events',
label: 'Postgres Changes Events',
valuePrecision: 0,
hide: false,
showNewBadge: true,
showTooltip: true,
showLegend: false,
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'bar',
titleTooltip: '',
availableIn: ['free', 'pro', 'team', 'enterprise'],
dataProvider: async () => {
const { data } = await runInfraMonitoringQuery(
projectRef,
'realtime_channel_db_events',
startDate,
endDate,
interval,
databaseIdentifier
)

const transformedData = data?.map((p) => ({
...p,
realtime_channel_db_events: Number(p.realtime_channel_db_events) || 0,
}))

const attributes = [
{
attribute: 'realtime_channel_db_events',
label: 'Events',
},
]

return { data: transformedData || [], attributes }
},
},
{
id: 'realtime_rate_of_channel_joins',
label: 'Rate of Channel Joins',
Expand Down Expand Up @@ -147,7 +220,7 @@ export const realtimeReports = ({
},
{
id: 'realtime_payload_size',
label: 'Broadcast Payload Size',
label: 'Message Payload Size',
valuePrecision: 2,
showNewBadge: true,
hide: false,
Expand All @@ -157,7 +230,7 @@ export const realtimeReports = ({
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'line',
titleTooltip: 'Size of broadcast payloads sent through realtime.',
titleTooltip: 'Median size of message payloads sent',
availableIn: ['free', 'pro', 'team', 'enterprise'],
YAxisProps: {
width: 50,
Expand All @@ -177,57 +250,56 @@ export const realtimeReports = ({
const attributes = [
{
attribute: 'realtime_payload_size',
label: 'Payload Size (bytes)',
label: 'Median Payload Size (bytes)',
},
]

return { data: data?.data || [], attributes }
},
},
{
id: 'realtime_sum_connections_connected',
label: 'Connected Clients',
valuePrecision: 0,
hide: false,
id: 'realtime_replication_connection_lag',
label: 'Broadcast From Database Replication Lag',
valuePrecision: 2,
showNewBadge: true,
hide: false,
showSumAsDefaultHighlight: false,
showTooltip: true,
showLegend: false,
showMaxValue: true,
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'line',
titleTooltip: 'Total number of connected realtime clients.',
availableIn: ['free', 'pro', 'team', 'enterprise'],
titleTooltip:
'Median time between database commit and broadcast when using broadcast from database.',
availableIn: ['pro', 'team', 'enterprise'],
YAxisProps: {
width: 50,
tickFormatter: (value: number) => `${value}ms`,
},
format: (value: unknown) => `${Number(value).toFixed(2)}ms`,
dataProvider: async () => {
const data = await runInfraMonitoringQuery(
projectRef,
'realtime_sum_connections_connected',
'realtime_replication_connection_lag',
startDate,
endDate,
interval,
databaseIdentifier
)

const transformedData = (data?.data ?? []).map((p) => {
const valueAsNumber = Number(p.realtime_sum_connections_connected)
return {
...p,
realtime_sum_connections_connected: Number.isNaN(valueAsNumber) ? 0 : valueAsNumber,
}
})

const attributes = [
{
attribute: 'realtime_sum_connections_connected',
label: 'Connected Clients',
attribute: 'realtime_replication_connection_lag',
label: 'Median Replication Lag (ms)',
},
]

return { data: transformedData, attributes }
return { data: data?.data || [], attributes }
},
},
{
id: 'realtime_replication_connection_lag',
label: 'Replication Connection Lag',
id: 'realtime_read_authorization_rls_execution_time',
label: '(Read) Private Channel Subscription RLS Execution Time',
valuePrecision: 2,
showNewBadge: true,
hide: false,
Expand All @@ -237,7 +309,8 @@ export const realtimeReports = ({
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'line',
titleTooltip: 'Time between database commit and broadcast when using broadcast from database.',
titleTooltip:
'Execution median time of RLS (Row Level Security) to subscribe to a private channel',
availableIn: ['pro', 'team', 'enterprise'],
YAxisProps: {
width: 50,
Expand All @@ -247,7 +320,7 @@ export const realtimeReports = ({
dataProvider: async () => {
const data = await runInfraMonitoringQuery(
projectRef,
'realtime_replication_connection_lag',
'realtime_read_authorization_rls_execution_time',
startDate,
endDate,
interval,
Expand All @@ -256,17 +329,17 @@ export const realtimeReports = ({

const attributes = [
{
attribute: 'realtime_replication_connection_lag',
label: 'Replication Lag (ms)',
attribute: 'realtime_read_authorization_rls_execution_time',
label: 'RLS Execution Time (ms)',
},
]

return { data: data?.data || [], attributes }
},
},
{
id: 'realtime_authorization_rls_execution_time',
label: 'RLS Execution Time',
id: 'realtime_write_authorization_rls_execution_time',
label: '(Write) Private Channel Subscription RLS Execution Time',
valuePrecision: 2,
showNewBadge: true,
hide: false,
Expand All @@ -276,7 +349,8 @@ export const realtimeReports = ({
showMaxValue: false,
hideChartType: false,
defaultChartStyle: 'line',
titleTooltip: 'Execution time of RLS (Row Level Security) checks for realtime authorization.',
titleTooltip:
'Execution median time of RLS (Row Level Security) to publish to a private channel',
availableIn: ['pro', 'team', 'enterprise'],
YAxisProps: {
width: 50,
Expand All @@ -286,7 +360,7 @@ export const realtimeReports = ({
dataProvider: async () => {
const data = await runInfraMonitoringQuery(
projectRef,
'realtime_authorization_rls_execution_time',
'realtime_write_authorization_rls_execution_time',
startDate,
endDate,
interval,
Expand All @@ -295,7 +369,7 @@ export const realtimeReports = ({

const attributes = [
{
attribute: 'realtime_authorization_rls_execution_time',
attribute: 'realtime_write_authorization_rls_execution_time',
label: 'RLS Execution Time (ms)',
},
]
Expand Down
4 changes: 2 additions & 2 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@ai-sdk/openai": "2.0.32",
"@ai-sdk/provider": "^2.0.0",
"@ai-sdk/provider-utils": "^3.0.0",
"@ai-sdk/react": "2.0.45",
"@ai-sdk/react": "2.0.52",
"@aws-sdk/credential-providers": "^3.804.0",
"@dagrejs/dagre": "^1.0.4",
"@dnd-kit/core": "^6.1.0",
Expand Down Expand Up @@ -73,7 +73,7 @@
"@vercel/functions": "^2.1.0",
"@vitejs/plugin-react": "^4.3.4",
"@zip.js/zip.js": "^2.7.29",
"ai": "5.0.45",
"ai": "5.0.52",
"ai-commands": "workspace:*",
"awesome-debounce-promise": "^2.1.0",
"common": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"knip": "pnpx knip@~5.50.0"
},
"devDependencies": {
"@aws-sdk/client-secrets-manager": "^3.410.0",
"@aws-sdk/client-secrets-manager": "^3.823.0",
"@types/node": "catalog:",
"eslint": "^9.0.0",
"prettier": "3.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-commands/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@serafin/schema-builder": "^0.18.5",
"@supabase/supabase-js": "catalog:",
"ai": "^5.0.0",
"ai": "5.0.52",
"common-tags": "^1.8.2",
"config": "workspace:*",
"js-tiktoken": "^1.0.10",
Expand Down
Loading
Loading