Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(sql-editor): format sql to lower case

Greg Richardson074969ad24d1
diff --git a/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx b/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
index f52733a5a86..057af911abf 100644
--- a/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
+++ b/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
@@ -85,7 +85,10 @@ const SQLTemplates = observer(() => {
try {
const { title, sql } = await generateSql({ prompt: e.currentTarget.value })
- await handleNewQuery(sql, title)
+ // TODO: consider `sql-formatter` (though `create` statements format strange)
+ const formattedSql = sql.toLowerCase()
+
+ await handleNewQuery(formattedSql, title)
} catch (error: unknown) {
if (
error &&