Convert JSON Schema (draft-07 or later) into Google BigQuery schema and create or patch tables. Current stable version 7.0.2, released 2023-06-30. Node >=12 required. Lightweight, no runtime dependencies. Key differentiator: direct CLI (jsbq) and embedded API for programmatic schema conversion, with options to prevent additional properties and continue on error. Respects JSON Schema concepts like required fields, enums, and nested objects; maps JSON Schema types to BigQuery types (STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP, DATE, TIME, DATETIME, RECORD, REPEATED). Handles complex nested structures and arrays. Supports --preventAdditionalObjectProperties and --continueOnError flags. Integrates with bq CLI for advanced table options. Not actively maintained recently but stable.
npm install jsonschema-bigqueryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a JSON Schema object into a BigQuery schema array, handling nested objects and arrays.
Use a library like json-schema-ref-parser to dereference before passing to jsonschema-bigquery.
Always provide project (-p) and dataset (-d) when using jsbq to interact with BigQuery.
Update code from const jsbq = require('jsonschema-bigquery')(options) to const jsbq = require('jsonschema-bigquery'); const schema = jsbq.run(input, options);Use bq mk --schema=... or bq update --schema=... as shown in README.
Handle format validation separately or use string type with constraints.
Dereference the schema first using json-schema-ref-parser: Schema = await $ref.dereference(schema)
Update to const jsbq = require('jsonschema-bigquery'); then jsbq.run(input).Provide both -p and -d flags or use -j only for schema generation.
No dependency data recorded yet.