# bigquery-schema-generator

> Generate schema for [Google bigquery](https://cloud.google.com/bigquery/) by inspecting data to conform with [data types](https://cloud.google.com/bigquery/data-types). Currently, the `BYTES` type is not supported.

Latest version **1.0.0** (published 2019-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install bigquery-schema-generator
pnpm add bigquery-schema-generator
yarn add bigquery-schema-generator
bun add bigquery-schema-generator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-05-14 |
| First published | 2016-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Nathan White |
| Maintainers | nw |
| Keywords | bigquery, schema, google cloud, gcp |

## Links

- npm: https://www.npmjs.com/package/bigquery-schema-generator
- Repository: https://github.com/nw/bigquery-schema-generator
- Issues: https://github.com/nw/bigquery-schema-generator/issues
- npm.io page: https://npm.io/package/bigquery-schema-generator

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-05-14
- 0.0.1 — 2016-09-25

## README

# Bigquery Schema Generator

Generate schema for [Google bigquery](https://cloud.google.com/bigquery/) by inspecting data to conform with [data types](https://cloud.google.com/bigquery/data-types). Currently, the `BYTES` type is not supported.

## Installation

```
npm i -D bigquery-schema-generator
```

## Usage

```js
var generator = require('bigquery-schema-generator')
var schema = generator(data)
```

The required mode is currently not supported. Everything will result in `NULLABLE` or `REPEATED` if an array is detected.

## Example

```js
var generator = require('bigquery-schema-generator')
var pkg = require('./package.json')
var schema = generator(pkg)
```

The schema will look like:

```json
[
  {
    "name": "name",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "version",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "main",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "repository",
    "type": "RECORD",
    "mode": "NULLABLE",
    "fields": [
      {
        "name": "type",
        "type": "STRING",
        "mode": "NULLABLE"
      },
      {
        "name": "url",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
  },
  {
    "name": "bugs",
    "type": "RECORD",
    "mode": "NULLABLE",
    "fields": [
      {
        "name": "url",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
  },
  {
    "name": "homepage",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "keywords",
    "type": "STRING",
    "mode": "REPEATED"
  },
  {
    "name": "author",
    "type": "STRING",
    "mode": "NULLABLE"
  },
  {
    "name": "license",
    "type": "STRING",
    "mode": "NULLABLE"
  }
]
```

## License

MIT

---
_Source: https://npm.io/package/bigquery-schema-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
