()
| 78 | } |
| 79 | |
| 80 | async function getPostgresURL(): Promise<string> { |
| 81 | console.log('Step 2: Setting up Postgres'); |
| 82 | const dbChoice = await question( |
| 83 | 'Do you want to use a local Postgres instance with Docker (L) or a remote Postgres instance (R)? (L/R): ' |
| 84 | ); |
| 85 | |
| 86 | if (dbChoice.toLowerCase() === 'l') { |
| 87 | console.log('Setting up local Postgres instance with Docker...'); |
| 88 | await setupLocalPostgres(); |
| 89 | return 'postgres://postgres:postgres@localhost:54322/postgres'; |
| 90 | } else { |
| 91 | console.log( |
| 92 | 'You can find Postgres databases at: https://vercel.com/marketplace?category=databases' |
| 93 | ); |
| 94 | return await question('Enter your POSTGRES_URL: '); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | async function setupLocalPostgres() { |
| 99 | console.log('Checking if Docker is installed...'); |
no test coverage detected