MCPcopy Create free account
hub / github.com/dataform-co/dataform / getMetadata

Method getMetadata

cli/api/dbadapters/bigquery.ts:330–345  ·  view source on GitHub ↗
(target: dataform.ITarget)

Source from the content-addressed store, hash-verified

328 }
329
330 private async getMetadata(target: dataform.ITarget): Promise<TableMetadata> {
331 try {
332 const table = await this.getClient(target.database)
333 .dataset(target.schema)
334 .table(target.name)
335 .getMetadata();
336 return table?.[0];
337 } catch (e) {
338 if (e?.errors?.[0]?.reason === "notFound") {
339 // if the table can't be found, just return null
340 return null;
341 }
342 // otherwise throw the error as normal
343 throw coerceAsError(e);
344 }
345 }
346
347 private getClient(projectId?: string) {
348 return this.clientProvider(projectId);

Callers 4

tableMethod · 0.95
setMetadataMethod · 0.95
bigquery_test.tsFile · 0.80
createQueryJobMethod · 0.80

Calls 4

getClientMethod · 0.95
coerceAsErrorFunction · 0.90
datasetMethod · 0.80
tableMethod · 0.65

Tested by

no test coverage detected