Skip to main content
Neon Postgres Docs

Search documentation

Type to search this documentation.

On this pageOverview

Connect from Symfony with Doctrine to Neon

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 sam...

Pre-built prompt for connecting Symfony applications to Lakebase Postgres using Doctrine ORM.

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:

  1. 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.

    1. Navigate to the Projects page in the Neon Console.
    2. Click New Project.
    3. Specify your project settings and click Create Project.
  2. Configure the connection

    In your .env file, set the DATABASE_URL to the Neon project connection string that you copied in the previous step.

    Bash
    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 in the Console nav. For more information, see Connect from any application.

Join our Discord Server to ask questions or see what others are doing with Neon. For paid plan support options, see Support.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu