Create a project

In the Prisma Data Platform, you can create new projects with just a connection string for an available database. If your database sits behind a firewall or only allows connections from specific IPs, you can enable the use of static IPs of the platform and add them to your database allowlist. You can also select the Data Proxy region to prepare your project for connection pooling and load balancing in serverless environments.

After you create your project, you can optionally link your Prisma schema (if you push it to a GitHub repository) so that we can keep your project in sync with its latest version.

The features in Data Browser and Query Console rely on an up-to-date schema that matches the latest data model in your database.

When you create a project with an existing database, the platform introspects your database and generates a Prisma schema for your project. If you make a change to your database model and the platform does not have a linked schema, you and your team might start seeing errors while you use Data Browser and Query Console.

If you create a project with an empty database, Data Browser and Query Console remain inactive for the project because the database introspection cannot generate a Prisma schema from an empty database.

Later, if you want to enable connection pooling and load balancing of database connections with the Data Proxy, you can copy the Data Proxy connection string for the project.

Create a project

When you create a project, you only need a database connection string.

Prerequisites

Copy the database connection string for your project. The platform uses the connection string only to read and introspect the database.

Note

Check that the connection string meets the requirements listed below.
  • Use a Prisma ORM-supported database.
  • The connection string must include user and password
  • Use the connection string format below.
    <db-type>://<user>:<password>@<hostname>:<port>/<db-name>
  • Steps

    1. From the Projects page, click New Project.

    2. In Connection string, paste the database connection string.

    3. (Optional) From Static IPs, select Enabled if your database is behind a firewall and you can only configure external access from specific IP addresses. Copy the IP addresses and add them to the allowlist of your database.

      Note

      For more information, see Static egress IP address.

    4. From Choose a Data Proxy region, select the geographic location for the Data Proxy.

      Important

      Select a Data Proxy location that is close to the geographic location of your database.

      If you select a location that is remote from your database, then when your application sends requests to your database through the Data Proxy, you might notice some delay in the responses.

      After you create the project, you can create a Data Proxy connection string and use that to set up connection pooling locally or in your deployment environment.

    5. Click Create project.

      Prisma Data Platform - Create project - Paste database connection string, select Data Proxy region, enable static IPs

    Result

    The platform creates your project and assigns it a random name, such as Grey fish <random-code>, where <random-code> is an auto-generated code. You can later change the project name from the project settings.

    If your database does not contain any models

    You see a notification that your database is empty. Because your database does not contain any models, the introspection cannot generate a Prisma schema.

    As a result, Data Browser and Query Console are inactive. You can start using them after you enable Prisma schema synchronization.

    If your database contains models

    The platform introspects the database to read the data models so that it can generate the Prisma schema. The Prisma schema enables the features in Data Browser and Query Console, where you can edit and query your data.

    If introspection fails and can't generate a schema

    You will be prompted with a notification telling that your project was created but introspection failed. Introspection may fail if the database is unreachable or the process timeouts. In order to utilize the Data Browser or Query Console, a project must have a valid Prisma schema that matches with the provided database.

    Upon introspection failure, you will be taken to a "Provide schema" view, where you can provide a schema by either linking a schema from a repository or upload your schema.

    What's next

    (Optional) Provide a schema

    After you create a project but introspection fails, you can provide a schema on the Provide a schema screen. You can provide a schema by either linking a schema from a repository or uploading your schema file

    You can link a schema from a repository to keep your project's Prisma schema and data models in Data Browser and Query Console updated with the latest version of your Prisma schema.

    Steps:

    1. On the Link a schema from a repository section, from GitHub Account, select a GitHub account or organization.

    2. From Repository, select the GitHub repository you want to import.

    3. From Branch, select the branch you want to import.

    4. In Prisma schema path, enter the path to the schema.prisma file.

      Note

      The pre-filled path prisma/schema.prisma is the default path. Change it to the path you use for your project.
    5. Click Link Prisma schema.

      Prisma Data Platform - Create project - Link a schema from a repository - Select GitHub account, repository, branch, and Prisma schema path

    Result

    A Prisma schema is now linked to your project.

    The platform updates the Prisma schema in your project every time you push a schema change to your repository.

    Upload a schema file

    Steps:

    1. On the Or upload your schema section, either:

      • Click on the drop zone to open your file manager and select your schema
      • Drag and drop your schema file to the drop zone
    2. Review the preview of your schema file

      Note

      The schema preview does not contain any syntax highlighting for your schema file.
    3. Click Upload file.

      Prisma Data Platform - Create project - Upload your schema - Select Prisma schema file from file system

    Result

    A Prisma schema is now linked to your project. However, the schema will not be synchronized with your project. You can manually synchronize the Prisma schema in your project by refreshing the schema in the Schema tab of your project.

    To keep your schema in sync with your project, you can link the project to a GitHub repository.

    What's next

    You can now use Data Browser and Query Console with the latest version of your Prisma schema.

    (Optional) Enable schema synchronization

    After you create the project, you can enable automated schema synchronization on the Get started screen. This means that if you push your Prisma schema to a GitHub repository, you can link the Prisma schema and the GitHub repository to your project.

    With this, the platform can keep the Prisma schema up-to-date for your project and also keep the data models in Data Browser and Query Console updated with the latest version of your Prisma schema.

    Steps

    1. On the Get started screen, from GitHub Accounts & Organizations, select a GitHub account or an organization.

    2. From Repository, select the GitHub repository you want to import.

    3. From Branch, select the branch you want to import.

    4. In Prisma schema path, enter the path to the schema.prisma file.

      Note

      The pre-filled path prisma/schema.prisma is the default path. Change it to the path you use for your project.
    5. Click Link Prisma schema.

      Prisma Data Platform - Create project - Enable Prisma schema synchronization - Select GitHub account, repository, branch, and Prisma schema path

    Result

    The repository and the Prisma schema are now linked to your project. The platform updates the Prisma schema in your project every time you push a change to it.

    What's next

    You can now use Data Browser and Query Console with the latest version of your Prisma schema.

    (Optional) Create a Data Proxy connection string

    After you create the project, you can create and copy a Data Proxy connection string for the project on the Get started screen. You can then use the connection string in Prisma Client to enable connection pooling and load balancing of database connections locally or in your deployment environment.

    Steps

    1. Click Generate a Data Proxy connection string.

    2. Click Create a new connection string.

    3. Enter a name for the connection string and click Create.

    4. Copy the prisma:// connection string.

      Prisma Data Platform - Create project - Copy Data Proxy connection string

    What's next

    You can now enable connection pooling with Data Proxy locally or in your deployment environment.

    Next steps

    With your project created in the Prisma Data Platform, you can explore your project with Data Browser, Query Console, and Schema Viewer.

    Next, you can develop your Prisma schema and your database models further and migrate any schema changes to your database with prisma migrate dev.

    You can also change your project settings or add new environments if you want to isolate development activities with test databases and test branches, and select a different Data Proxy region for an environment.

    Edit this page on GitHub