Connect your database
Your reports read your data through a connector. There are three kinds:
data files you drop in a folder, a database file on your computer, and a
hosted database. A data-file connector needs no setup; the others need a
few values in the app's private settings file, app/.env. That file stays
on your computer and is never saved to git.
Start
Tell Claude where your data is:
"My sales are in a CSV export. Set the app up to read it."
"Connect my Postgres database. Open app/.env for me and I will paste the connection string in myself."
You can also give Claude the values in the chat, but you do not have to: pasting secrets into the file yourself keeps them out of the conversation.
Claude creates app/.env from app/.env.example if it does not exist yet,
shows you which lines to fill in, and checks the result. A key with a
default may be left out.
Data files
The data-file connectors read the files in a folder of app/data/ as
tables you query in SQL (SQLite's dialect). Each file is a table named after
it: sales.csv is sales. Names and column headers are made lowercase,
with anything but letters, digits and _ turned into _: the header
Order Date is the column order_date. A column holding only numbers is
numbers; everything else is text. When you add, change or remove a file,
the next report you open reads it again. Each connector ships a small
sample file, sales, with four regions and their sales and orders.
CSV files (csv)
Drop .csv files in app/data/csv/. The first line is the header; commas,
semicolons and tabs all work. This is the default connector: it needs no
.env at all.
"Here is orders.csv. Put it in the CSV folder and make a report of orders per month."
Excel files (excel)
Drop .xlsx files in app/data/excel/. Every sheet is a table named
<file>_<sheet>: the sheet Regions of sales.xlsx is sales_regions. A
sheet's first row is its header; a formula reads as its last value.
"I put budget.xlsx in the Excel folder. Which tables did it make?"
JSON files (json)
Drop .json files in app/data/json/. A file is a list of objects, or an
object with that list under "rows". The columns are every key any object
has; a missing key is empty.
"Read the export in app/data/json/visits.json and chart visits per day."
Local database
SQLite (sqlite)
A SQLite database file on your computer, opened read-only.
"Read my SQLite database at app/data/shop.sqlite."
Hosted database
SQL Server (sqlserver)
"Connect our SQL Server. I will paste the password into app/.env myself."
Postgres (postgres)
"Connect my Postgres database."
MySQL (mysql)
"Connect our MySQL database. I have the connection string."
BigQuery (bigquery)
BigQuery signs in with a service account key file. Ask whoever runs your Google Cloud project for one with read access to BigQuery, save it on your computer, and give Claude its path.
"Connect BigQuery, project my-project. The key file is in my Downloads."
Amazon Redshift (redshift)
"Connect our Redshift cluster."
The connection is encrypted and the server's certificate is checked.
More than one database
When the app has more than one connector, SILVI_CONNECTOR in app/.env
names the default one, and each report can name its own in its file
(connector: "redshift" in its meta). Ask:
"Make Redshift the default, and have the Orders report read Postgres."
A database the app does not have yet
If your app was made without the connector you need, ask:
"Add the SQL Server connector."
Claude adds it to the app and adds its keys to app/.env.example. Then fill
them in as above.
Check it works
- Open a report that uses the database. It no longer says Not connected.
- Ask Claude: "Open every report and check its figures load." A query the database refuses shows its message on the page.
If a report still says Not connected, it names the keys it is missing. Read Fix problems.