get-started4.05 KB
View saved version →
---
name: get-started
description: First steps with SuperDB in ChatGPT. Use when the user connects SuperDB, asks what it can do with their database projects, or asks to read, create or secure tables in a SuperDB project.
---
# Getting started with SuperDB
SuperDB is a managed Postgres backend (database, auth, storage and realtime) made in Brazil, with data in São Paulo. This plugin talks to the user's SuperDB projects through the remote MCP server at https://mcp.superdb.com.br/mcp. The connection only reaches the projects the user chose on the SuperDB consent screen.
## Which project
- **One project authorized:** the tools work on it directly. There is no `project` argument and no `superdb_list_projects`; go straight to the task.
- **Two or more:** call `superdb_list_projects` first and pass `project` (the slug) in every other call. If the user did not say which project, ask. Never pick one on your own.
- **No project yet, or the user wants another one:** offer `superdb_criar_projeto` (same rules as the dashboard). Ask for the name first. If it says the account reached its limit or needs a CPF/CNPJ, nothing was created: pass on the link it returns. The list is read on every call, so there is no need to reconnect.
## How to help
1. To understand a project, list its tables (`superdb_list_tables`) and describe the relevant ones (`superdb_describe_table`).
2. To answer questions about data, use `superdb_query_sql`. It runs in a READ ONLY transaction, so it never changes data. Prefer counts and aggregates, and select only the columns you need: these tables often hold personal data of the user's own customers (names, emails, phone numbers, CPF). Do not print more rows or personal fields than the question needs.
3. To create or change tables, use `superdb_run_sql`, and only when the user asked for a change. Show the SQL first and wait for the confirmation ChatGPT asks for.
4. To review who can read or write a table, use `superdb_list_policies`.
5. Files live in Storage buckets: `superdb_list_buckets` and `superdb_create_bucket`.
## Row level security: the part that surprises people
- Every new table is born with RLS **on and no policy**. Until a policy exists, the user's app reads `[]` and inserts are refused. That is safe, but it looks broken. Write the policies **in the same SQL** that creates the table.
- `auth.uid()`, `auth.jwt()`, `auth.role()` and `auth.email()` exist, so the usual owner policy works:
```sql
create table tasks (
id uuid primary key default gen_random_uuid(),
user_id uuid not null default auth.uid(),
title text not null
);
alter table tasks enable row level security;
create policy tasks_owner on tasks
for all to authenticated
using (user_id = auth.uid())
with check (user_id = auth.uid());
```
- **Never** "fix" an access error with `disable row level security`. New tables already carry grants for the app's roles, so turning RLS off makes the table readable by anyone with the public key. Fix the policy instead.
## Rules
- Never run destructive SQL (DROP, DELETE, TRUNCATE, an ALTER that removes data) without the user explicitly confirming it for that statement.
- For "how do I..." questions about SuperDB (SDK, auth, RLS, storage, migration), search the docs with `superdb_buscar_docs` before answering from memory, and cite the page.
- Some things are not available here on purpose: API keys, billing, paid plans, invoices (NFS-e) and changing account settings. Point the user to the dashboard at https://app.superdb.com.br.
- If a tool answers that the project is paused, over its monthly quota or still being prepared, tell the user plainly and point to the dashboard. Do not retry in a loop.
- If SuperDB behaves differently from its documentation (https://superdb.com.br/llms-full.txt), do not work around it. Tell the user it looks like a platform issue and that they can open a ticket at https://app.superdb.com.br/account/suporte, with the project slug, the SQL or call, and Preview of the first 4,000 characters. Read full instructions →