Skip to content

prisma init ... command generates different output, than what is shown in the docs #7818

@goran1010

Description

@goran1010

In the Prisma ORM PostgreSQL QuickStart guide, Step 4 command npx prisma init --datasource-provider postgresql --output ../generated/prisma generates prisma.config.ts file with this content:

// This file was generated by Prisma, and assumes you have installed the following:
// npm install --save-dev prisma dotenv
import "dotenv/config";
import { defineConfig } from "prisma/config";

export default defineConfig({
  schema: "prisma/schema.prisma",
  migrations: {
    path: "prisma/migrations",
  },
  datasource: {
    url: process.env["DATABASE_URL"],
  },
});

That is different than what the current docs in Step 4. Initialize Prisma ORM show prisma.config.ts should contain:

import "dotenv/config";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
  schema: "prisma/schema.prisma",
  migrations: {
    path: "prisma/migrations",
  },
  datasource: {
    url: env("DATABASE_URL"),
  },
});

Besides the missing comments, the main difference is that the config file no longer imports env from prisma/config, and instead relies directly on process.env.

If this is working as intended (the content of prisma.config.ts generated when running the init command), the docs should probably be updated to match the output.

If this is indeed the case, I don't mind creating a quick PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions