DEV Community

Cover image for Supabase/Postgres SQL Cheatsheet - Curated List of SQL

Posted on • Updated on • Originally published at

Supabase/Postgres SQL Cheatsheet - Curated List of SQL


If you are a PostgreSQL user, you are missing out on Big Thing!!! You could spin up a Backend Server, with PostgreSQL as Database in just 2 minutes! How? That is using Supabase. Supabase has raised 30 million as an Open Source Backend-as-a-Service (BaaS) startup. Mind blown!!!! 🤯

Supabase raised 30 million


Built on Top, problem?

Postgres 13 with Supabase
Supabase is indeed build on top of Postgres, and thus enabled developers to utilize all the awesome and stable extension/scripts that has been around the industry for years! You agree with me... right? 😂

Because of the continuous updates by Postgres (and I heard v14 is drawing near!), many of the scripts on Stackoverflow has outdated, and causes Supabase users, including myself (which switch from Firebase - NoSQL) to encounter some problem when running SQL query. Thus, we need Postgres expert like you to give Supabase a try, and join the Supabase community, Discord and most importantly make Open Source better!


Solution - Cheatsheets

Supabase SQL

Due to the reason mentioned previously, I've curated some of the SQL scripts, to aid Supabase users, or Postgres users in finding the relevant, up-to-date, and tested SQL scripts.

Where's the list, here it is!!!! -> Supabase SQL 🎉🙌

If you - find it useful, please spare a 🌟 at the Github Repo
If you - found any issue/bug, create issues is much appreciated.
If you - wanted to contribute the SQL scripts, PR is even more welcomed!


That's it

That's all the good news I wanna share with you today. If you are a Supabase user, hope you'll like it. If you are a Postgres user, I hope you'll give Supabase a try. If you are none of the above, then you are really missing out on GREAT things!

Until next time, bye! 👋


Follow me

🐤 Bird app - @zernonia

Top comments (2)

vbilopav profile image

Your Create function that return table snippet doesn't have to use plpgsql, it can be written much simpler with only SQL ,like this:

create or replace function get_tags (tag text)
returns setof products_view
language sql
select * from products_view where tag % any(categories);

zernonia profile image

Yup you are right! Thank you for pointing it out! 🙌