Creating a PostgreSQL Table in Vela: Tables View Walkthrough

Vela Team 5 min read

This walkthrough follows the video flow exactly: open the Tables view, create a users table, add key columns, and keep RLS enabled by default.

Video Chapters

  • 00:00 Intro
  • 00:08 Open Tables view
  • 00:21 Create users table
  • 00:30 Add columns (username, email, names, external_id)
  • 01:15 RLS by default (recommended)

Prerequisites

  • An active Vela account and project.
  • At least one running branch (database) in your project.
  • Basic familiarity with SQL CREATE TABLE syntax.

Create your Postgres backend in 90 seconds.

Launch a production-ready Postgres stack with branching and instant clones.

Start in 90 seconds

Step 1: Open the Tables View

  • Sign in to demo.vela.run.
  • Open your organization and project.
  • Select the branch where you want to create the table.
  • Open Database and then Tables.
  • If this is a new project, you should see no app tables yet.

Step 2: Create the users Table

Click Create table and name it users. Keep the default auto-increment ID and created-at timestamp.

  • id (auto increment, primary key)
  • created_at (timestamp, default now)

Step 3: Add Columns from the Tutorial

Add these fields in the table builder:

  • username (text, not nullable)
  • email (text, set to not nullable as shown later in the video)
  • first_name (text, nullable)
  • last_name (text, nullable)
  • external_id (text, nullable)

This gives you a practical user profile shape while keeping flexibility for external identity providers.

Step 4: Keep RLS Enabled (Recommended)

In the tutorial, row-level security is enabled by default and recommended. Keep it on so table access can be controlled safely as your app grows.

RLS by default is the safer baseline for authorization-heavy applications.

Optional: SQL Equivalent

If you prefer SQL, this mirrors the same structure:

create table if not exists public.users (
  id bigserial primary key,
  created_at timestamptz not null default now(),
  username text not null,
  email text not null,
  first_name text,
  last_name text,
  external_id text
);

alter table public.users enable row level security;

What to Do Next

  • Add RLS policies for your application roles.
  • Create indexes for your main query paths.
  • Move schema changes into migrations for team workflows.

Frequently Asked Questions

Should email be nullable or required?
In the video it is first added as nullable, then updated to required. For most apps, making <code>email</code> required is a good default.
Why keep RLS enabled from day one?
RLS lets you enforce row-level access rules directly in PostgreSQL. Starting with it enabled avoids risky retrofits later.
Do I have to use the Tables UI?
No. You can use SQL too, but the Tables view is great for first setup and quick schema exploration.
What should external_id store?
Use it for IDs from external auth/identity systems so you can map external users to internal records.
What should I add right after table creation?
Add RLS policies, constraints, and indexes, then connect your app or API and validate read/write flows.