Manual Setup1. Choose a warehouse
Postgres
Connect a PostgreSQL database to Levered.
What you need
| Item | Description |
|---|---|
| Connection string | postgresql://user:password@host:5432/database for a user with read access. |
| Schema | The schema that contains the exposures and rewards tables. The default is public. |
Create a read-only user (recommended)
CREATE ROLE levered_reader WITH LOGIN PASSWORD 'a-strong-password';
GRANT CONNECT ON DATABASE analytics TO levered_reader;
GRANT USAGE ON SCHEMA public TO levered_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO levered_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO levered_reader;Connect via the dashboard
The dashboard requires an existing exposures table and rewards table before it saves the connection. Create the tables first (Create the table).
- Click Warehouse in the Levered dashboard sidebar.
- Click PostgreSQL.
- Enter the Connection String and Schema, then click Next.
- Select the Exposures table and the Rewards table.
- Click Save Connection.
- Click Test connection on the connection card to verify that Levered can reach the database.
Troubleshooting
Connection test fails
- Check that the PostgreSQL server is accessible from the internet. If you use allowlisting, check that it is accessible from Levered's IP range.
- Check that the hostname, the port and the credentials are correct.
- Check that the user has
CONNECTon the database andUSAGEon the schema.
Permission errors at training time
Levered runs SQL queries during model training. If training fails with a permission error, check that the PostgreSQL user has SELECT access to the tables that the metric queries reference.
Next step
Set up the data pipeline to log exposures and rewards into the tables that Levered reads during training.