Class: SchemaExtractor::Formatters::Bigquery
- Inherits:
-
Object
- Object
- SchemaExtractor::Formatters::Bigquery
show all
- Defined in:
- lib/schema_extractor/formatters/bigquery.rb
Defined Under Namespace
Classes: InvalidBigqueryFieldTypeError
Instance Method Summary
collapse
Instance Method Details
#extension ⇒ Object
22
23
24
|
# File 'lib/schema_extractor/formatters/bigquery.rb', line 22
def extension
".json"
end
|
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/schema_extractor/formatters/bigquery.rb', line 10
def format(schema)
JSON.pretty_generate(
schema.fields.map do |f|
{
name: f.name,
type: bq_type(f),
mode: bq_mode(f)
}
end
)
end
|