The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Add trims to table and column names (#22170)
Joshen Lim8b43a2b56434
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.tsindex 29f91559951..f9ce1f04b0a 100644--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts@@ -92,8 +92,8 @@ export const generateCreateColumnPayload = (const payload: CreateColumnPayload = {tableId,isIdentity,- name: field.name,- comment: field.comment,+ name: field.name.trim(),+ comment: field.comment?.trim(),type: field.isArray ? `${field.format}[]` : field.format,check: field.check?.trim() || undefined,isUnique: field.isUnique,diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsxindex 23d61e15c72..aac92fe2d89 100644--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx@@ -179,7 +179,7 @@ const TableEditor = ({const payload = {name: tableFields.name.trim(),schema: snap.selectedSchemaName,- comment: tableFields.comment,+ comment: tableFields.comment?.trim(),...(!isNewRecord && { rls_enabled: tableFields.isRLSEnabled }),}const configuration = {@@ -191,8 +191,11 @@ const TableEditor = ({existingForeignKeyRelations: foreignKeys,primaryKey,}+ const columns = tableFields.columns.map((column) => {+ return { ...column, name: column.name.trim() }+ })- saveChanges(payload, tableFields.columns, fkRelations, isNewRecord, configuration, resolve)+ saveChanges(payload, columns, fkRelations, isNewRecord, configuration, resolve)} else {resolve()}diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsxindex 78da718eb85..d2a80118c41 100644--- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx+++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx@@ -33,7 +33,9 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =}}, [orgUsage])- const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: selectedOrganization?.slug })+ const { data: subscription } = useOrgSubscriptionQuery({+ orgSlug: selectedOrganization?.slug,+ })const projectHasNoLimits = subscription?.usage_billing_enabled === true