@@ -21,6 +21,7 @@ import type {
2121 ProjectConfig ,
2222 ProjectDatabase ,
2323 ProjectFeature ,
24+ ProjectORM ,
2425} from "./types" ;
2526import { generateReproducibleCommand } from "./utils/generate-reproducible-command" ;
2627import { getUserPkgManager } from "./utils/get-package-manager" ;
@@ -101,6 +102,25 @@ async function gatherConfig(
101102 } ,
102103 ] ,
103104 } ) ,
105+ orm : ( ) =>
106+ flags . orm !== undefined
107+ ? Promise . resolve ( flags . orm )
108+ : select < ProjectORM > ( {
109+ message : "Which ORM would you like to use?" ,
110+ options : [
111+ {
112+ value : "drizzle" ,
113+ label : "Drizzle" ,
114+ hint : "Type-safe, lightweight ORM (recommended)" ,
115+ } ,
116+ // {
117+ // value: "prisma",
118+ // label: "Prisma (coming soon)",
119+ // hint: "Feature-rich ORM with great DX",
120+ // },
121+ ] ,
122+ initialValue : "drizzle" ,
123+ } ) ,
104124 auth : ( ) =>
105125 flags . auth !== undefined
106126 ? Promise . resolve ( flags . auth )
@@ -186,6 +206,7 @@ async function gatherConfig(
186206 return {
187207 projectName : result . projectName ?? DEFAULT_CONFIG . projectName ,
188208 database : result . database ?? DEFAULT_CONFIG . database ,
209+ orm : result . orm ?? DEFAULT_CONFIG . orm ,
189210 auth : result . auth ?? DEFAULT_CONFIG . auth ,
190211 features : result . features ?? DEFAULT_CONFIG . features ,
191212 git : result . git ?? DEFAULT_CONFIG . git ,
@@ -202,6 +223,9 @@ function displayConfig(config: Partial<ProjectConfig>) {
202223 if ( config . database ) {
203224 configDisplay . push ( `${ pc . blue ( "Database:" ) } ${ config . database } ` ) ;
204225 }
226+ if ( config . orm ) {
227+ configDisplay . push ( `${ pc . blue ( "ORM:" ) } ${ config . orm } ` ) ;
228+ }
205229 if ( config . auth !== undefined ) {
206230 configDisplay . push ( `${ pc . blue ( "Authentication:" ) } ${ config . auth } ` ) ;
207231 }
@@ -245,6 +269,8 @@ async function main() {
245269 . option ( "--pnpm" , "Use pnpm package manager" )
246270 . option ( "--yarn" , "Use yarn package manager" )
247271 . option ( "--bun" , "Use bun package manager" )
272+ . option ( "--drizzle" , "Use Drizzle ORM" )
273+ . option ( "--prisma" , "Use Prisma ORM (coming soon)" )
248274 . parse ( ) ;
249275
250276 const options = program . opts ( ) ;
@@ -257,6 +283,7 @@ async function main() {
257283 : options . postgres
258284 ? "postgres"
259285 : undefined ,
286+ orm : options . drizzle ? "drizzle" : options . prisma ? "prisma" : undefined ,
260287 auth : "auth" in options ? options . auth : undefined ,
261288 packageManager : options . npm
262289 ? "npm"
@@ -293,6 +320,11 @@ async function main() {
293320 yes : true ,
294321 projectName : projectDirectory ?? DEFAULT_CONFIG . projectName ,
295322 database : options . database ?? DEFAULT_CONFIG . database ,
323+ orm : options . drizzle
324+ ? "drizzle"
325+ : options . prisma
326+ ? "prisma"
327+ : DEFAULT_CONFIG . orm , // Add this line
296328 auth : options . auth ?? DEFAULT_CONFIG . auth ,
297329 git : options . git ?? DEFAULT_CONFIG . git ,
298330 packageManager :
0 commit comments