Database

Open Source SQL Database
(without the hassle)

Every Supabase project is a dedicated PostgreSQL database, trusted by millions of developers.

PostgreSQL is one of the worlds most scalable databases.

postgresql icon

Just Postgres

Every Supabase project is a dedicated Postgres database.

100% portable. Bring your existing Postgres database, or migrate away at any time.

Built-in Auth

Leveraging PostgreSQL's proven Row Level Security.

Integrated with JWT authentication which controls exactly what your users can access.

Realtime enabled

Data-change listeners over websockets.

Subscribe and react to database changes, milliseconds after they happen.

Branching

New
  • Branch your Supabase project

  • Sync with your git branches

  • Manage every Preview from the Dashboard

  • Support for Vercel Previews

Read Replicas

New
  • Serve data closer to your users

  • Provide data redundancy

  • Run complex queries without affecting your primary database

  • Distribute load across various databases

Easy to use dashboard

The simplicity of a Table Editor, or the power of a SQL editor. Your choice.

The simplicity of a spreadsheet
Create tables
Set up foreign keys
Select and Export

The simplicity of a spreadsheet

Add, edit, and update your data with the simplicity of a no-code tool.

View documentation about /docs/guides/database/tablesView documentation

Create tables

Add tables, columns and rows right in the dashboard. Without a single line SQL.

View documentation about /docs/guides/database/tables#creating-tablesView documentation

Set up foreign keys

Build connections throughout your data with the full power of a Relational Database.

View documentation about /docs/guides/database/tables#joining-tables-with-foreign-keysView documentation

Select and Export

Pick the rows you want and export them into a CSV.

@Elsolo244 twitter image

@Elsolo244

"Where has @supabase been all my life? 😍"

Full SQL
Monaco editor
Favorite queries
Export to CSV

Full SQL

Create tables, functions, join tables - A full SQL editor built into the dashboard

Monaco editor

Built in Monaco editor, with rich validation and autocomplete.

Favorite queries

Save your favorite queries to use again and again.

Export to CSV

Any output can be exported into a CSV

@jim_bisenius twitter image

@jim_bisenius

"@MongoDB or @MySQL?!?! Please, let me introduce you to @supabase and the wonderful world of @PostgreSQL before it's too late!!"

Never write an API again

We introspect your database and provide instant APIs. Focus on building your product, while Supabase handles the CRUD.

Explore documentation
// Create a record

// Insert new record into a table called `rooms`
const { data, error } = await supabase
  .from('rooms')
  .insert({ 
    name: 'Supabase Fan Club', 
    public: true 
  })


  








// Read a record

// Retrieve all of the `rooms`, 
// and get all the messages for each room.
const { data, error } = await supabase
  .from('rooms').select(`
    name,
    messages ( text )
  `)
  .eq('public', true)










Community driven examples, libraries and guides

Supported by a network of early advocates, contributors, and champions.

Extend your database

Supabase works natively with Postgres extensions.

Choose from a huge collection of Postgres extensions, enabled with a single click.

40+ preinstalled extensions

We only show a few of the extensions supported by Supabase here, but we preinstall many more that you can use right away.

Explore documentation
SELECT superhero.name
FROM city, superhero
WHERE ST_Contains(city.geom, superhero.geom)
AND city.name = 'Gotham';
  
-- This can be run in the SQL editor
psql
CREATE EXTENSION pgcrypto;
SELECT crypt('mypass', gen_salt('bf', 4));
crypt
--------------------------------------------------------------
$2a$04$1bfMQDOR6aLyD4q3KVb8/ujG7ZAkyie4d/s3ABwuZNbzkFFgXtC76

-- We can now execute the statement below to store the string safely in the database:
INSERT INTO users (user_id,enc_pass) VALUES (1,'$2a$04$1bfMQDOR6aLyD4q3KVb8/ujG7ZAkyie4d/s3ABwuZNbzkFFgXtC76');
SELECT order_details.qty,
    order_details.item_id,
    order_details.item_price
FROM order_details,
  customers
WHERE customers.id = order_details.customer_id
AND customers.email = 'john@supabase.io'

-- You can now view pg_stat_statements

SELECT * 
FROM pg_stat_statements;

userid              | 16384
dbid                | 16388
query               | select * from users where email = ?;
calls               | 2
total_time          | 0.000268
rows                | 2
shared_blks_hit     | 16
shared_blks_read    | 0
shared_blks_dirtied | 0
shared_blks_written | 0
local_blks_hit      | 0
local_blks_read     | 0
local_blks_dirtied  | 0
local_blks_written  | 0
...

Spatial and Geographic objects for PostgreSQL

PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.

Extensions used:

PostGIS

Cryptographic functions for PostgreSQL.

The pgcrypto module is a cryptographic extension that provides a number of hashing and cryptographic functions.

Extensions used:

pgcrypto

Tracking execution statistics of all SQL statements

The pg_stat_statements module provides a means for tracking execution statistics of all SQL statements executed by a server.

Extensions used:

pg_stat_statements