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.
In the Prisma ORM PostgreSQL QuickStart guide, Step 4 command
npx prisma init --datasource-provider postgresql --output ../generated/prismageneratesprisma.config.tsfile with this content:That is different than what the current docs in Step 4. Initialize Prisma ORM show
prisma.config.tsshould contain:Besides the missing comments, the main difference is that the config file no longer imports
envfromprisma/config, and instead relies directly onprocess.env.If this is working as intended (the content of
prisma.config.tsgenerated when running theinitcommand), 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.