Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Add Warsaw (europe-central2) Cloud Function Location to Firebase Extension template.
- Add Singapore (asia-southeast1) as a valid Firebase Realtime Database location.
1 change: 1 addition & 0 deletions src/init/features/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ async function createDefaultDatabaseInstance(project: string): Promise<DatabaseI
choices: [
{ name: "us-central1", value: DatabaseLocation.US_CENTRAL1 },
{ name: "europe-west1", value: DatabaseLocation.EUROPE_WEST1 },
{ name: "asia-southeast1", value: DatabaseLocation.ASIA_SOUTHEAST1 },
],
});
let instanceName = `${project}-default-rtdb`;
Expand Down
9 changes: 6 additions & 3 deletions src/management/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum DatabaseInstanceState {
export enum DatabaseLocation {
US_CENTRAL1 = "us-central1",
EUROPE_WEST1 = "europe-west1",
ASIA_SOUTHEAST1 = "asia-southeast1",
ANY = "-",
}

Expand Down Expand Up @@ -206,15 +207,17 @@ export function parseDatabaseLocation(
return defaultLocation;
}
switch (location.toLowerCase()) {
case "europe-west1":
return DatabaseLocation.EUROPE_WEST1;
case "us-central1":
return DatabaseLocation.US_CENTRAL1;
case "europe-west1":
return DatabaseLocation.EUROPE_WEST1;
case "asia-southeast1":
return DatabaseLocation.ASIA_SOUTHEAST1;
case "":
return defaultLocation;
default:
throw new FirebaseError(
`Unexpected location value: ${location}. Only us-central1, and europe-west1 locations are supported`
`Unexpected location value: ${location}. Only us-central1, europe-west1, and asia-southeast1 locations are supported`
);
}
}
Expand Down