Files
supabase/apps/studio/data/read-replicas/replicas.utils.ts
Joshen Lim 539c2bbace feat/rr-functionality (#19466)
* Implement read, create, delete replicas

* Long poll replica statuses if any one of them is coming up

* Support querying replicas in SQL editor

* Add optimistic rendering for setting up and removing replicas

* Small style fix for database selector in SQL editor

* Small fix

* Add Alerts around PITR and PG upgrades RE read replicas

* Small fixes after testing flag off

* Add UI guards to check that project has PITR before deploying replica

* Fix

* Address feedback

* Fix

* Update replicas RQ to enable based on flag
2023-12-08 13:41:35 +08:00

8 lines
411 B
TypeScript

import { AVAILABLE_REPLICA_REGIONS } from 'components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants'
import { last } from 'lodash'
export const formatDatabaseID = (id: string) => last(id.split('-') ?? [])
export const formatDatabaseRegion = (region: string) =>
last(AVAILABLE_REPLICA_REGIONS.find((r) => r.region === region)?.name.split('('))?.split(')')[0]