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

Function state

cli/api/commands/state.ts:4–15  ·  view source on GitHub ↗
(
  dbadapter: IDbAdapter,
  targets: dataform.ITarget[]
)

Source from the content-addressed store, hash-verified

2import { dataform } from "df/protos/ts";
3
4export async function state(
5 dbadapter: IDbAdapter,
6 targets: dataform.ITarget[]
7): Promise<dataform.IWarehouseState> {
8 const allTables = await Promise.all(targets.map(async target => dbadapter.table(target)));
9
10 // Filter out datasets that don't exist.
11 const tablesWithValues = allTables.filter(table => {
12 return !!table && !!table.type;
13 });
14 return { tables: tablesWithValues };
15}

Callers 1

buildFunction · 0.90

Calls 1

tableMethod · 0.65

Tested by

no test coverage detected