import util from 'util' ; import { BigQuery } from '@google-cloud/bigquery' ; import { PolicyResult } from './policy' ; const bigquery = new BigQuery ( ) ; const datasetId = 'PolicyResults' ; const tableId = 'PolicyResults' ; param result export async function exportToBigQuery ( result ) { try { await bigquery . dataset ( datasetId ) . table ( tableId ) . insert ( [ result ] ) ; } catch ( e ) { console . error ( util . inspect ( e , false , null ) ) ; throw e ; } }