Supabase
p/supabase
The open source Firebase alternative
Jonny Summers-Muir

AI SQL Editor by Supabase — Write SQL without knowing SQL

Featured
171
The AI powered SQL editor is a game changer for anyone looking to write SQL without actually knowing SQL. The Supabase SQL editor can intuitively understand what you're trying to query and offer smart suggestions uniquely just for your database.
Replies
Best
Jonny Summers-Muir
Top Product
Hunter
📌
My colleagues have been recently working on a brilliant new upgrade to the Supabase Studio Dashboard; the SQL editor is now powered by Supabase AI. This is has now become part of my daily workflow. I no longer need to switch back and forth between ChatGPT and Supabase, I can now, within the editor, just pop in a question, and Supabase AI will amend my query. I think my favorite part is that after a while, I realized that my schema was being understood by Supabase AI. It was starting to reference my other tables and columns in my schema that were not present in the query I was working on (🤯).
F Q
@jon_summers_muir keep up the impressive rate of shipping
Jon Meyers
@jon_summers_muir using AI to improve DX and educate people about SQL! 🧠 This is going to save me so much time!
Ant Wilson
@jon_summers_muir @jackson_huge @mansueli haha your personal DBA is a great way to frame this
Yuri
@jon_summers_muir this will open so many opportunities to those struggling with SQL 🤯
AbdulHafeez Sadon
@jon_summers_muir @jon_meyers Impeccable AI usage with clear product market fit. Hopefully my journey on learning SCD1-3 will be lil bit easier with this AI implementation.
Greg Richardson
Top Product
Maker
📌
Hey everyone! 👋 Today, we're releasing a big improvement to our SQL Editor: an AI assistant, embedded directly into the editor. What can you do with Supabase AI? - 🚀 Generate tables, reports, and more using natural language - 🔧 Tweak and massage your query using natural language until you’re satisfied - 🐞 Debug errors using AI - instead of cryptic messages, get direct solutions - 🔤 Title your SQL snippets automatically based on the contents of the query

✨ How does it work?

When you spin up the SQL editor, you are now presented with a brand new input where you can ask Supabase AI to build any SQL query you like - using only natural language. For example “build a table to store employees” will produce a CREATE statement auto populated with common fields that you’d likely want to track for each employee. Of course you don’t have to stop there - Supabase AI is aware of the SQL snippet in the editor and can modify it for you. For example, you could ask Supabase AI to split a “department” text column into its own table, all while adding proper foreign key references and following best practices. This is all presented via a new diff editor that shows which changes Supabase AI is making to your SQL snippet. This will feel exactly like a Git diff view in an editor like VS Code. Nothing is applied until you accept or discard the change. From there you’re free to keep asking Supabase AI to make changes until you're satisfied.

🎯 Motivation

We've wondered for a long time how to make it easier to teach developers how to use SQL, while at the same time speeding up development for those who do. It's fortunate we didn't solve this problem too quickly, as it turns out that AI does a much better job than we could do ourselves. We first introduced Supabase AI into our documentation website (aka the revival of Clippy 📎 😄) to help developers answer their questions directly, ChatGPT style, instead of searching for it through the docs. If you’ve had a chance to play around with large language models (LLMs) like OpenAI’s GPT 3.5/GPT 4, you’ll know they are also incredible at generating and interpreting code. The SQL editor was the next natural fit for this technology. With Supabase AI, you won't even need the whole weekend to scale to millions. Head over to the SQL Editor and give it a try!

📈 What’s next?

In the coming months, we're looking to sprinkle Supabase AI through more parts of the Studio. With Postgres under the hood, there's so much we can do with SQL and a little bit of AI to help you move fast. Keep an eye out for the Supabase AI icon, you never know where it will pop up next.

🌐 Remember - it's all open source!

