- Read rows from your tables with parameterized SQL queries
- Insert, update, and delete rows from server-side code
- Run several statements as one transaction in a single request
Common use cases and example apps
These examples show what you can build with Neon, each with a prompt to start from.How Neon connections work
A Neon connection is one connection string, and everything Lovable builds on it runs as the role in that string.- Connection string: The string names one branch compute, one database, and one role. Lovable stores it in the connection and sends it to Neon with every query. It does not reach the browser or your app’s code.
- Gateway: Your app sends SQL to Lovable’s connector gateway, which forwards it to Neon with the connection string attached. See Gateway-based connectors for token handling and per-project request limits.
- Data access: The connection can do everything that its role can do. The default role that Neon creates with your project is a member of
neon_superuser, a Neon role with broad administrator rights. Roles that you create in the Neon Console are also members. A connection that uses one of these roles can read and change every table in the database.
How to connect Neon
Who can create Neon connections depends on your plan and workspace settings. App + chat connectors are available by default on Free, Pro, and Business plans. On Enterprise plans, they are effectively disabled at first: Who can create connections and clients defaults to No one until an admin changes it in Connectors → Admin settings → App + chat connectors. You can create multiple Neon connections using different connection strings, which is useful for separating branches (for example, a production branch and a preview branch) or roles with different permissions. Link production projects only to the connection for your production branch. When the connection is created, you can link it to the projects where you want to use it. Anyone building in a project can ask Lovable in the project chat to link their project to it.Prerequisites
Before connecting Neon, make sure you have:- A Neon account and a project with at least one database
- The connection string for the branch, database, and role your app should use
- Permission to create connections in your Lovable workspace (see Who can create connections and clients)
All queries through this connector run on your Neon compute and count toward your Neon plan. Billing and quota are handled directly by Neon, not Lovable.
Step 1: Get a Neon connection string
The connection string tells Lovable which branch compute, database, and role your app uses, and it contains the role’s password. To copy a connection string:1
Open your Neon project
Sign in to the Neon Console and open the project you want to connect.
2
Open the Connect dialog
Click Connect. The Connect to your branch dialog opens.
3
Choose the branch, database, and role
Select the branch, compute, database, and role your app should use. Leave Connection pooling enabled unless you need a direct connection. Both forms work with Lovable.
4
Copy the connection string
Copy the plain connection string, which starts with
postgresql://. Do not copy a framework snippet, a psql command, or a .env line.Step 2: Connect Neon to Lovable
Lovable stores the connection string in the connection and verifies it before saving.1
Open Neon in Connectors
Open Connectors and select Neon. For the other places to open the catalog from, see Where to find connectors.
2
Add a connection
Click Add connection and select App + chat connector. The form is split into collapsible sections, Details, Configure connection, and Sharing.
3
Name the connection
Under Details, Lovable fills in a name for the connection, which you can change. The name is only used inside Lovable to identify the connection.
4
Configure the connection
Under Configure connection, paste the connection string you copied from Neon into Connection string as a single
postgresql:// URL, without quotes or a prefix. Passwords that Neon generates need no changes. If your password or database name contains characters such as @, #, /, or ?, percent-encode each one. For example, @ becomes %40. Get value next to the field opens Neon’s connection guide.5
Choose who can use this connection
Under Sharing, the connection is private to you by default and shows a Private label. To share it, click Share with others. Then add workspace members by email, or click Invite entire workspace to make the connection available to everyone in your Lovable workspace.See Who can use connections and clients for more information.
6
Connect
Click Connect. Lovable verifies the connection string by running a
select 1 query against your Neon database before saving the connection.Limitations
The Neon connector cannot:- Manage your Neon account. The connector runs SQL against the connected database. It does not create or list projects, branches, or computes. Use the Neon Console for that.
- Restrict what a query can do beyond the connected role’s own permissions. Everyone who uses the connection queries as that role.
- Support per-end-user Neon login. Each connection represents a single Neon database and role shared across all projects linked to it.
- Send or receive more than 64 MB in one request. Neon sets this limit for each request and each response.
Troubleshooting
Use these checks when connecting fails or a query returns an unexpected error.Neon returns "password authentication failed"
Neon returns "password authentication failed"
Neon returns this message, or Control plane request failed: endpoint cannot be found, when the connection string does not match a role and compute in your Neon project. The password is wrong or was reset, the role was dropped, or the branch or compute in the string was deleted. When Connect fails, Lovable shows Neon did not validate your credentials. Click Show error to see Neon’s message.Retrying does not help. Check in the Neon Console that the branch and compute still exist, then copy a fresh connection string. If you set your own password, check its special characters as Step 2 describes. For a new connection, click Connect again.Only the person who created the connection can update it. Open Connectors, select Neon, open the connection, and under Configure connection paste the new connection string and click Update. Other workspace members create a connection of their own instead.
Neon returns "The endpoint has been disabled"
Neon returns "The endpoint has been disabled"
The connection string still works, so replacing it does not help. Neon does not serve a disabled compute, and you cannot enable it from the Neon Console. Enable it with the Neon API, as the message says, then retry.
A request returned 429 Too Many Requests
A request returned 429 Too Many Requests
Lovable’s connector gateway enforces a per-project usage limit on requests from your app and returns
429 with a Retry-After header before the query reaches Neon. Ask Lovable to cache results, combine related statements into one transaction, and read on demand rather than on a frequent fixed timer.Manage your Neon connection
Connections are managed from Connectors: select Neon, then open the connection.- Unlink projects to remove Neon access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
- Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use Neon stop working until a new connection is added. See Delete a connection for the steps and who can delete.