MCPcopy
hub / github.com/nextjs/saas-starter / getPostgresURL

Function getPostgresURL

lib/db/setup.ts:80–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79
80async 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
98async function setupLocalPostgres() {
99 console.log('Checking if Docker is installed...');

Callers 1

mainFunction · 0.85

Calls 2

questionFunction · 0.85
setupLocalPostgresFunction · 0.85

Tested by

no test coverage detected