MCPcopy Create free account
hub / github.com/firebase/firebase-tools / initializeDatabaseInstance

Function initializeDatabaseInstance

src/init/features/database.ts:109–129  ·  view source on GitHub ↗
(projectId: string)

Source from the content-addressed store, hash-verified

107}
108
109async function initializeDatabaseInstance(projectId: string): Promise<DatabaseInstance | null> {
110 await ensure(projectId, rtdbManagementOrigin(), "database", false);
111 logger.info();
112
113 const instance = await getDefaultDatabaseInstance(projectId);
114 if (instance !== "") {
115 return await getDatabaseInstanceDetails(projectId, instance);
116 }
117
118 const createDefault = await confirm({
119 message:
120 "It seems like you haven’t initialized Realtime Database in your project yet. Do you want to set it up?",
121 default: true,
122 });
123
124 if (createDefault) {
125 return await createDefaultDatabaseInstance(projectId);
126 }
127
128 return null;
129}
130
131/**
132 * doSetup is the entry point for setting up the database product.

Callers 1

askQuestionsFunction · 0.85

Calls 6

ensureFunction · 0.90
rtdbManagementOriginFunction · 0.90
confirmFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…