Skip to content

Latest commit

 

History

History
44 lines (26 loc) · 1.39 KB

README.md

File metadata and controls

44 lines (26 loc) · 1.39 KB

jsonschema-bigquery

npm Build Status

Convert JSON schema to Google BigQuery schema

This includes the ability to:

  1. Create tables
  2. Patch tables

Further enhancements are planned: delete tables (dev only), create dataset, set data ACLs

Note that some features involve bespoke interpretation of schema details suited to our environment.

Install

npm install jsonschema-bigquery

Consume

jsbq -p <gbq project> -d <gbq dataset> -j <json schema file> --preventAdditionalObjectProperties

For embedded usage the following will allow and support runtime schema conversion and table maintenance:

const jsonSchemaBigquery = require('jsonschema-bigquery')
const bigquerySchema = jsonSchemaBigquery.run(jsonSchemaObject, options)

Please ensure that the input JSON schema is dereferenced so that all external references have been resolved. json-schema-ref-parser can do this, prior to using this module.

Options

{
  preventAdditionalObjectProperties: true
}
  • preventAdditionalObjectProperties - boolean, check for additional object properties in schemas.

Test

npm test