View all the code right now on GitHub. —- Thanks everyone! We would absolutely love to hear your feedback in the comments. Greg, Supabase team
Pamela Chia
@ggrn all the prompts got me what I wanted so far. Great work!!
Sreyas Udayavarman
Wow! This is cool. I love the editor design and can't wait to try this out. AI + Awesome DX = 🔥
Terry Sutton
Top Product
Maker
@ggrn great work on this Greg. Came out very nicely in the end.
Ant Wilson
@sreyas_udayavarman agree, the UI and animated elements are next level
Ant Wilson
@sreyas_udayavarman yea DX improvements are a major focus area for us!
André J
Heads up: the website link in this producthunt post goes to a random signup page with no info on what im about to sign up to. I don't know if that's intentional or? If FTUX was improved it would 10x conversion rate IMO. Really love the design of the product tho! good job!
Inian Parameshwaran
This looks amazing!! What model did you use to generate the suggestions? Is the code and the prompt used to generate the suggestions open source?
Greg Richardson
Top Product
Maker
@everconfusedguy Currently using OpenAI's GPT 3.5 model as a compromise between speed, cost, and quality. Overall quality is still very high, and today 3.5 is much faster and cheaper than GPT 4. We will definitely be updating this though as new and better models are released! All the code is open source and available on GitHub!
Inian Parameshwaran
@ggrn Interesting prompt..I like that you are recommending best practices in the prompt itself! Have you considered any of the open models from HuggingFace?
Thor Schaeff
@ggrn @everconfusedguy yes, would be interesting to see this working with an open source model from Hugging Face and compare the performance. I think that's planned.
Greg Richardson
Top Product
Maker
@everconfusedguy @schaeff_t yes we would love to experiment with open source large language models like Llama 2, the biggest hurdle being finding a good way to host them (very resource heavy today). Alternatively a smaller & dedicated text-to-sql model could be another option.
AbdulHafeez Sadon
As Supabase fan, I dig this. Could be interesting they they can generate custom policy via prompt with codebase feed as well. Life saver! Gratz team for the successful PH launch!
Greg Richardson
Top Product
Maker
@hafeezcae dedicated AI assisted RLS policies are on the road map!
Joshen Lim
Top Product
Maker
Super excited that this is now available for everyone to use and leverage on - as a developer who's not the most familiar with SQL this is a huge time saver and also a potentially great learning tool! No longer will I need to search for "how to do xxx" on Google and try to find the best answer, all of this can be done without leaving the SQL editor ✨✨
Maria Loleyt
Hey! I am a non-technical founder and I always wanted a product like this! Do you have any tutorials for the beginners?
Ramiro Nuñez Dosio
@maria_loleyt we have this video tutorial:
And we'll be creating more content soon!
Terry Sutton
Top Product
Maker
What a great gift this #SupaLaunchWeek! We've been wanting to see _something_ like this for ages. It was amazing to give Greg not much more than a problem statement — "we want to see Supabase AI integrated into the SQL Editor, somehow" — and to get this back in return. Tremendous work. Build in a weekend? You won't even need it all. What a massive head start.
Ramiro Nuñez Dosio
Kudos to the team for integrating Supabase AI into the SQL editor of Supabase Studio Dashboard in record time! Can't wait to see what else is announced this week!
Qudsia Ali
Kudos to Supabase – they cracked the code with this AI SQL editor. Querying databases is now a breeze! 💼📝 #SQLRevolution #SmartQueries
Egor Romanov
I had a chance to test it, and I love it. I was in a waitlist for copilot since it’s announced, and use it daily, and now supabase ai can be my second copilot right in the dashboard 💚
Thor Schaeff
@egor_romanov so convenient isn't it? Also that your database schema can be shared with the AI is super helpful. Major efficiency gain.
Kang Ming
This is great! Can't wait to try it out - gonna love not having to tab-switch every time in order to debug my SQL queries 🤗
Ant Wilson
@kang_ming_tay @imor gonna reduce traffic to stack overflow for sure!
Pamela Chia
Love the diff editor design and how it actually checks my tables and columns to suggest changes! (when I switch on that setting) No need to go back to chatGPT to explain the names of my columns and tables every time I need to make a new snippet haha
Marijana Pavlinić
@pamelachia hahah exactly my thoughts! this is awesome 🚀🚀
Thor Schaeff
@pamelachia @antwilson having the database schema shared with the AI automatically is just so smart. 🤯
Subin Babu
Wow, this is going to be a game changer! Also, I have a suggestion. Could you consider adding an option to upload SQL files? This would allow users to upload and analyze their SQL files, which I believe would be useful for everyone.
Ariel Di Porto
This is great! As an everyday "business" user of Supabase, who is learning SQL to extract insights about what our users are doing in our product, this can be very impactful in speeding-up my learning process and, at the same time, in helping extracting data. Cheers to the team!
Jon Meyers
This is exactly how you combine the power of AI with incredible DX. This doesn't just generate SQL snippets, but uses a side-by-side comparison to help educate you on ways you can improve your database in the future! 🚀
Tyler Shukert
@jon_meyers Yeah, the diff feature is a game changer 🔥
Francesco Sansalvadore
This is sooooo cool, great idea Supabase! It just feels like magic now to write SQL. ✨ I love how you don't even need to copy/paste anymore, you can just tweak the query to perfection with a few prompts. ❤️ Nice!
Pavel
@f_sansalvadore yes, tweaking an AI-generated query makes it easy. I hope it will reduce the fear of using such a complicated product like Postgres and increase the Postgres usage overall
Paul Cioanca
Really lovely seeing this out and available for everybody to use! Oftentimes you'll head into an SQL editor to dive down into your project's data and are left with a blank textarea not knowing where to even start - this takes away that initial overhead and gives you a headstart into working with your data rather than mucking around with syntax.
Pavel Borisov
I find it very useful not to remember the full syntax, just generate it with AI and then check and correcting results manually. Probably it's a good time-saver for people who don't write only SQL queries 24/7.
Thor Schaeff
@pavel_borisov3 agreed, I never remember the RLS use vs check syntax, really helpful to have a smart assistant by my side.
Rohit Joshi
Congratulation team for developing an AI-driven SQL editor, making SQL queries intuitive even for beginners.