Working with Supabase Table

Add user data to Supabase Table

Once Supabase Auth is up and running, you can easily work with the table. Databutton agent creates an initial task to work with.

However, it is important to keep a few things in mind.

  1. Use the Frontend for All Operations: Instruct Databutton to execute all database operations through the frontend

  2. Run the SQL Script: After defining the schema, copy the SQL schema provided and run the SQL script in your Supabase project to create the tables, set up relationships, and configure security policies.

  3. Define Data Types: Ensure that appropriate data types are assigned for each field. Usually these files will be located udner the UI file section in Databutton

Here’s a set of custom instructions you can use to update Databutton in the task activity. Just make sure they fit your use case.

### Frontend Integration:
- Perform all database operations directly via the frontend using the Supabase client.

### Design Database Schema:
- Define the core tables and necessary fields.

[OPTIONAL]
- Use UUIDs for primary keys and timestamps for creation and updates.
- Ensure appropriate data types for each field (e.g., text, boolean, integer).

### Set Up Relationships:
- Create foreign keys to link related tables.

[OPTIONAL]
- Use many-to-many relationships where needed (e.g., users and communities).

### Implement Row Level Security (RLS):
- Enable RLS on all tables.
- Set policies to control access, ensuring users can only access their own data and control visibility for private vs. public data.

### Set Up Indexes:
- Add indexes to frequently queried fields for better performance.

### Schema Execution:
After the schema design is provided, **run the SQL schema** in your Supabase project to create the tables, set up relationships, implement RLS policies, and configure indexes.

Last updated

Was this helpful?