@@ -4,8 +4,7 @@ import { consola } from "consola";
44import { execa } from "execa" ;
55import fs from "fs-extra" ;
66import pc from "picocolors" ;
7- import type { ORM , PackageManager , ProjectConfig } from "../../types" ;
8- import { addPackageDependency } from "../../utils/add-package-deps" ;
7+ import type { PackageManager , ProjectConfig } from "../../types" ;
98import { exitCancelled } from "../../utils/errors" ;
109import { getPackageExecutionCommand } from "../../utils/package-runner" ;
1110import { addEnvVariablesToFile , type EnvVariable } from "../core/env-setup" ;
@@ -37,7 +36,6 @@ const AVAILABLE_REGIONS = [
3736async function setupWithCreateDb (
3837 serverDir : string ,
3938 packageManager : PackageManager ,
40- orm : ORM ,
4139) {
4240 try {
4341 log . info ( "Starting Prisma Postgres setup with create-db." ) ;
@@ -73,13 +71,8 @@ async function setupWithCreateDb(
7371 return null ;
7472 }
7573
76- const databaseUrl =
77- orm === "drizzle"
78- ? createDbResponse . directConnectionString
79- : createDbResponse . connectionString ;
80-
8174 return {
82- databaseUrl,
75+ databaseUrl : createDbResponse . connectionString ,
8376 claimUrl : createDbResponse . claimUrl ,
8477 } ;
8578 } catch ( error ) {
@@ -113,16 +106,16 @@ async function initPrismaDatabase(
113106
114107 log . info (
115108 pc . yellow (
116- "Please copy the Prisma Postgres URL from the output above .\nIt looks like: prisma+postgres ://accelerate.prisma-data.net/?api_key=... " ,
109+ "Please copy the Prisma Postgres URL.\nIt looks like: postgresql ://user:password@host:5432/db?sslmode=require " ,
117110 ) ,
118111 ) ;
119112
120113 const databaseUrl = await text ( {
121114 message : "Paste your Prisma Postgres database URL:" ,
122115 validate ( value ) {
123116 if ( ! value ) return "Please enter a database URL" ;
124- if ( ! value . startsWith ( "prisma+postgres ://" ) ) {
125- return "URL should start with prisma+postgres ://" ;
117+ if ( ! value . startsWith ( "postgresql ://" ) ) {
118+ return "URL should start with postgresql ://" ;
126119 }
127120 } ,
128121 } ) ;
@@ -202,23 +195,6 @@ function displayManualSetupInstructions(target: "apps/web" | "apps/server") {
202195DATABASE_URL="your_database_url"` ) ;
203196}
204197
205- async function addPrismaAccelerateExtension ( projectDir : string ) {
206- try {
207- const dbPackageDir = path . join ( projectDir , "packages/db" ) ;
208- await addPackageDependency ( {
209- dependencies : [ "@prisma/extension-accelerate" ] ,
210- projectDir : dbPackageDir ,
211- } ) ;
212-
213- return true ;
214- } catch ( _error ) {
215- log . warn (
216- pc . yellow ( "Could not add Prisma Accelerate extension automatically" ) ,
217- ) ;
218- return false ;
219- }
220- }
221-
222198export async function setupPrismaPostgres (
223199 config : ProjectConfig ,
224200 cliInput ?: { manualDb ?: boolean } ,
@@ -292,7 +268,7 @@ export async function setupPrismaPostgres(
292268 let prismaConfig : PrismaConfig | null = null ;
293269
294270 if ( setupMethod === "create-db" ) {
295- prismaConfig = await setupWithCreateDb ( dbDir , packageManager , orm ) ;
271+ prismaConfig = await setupWithCreateDb ( dbDir , packageManager ) ;
296272 } else {
297273 prismaConfig = await initPrismaDatabase ( dbDir , packageManager ) ;
298274 }
@@ -302,15 +278,10 @@ export async function setupPrismaPostgres(
302278
303279 if ( orm === "prisma" ) {
304280 await addDotenvImportToPrismaConfig ( projectDir , backend ) ;
305- await addPrismaAccelerateExtension ( projectDir ) ;
306281 }
307282
308- const connectionType =
309- orm === "drizzle" ? "direct connection" : "Prisma Accelerate" ;
310283 log . success (
311- pc . green (
312- `Prisma Postgres database configured successfully with ${ connectionType } !` ,
313- ) ,
284+ pc . green ( "Prisma Postgres database configured successfully!" ) ,
314285 ) ;
315286
316287 if ( prismaConfig . claimUrl ) {
0 commit comments