The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Fix SQL editor connection string (#19523)
Joshen Lim033c9d28de4b
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsxindex e5d3b0e688d..198a4b04ebf 100644--- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx+++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx@@ -118,6 +118,7 @@ const SQLEditor = () => {const [pendingTitle, setPendingTitle] = useState<string>()const [hasSelection, setHasSelection] = useState<boolean>(false)const inputRef = useRef<HTMLInputElement>(null)+ const readReplicasEnabled = useFlag('readReplicas')const supabaseAIEnabled = useFlag('sqlEditorSupabaseAI')const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: organization?.slug })@@ -322,9 +323,9 @@ const SQLEditor = () => {setLineHighlights([])}- const connectionString = databases?.find(- (db) => db.identifier === snap.selectedDatabaseId- )?.connectionString+ const connectionString = !readReplicasEnabled+ ? project.connectionString+ : databases?.find((db) => db.identifier === snap.selectedDatabaseId)?.connectionStringif (!connectionString) {return toast.error('Unable to run query: Connection string is missing')}