@@ -7,9 +7,10 @@ import type {
77 ProjectConfig ,
88 Runtime ,
99} from "../../types" ;
10+ import { getDockerStatus } from "../../utils/docker-utils" ;
1011import { getPackageExecutionCommand } from "../../utils/package-runner" ;
1112
12- export function displayPostInstallInstructions (
13+ export async function displayPostInstallInstructions (
1314 config : ProjectConfig & { depsInstalled : boolean } ,
1415) {
1516 const {
@@ -34,7 +35,7 @@ export function displayPostInstallInstructions(
3435
3536 const databaseInstructions =
3637 ! isConvex && database !== "none"
37- ? getDatabaseInstructions ( database , orm , runCmd , runtime , dbSetup )
38+ ? await getDatabaseInstructions ( database , orm , runCmd , runtime , dbSetup )
3839 : "" ;
3940
4041 const tauriInstructions = addons ?. includes ( "tauri" )
@@ -193,15 +194,24 @@ function getLintingInstructions(runCmd?: string): string {
193194 ) } Format and lint fix: ${ `${ runCmd } check` } \n`;
194195}
195196
196- function getDatabaseInstructions (
197+ async function getDatabaseInstructions (
197198 database : Database ,
198199 orm ?: ORM ,
199200 runCmd ?: string ,
200201 runtime ?: Runtime ,
201202 dbSetup ?: DatabaseSetup ,
202- ) : string {
203+ ) : Promise < string > {
203204 const instructions = [ ] ;
204205
206+ if ( dbSetup === "docker" ) {
207+ const dockerStatus = await getDockerStatus ( database ) ;
208+
209+ if ( dockerStatus . message ) {
210+ instructions . push ( dockerStatus . message ) ;
211+ instructions . push ( "" ) ;
212+ }
213+ }
214+
205215 if ( runtime === "workers" && dbSetup === "d1" ) {
206216 const packageManager = runCmd === "npm run" ? "npm" : runCmd || "npm" ;
207217
@@ -255,10 +265,26 @@ function getDatabaseInstructions(
255265 ) } Prisma with Bun may require additional configuration. If you encounter errors,\nfollow the guidance provided in the error messages`,
256266 ) ;
257267 }
258-
268+ if ( database === "mongodb" && dbSetup === "docker" ) {
269+ instructions . push (
270+ `${ pc . yellow (
271+ "WARNING:" ,
272+ ) } Prisma + MongoDB + Docker combination may not work.`,
273+ ) ;
274+ }
275+ if ( dbSetup === "docker" ) {
276+ instructions . push (
277+ `${ pc . cyan ( "•" ) } Start docker container: ${ `${ runCmd } db:start` } ` ,
278+ ) ;
279+ }
259280 instructions . push ( `${ pc . cyan ( "•" ) } Apply schema: ${ `${ runCmd } db:push` } ` ) ;
260281 instructions . push ( `${ pc . cyan ( "•" ) } Database UI: ${ `${ runCmd } db:studio` } ` ) ;
261282 } else if ( orm === "drizzle" ) {
283+ if ( dbSetup === "docker" ) {
284+ instructions . push (
285+ `${ pc . cyan ( "•" ) } Start docker container: ${ `${ runCmd } db:start` } ` ,
286+ ) ;
287+ }
262288 instructions . push ( `${ pc . cyan ( "•" ) } Apply schema: ${ `${ runCmd } db:push` } ` ) ;
263289 instructions . push ( `${ pc . cyan ( "•" ) } Database UI: ${ `${ runCmd } db:studio` } ` ) ;
264290 if ( database === "sqlite" && dbSetup !== "d1" ) {
@@ -268,6 +294,12 @@ function getDatabaseInstructions(
268294 ) } Start local DB (if needed): ${ `cd apps/server && ${ runCmd } db:local` } `,
269295 ) ;
270296 }
297+ } else if ( orm === "mongoose" ) {
298+ if ( dbSetup === "docker" ) {
299+ instructions . push (
300+ `${ pc . cyan ( "•" ) } Start docker container: ${ `${ runCmd } db:start` } ` ,
301+ ) ;
302+ }
271303 } else if ( orm === "none" ) {
272304 instructions . push (
273305 `${ pc . yellow ( "NOTE:" ) } Manual database schema setup required.` ,
0 commit comments