Symfony is a free and open-source PHP web application framework. Symfony uses the Doctrine library for database access. Connecting to a Lakebase Postgres database from Symfony with Doctrine is the same as connecting to a standalone Postgres installation from Symfony with Doctrine. Only the connection details differ.
To connect to a Lakebase Postgres database from Symfony with Doctrine:
Create a Neon project
If you do not have one already, create a Neon project. Save your connection details including your password. They are required when defining connection settings.
- Navigate to the Projects page in the Neon Console.
- Click New Project.
- Specify your project settings and click Create Project.
Configure the connection
In your
.envfile, set theDATABASE_URLto the Neon project connection string that you copied in the previous step.DATABASE_URL="postgresql://[user]:[password]@[neon_hostname]/[dbname]?charset=utf8&sslmode=require&channel_binding=require"You can find the connection string for your database by clicking the Connect button on your Project Dashboard. For more information, see Connect from any application.
Next steps
- Add Object Storage: S3-compatible file storage that branches with your database
- Call an LLM with AI Gateway: Access foundation models from Anthropic, OpenAI, Google, and more with one credential
Need help?
Join our Discord Server to ask questions or see what others are doing with Neon. For paid plan support options, see Support.