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

Method search

cli/api/dbadapters/bigquery.ts:221–247  ·  view source on GitHub ↗
(
    searchText: string,
    options: { limit: number } = { limit: 1000 }
  )

Source from the content-addressed store, hash-verified

219 }
220
221 public async search(
222 searchText: string,
223 options: { limit: number } = { limit: 1000 }
224 ): Promise<dataform.ITableMetadata[]> {
225 const results = await this.execute(
226 `select table_catalog, table_schema, table_name
227 from region-${this.bigQueryCredentials.location}.INFORMATION_SCHEMA.COLUMN_FIELD_PATHS
228 where regexp_contains(table_schema, @searchText) or regexp_contains(table_name, @searchText) or regexp_contains(field_path, @searchText)
229 group by 1, 2, 3`,
230 {
231 params: {
232 searchText: `(?i)${searchText}`
233 },
234 interactive: true,
235 rowLimit: options.limit
236 }
237 );
238 return await Promise.all(
239 results.rows.map(row =>
240 this.table({
241 database: row.table_catalog,
242 schema: row.table_schema,
243 name: row.table_name
244 })
245 )
246 );
247 }
248
249 public async table(target: dataform.ITarget): Promise<dataform.ITableMetadata> {
250 const metadata = await this.getMetadata(target);

Callers

nothing calls this directly

Calls 2

executeMethod · 0.95
tableMethod · 0.95

Tested by

no test coverage detected