Neon
Connect Dot to Neon with a read-only role and ask questions about your data in plain language.
Dot connects to your Neon database with a read-only Postgres role. You need to be an admin in Dot to add the connection.
Create a read-only role for Dot
A role you create in the Neon Console gets admin rights, so it can change your data. Create Dot's role with SQL instead.
Open the Neon Console and select your project.
Open the SQL Editor. Pick the branch and the database Dot should read.
Run the statements below. Replace
neondbwith your database name.
CREATE ROLE dot_reader WITH LOGIN PASSWORD '<password>';
GRANT CONNECT ON DATABASE neondb TO dot_reader;
GRANT USAGE ON SCHEMA public TO dot_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO dot_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO dot_reader;Repeat the last three statements for each schema Dot should read.
Neon only accepts a password with at least 60 bits of entropy. Use at least 12 characters, and mix lowercase and uppercase letters, numbers, and symbols. A weaker password fails with an "insecure password" error.
Copy the connection string
In the Neon Console, click Connect.
Pick the branch, the database, and the
dot_readerrole, not the owner role.Copy the connection string.
Each branch has its own host. Pick the branch your team's data is on, usually your production branch.
The connection string contains the password. Treat it like a password.
Allow Dot's IP addresses
If you limit access with Neon's IP Allow, add Dot's IP addresses before you connect:
In the Neon Console, open your project and click Settings.
Click Networking.
Under Public internet access, add both of Dot's IP addresses to the allowlist:
5.78.211.110(US)178.105.217.177(EU)
Click Save changes.
Connect in Dot
Go to Settings → Connections.
Under Databases, open Neon.
Paste the connection string into Host. Dot fills in the host, port, database, username, and password.
Optional: in Schemas, list the schemas Dot should sync, separated by commas. Leave it empty to sync every schema you gave
dot_readeraccess to.Click Connect.
Dot checks the connection, saves it, and starts a sync. The sync reads your tables, views, and columns. Comments you wrote on tables and columns in Neon become descriptions in Dot.
Dot always connects to Neon with SSL mode require, so the connection is encrypted. Neon refuses connections without SSL.
Choose the tables Dot uses
After the first sync, open Model and turn on the tables Dot should use. Dot answers only from tables that are on. When Neon is your company's first database in Dot and only you have used Dot so far, Dot turns on up to 10 tables that look most useful and lists them at the end of the sync log. Otherwise every table starts off, so turn on the ones your team asks about.
If something goes wrong
If Dot answers "No tables found", it did not save the connection. Check that you picked the database that holds your tables.
If a table is missing in Dot, grant
dot_readerSELECT on it and sync again.If the sync log says Dot has no SELECT privilege on some tables, the log also lists the GRANT statements that fix it. Run them and sync again.
Good to know
By default, Neon suspends a compute after 5 minutes without queries. A question or a sync wakes it, so the first query after a pause takes a little longer.
Each query Dot runs to answer a question starts with a
/* Dot:: ... */comment. The comment names the Dot user and the chat the question came from.
Last updated