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

Function toDatasource

src/dataconnect/types.ts:246–272  ·  view source on GitHub ↗
(
  projectId: string,
  locationId: string,
  ds: DatasourceYaml,
)

Source from the content-addressed store, hash-verified

244}
245
246export function toDatasource(
247 projectId: string,
248 locationId: string,
249 ds: DatasourceYaml,
250): Datasource {
251 if (ds?.postgresql) {
252 return {
253 postgresql: {
254 database: ds.postgresql.database,
255 schema: ds.postgresql.schema,
256 cloudSql: {
257 instance: `projects/${projectId}/locations/${locationId}/instances/${ds.postgresql.cloudSql.instanceId}`,
258 },
259 schemaValidation: ds.postgresql.schemaValidation,
260 },
261 };
262 }
263 if (ds?.httpGraphql) {
264 return {
265 httpGraphql: {
266 uri: ds.httpGraphql.uri,
267 timeout: ds.httpGraphql.timeout,
268 },
269 };
270 }
271 return {};
272}
273
274/** Returns the main schema YAML for a SQL Connect YAML */
275export function mainSchemaYaml(dataconnectYaml: DataConnectYaml): SchemaYaml {

Callers 1

loadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…