BotSpot · developer docs · data
Connect your own PostgreSQL database and manage it from BotSpot. Add and edit rows, import and export CSV, run queries, and change tables, columns, indexes and foreign keys, without opening another database tool. No SQL to write, except for SELECT queries if you want them.
Before you start

The menu next to the database in the tree has three items you will use on this page: Change schema… to show a different schema, Connection settings… for the switches below, and Activity… for the log.

Safety first
A new connection is read-only. You can browse, query and export, and nothing else: BotSpot's connection to it is locked so it cannot write even by accident. Two switches in Connection settings… unlock more, one step at a time.

The table header shows a Writable or Read only badge, and the toolbar only shows the buttons the switches allow. Turn Allow schema changes off again when the schema work is done.

Only organisation owners and admins can turn these switches on, or use what they unlock. See Who can do what.
1 · Rows
Needs: Writable.

Leave a box empty and the database fills in that column's default, such as an auto-generated ID, or NULL. If a value is the wrong type or breaks a rule on the table, the row is not added and the message says what the database objected to.
Adding many rows at once? Use CSV import.
2 · Rows, columns, tables
Needs: Writable.

Primary key cells cannot be edited.
Needs: Writable. Click the bin at the end of the row and confirm.

Needs: Allow schema changes.

The primary key column, marked PK, cannot be deleted.
Needs: Allow schema changes.

3 · Names
Needs: Allow schema changes.

Renaming changes the real database. Anything else that uses the old name, such as reports, other apps, or saved queries, has to be updated too.
4 · Files
Needs: Writable. The table must already exist; create it first if it does not.

If a batch is refused, for example because one value is the wrong type, the import stops and the message says how many rows went in before it. Those rows stay in the table. Fix the file, remove the rows that already went in, and import the rest.
Anyone in your organisation can do this, on any connected database. Open the table and click Export CSV. The file downloads with every row, up to 50,000 rows. The message tells you how many were exported; if the table has more, it says you got the first 50,000.

5 · Queries
Anyone in your organisation can do this, on any connected database, read-only or not.

Why only SELECT? A typo in a SELECT costs you a slow query. A typo in an UPDATE or DELETE can wipe a table. Every change in BotSpot goes through the forms on this page instead, which check the table and columns exist, change exactly one row by its primary key, and record it in the activity log.
6 · Schema
Needs: Allow schema changes.

Always give a table a primary key. Without one, its rows cannot be edited or deleted here. The easiest is a column named id of type Auto-generated ID (UUID) or Auto-increment ID (integer), ticked as PK; the database then fills it in for every new row.
Needs: Allow schema changes.

| Type | Use it for |
|---|---|
| Text | Any text, any length. |
| Integer | Whole numbers up to about 2 billion. |
| Big integer | Whole numbers beyond that. |
| True / false | Yes or no. |
| Decimal number | Exact decimals. Use for money. |
| Floating point number | Approximate decimals, for measurements. |
| Date | A day, no time. |
| Timestamp | A day and time, no time zone. |
| Timestamp (with time zone) | A moment in time. The usual choice for "created at". |
| UUID | A random unique ID. |
| JSON | Structured data. |
| Auto-generated ID (UUID) | Filled in for you on every new row. |
| Auto-increment ID (integer) | 1, 2, 3… filled in for you on every new row. |
Other schema changes on this page: rename, delete a column or table, indexes and foreign keys. Changing a column's type is not available yet.
7 · Speed
An index makes lookups and sorting on a column fast, the way a book's index saves reading every page. Add one on columns you often filter or sort by, such as an email or a date. Needs: Allow schema changes.

8 · Audit
Every change made through BotSpot to a connected database is recorded: rows added, edited, deleted and imported, and every table, column, index and foreign key change. Failed attempts are recorded too, with the reason.

Each line says what was done and to which table, with a green tick if it worked or a red cross and the error if it did not, newest first. Anyone in the organisation can read it; reading it changes nothing.
The log covers changes made through BotSpot. Changes made to the same database from another tool or app are not in it.
9 · Relationships
A foreign key links a column in one table to a row in another, for example each order's customer_id to a row in customers. The database then refuses an order that points at a customer who does not exist. Needs: Allow schema changes.

| When a customer is deleted | Their orders |
|---|---|
| Do nothing (default) | The delete is refused while orders still point at the customer. |
| Block the delete | The same, checked immediately. |
| Delete these rows too | The orders are deleted with the customer. |
| Set to NULL | The orders stay, with customer_id emptied. |
10 · Policy
Two things decide whether a change is allowed, and both must say yes:
| Action | Owner | Admin | Member | Auditor |
|---|---|---|---|---|
| Browse tables, run SELECT, export CSV | Yes | Yes | Yes | Yes |
| See Activity | Yes | Yes | Yes | Yes |
| Turn Writable on or off | Yes | Yes | No | No |
| Add, edit, delete rows, import CSV | Yes | Yes | No | No |
| Turn Allow schema changes on or off | Yes | Yes | No | No |
| Create, rename, delete tables and columns; indexes; foreign keys | Yes | Yes | No | No |
These are organisation roles. A connected database belongs to the whole organisation, not to one workspace, so a workspace role such as workspace admin does not add anything here. Rows that need Writable or Allow schema changes also need that switch on, whoever you are.
A member can still see the buttons on a writable database. When they try, BotSpot refuses and says they are not allowed; nothing is changed and nothing is half-done.

Giving someone access: make them an organisation admin. Today these two permissions are the same for every organisation and cannot be handed to members one by one. If your organisation needs that, tell us.
Troubleshooting
I do not see + Row, Import CSV or the edit tools.
The database is read-only. An owner or admin turns on Writable in Connection settings….
I can add rows but not edit or delete them.
The table has no primary key. Add one, then reopen the table.
I do not see Create table, Indexes or Foreign keys.
Allow schema changes is off for this database.
I see the buttons but get "not allowed".
Your organisation role does not include this. See Who can do what.
My UPDATE in the Console was refused.
The Console runs SELECT and WITH only. Edit cells in the table, or import a CSV.
A table I made in another tool does not show up.
It may be in a different schema. Use Change schema… from the database's menu.
Can I undo a delete?
No. BotSpot works on your real database. Restore from your provider's backup.