Databutton
DiscordSign up
  • Getting Started
    • Databutton University
    • Meet the Databutton AI agent
  • Help & FAQ
  • Prompting in Databutton
    • Top prompting strategies
    • Prompting app UI & design
    • Prompting up your backend (APIs)
    • Troubleshooting prompt
    • Connecting UI with the Backend
    • Prompt Gallery
  • Using Tasks
    • How to use tasks in Databutton
    • Writing a good task
    • Chaining tasks
  • Task Gallery
  • Integrating SaaS Services
    • Authentication Integration
      • Firebase Integration
      • Supabase Integration
    • Working with Firestore Database
    • Working with Supabase Table
    • Stripe Integration
  • App Configurations
    • Package Installations
    • Managing Secrets
    • Customising Agent Behavior
    • Invite Collaborators
    • Customising App Design
  • Tutorials
    • Configuring a custom domain for your app
  • Databutton MCP – Build tools for AI
  • Troubleshooting
    • Browser window crashes
Powered by GitBook
On this page

Was this helpful?

  1. Integrating SaaS Services

Working with Supabase Table

Add user data to Supabase Table

PreviousWorking with Firestore DatabaseNextStripe Integration

Last updated 2 months ago

Was this helpful?

Once 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.

Supabase Auth