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

Function pickOneService

src/dataconnect/load.ts:22–40  ·  view source on GitHub ↗
(
  projectId: string,
  config: Config,
  service?: string,
  location?: string,
)

Source from the content-addressed store, hash-verified

20
21/** Picks exactly one SQL Connect service based on flags. */
22export async function pickOneService(
23 projectId: string,
24 config: Config,
25 service?: string,
26 location?: string,
27): Promise<ServiceInfo> {
28 const services = await pickServices(projectId, config, service, location);
29 if (services.length > 1) {
30 const serviceIds = services.map(
31 (i) => `${i.dataConnectYaml.location}:${i.dataConnectYaml.serviceId}`,
32 );
33 throw new FirebaseError(
34 `Multiple services matched. Please specify a service and location. Matched services: ${serviceIds.join(
35 ", ",
36 )}`,
37 );
38 }
39 return services[0];
40}
41
42/** Picks SQL Connect services based on flags. */
43export async function pickServices(

Callers 7

getServiceInfoFunction · 0.90
execute.tsFile · 0.90

Calls 1

pickServicesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…