BigQuery Model
Node.js abstraction layer to BigQuery tables.
Features
- Promise and callback interface;
- Simple API.
Quick start
var bigquery = require('bigquery-model');
bigquery.auth({
email: 'yo@gmail.com',
key: 'pem-key'
});
var table = new bigquery.Table({
projectId: 'my-project-42',
datasetId: 'my-dataset',
tableId: 'my-table',
schema: {
fields: [
{name: 'first_name', type: 'string', mode: 'required'},
{name: 'last_name', type: 'string', mode: 'required'},
{name: 'address', type: 'record', fields: [
{name: 'street', type: 'string'},
{name: 'number', type: 'integer'},
{name: 'area', type: 'string'},
]},
{name: 'hobbies', type: 'string', mode: 'repeated'}
]
}
});
return table.query('SELECT first_name, last_name FROM [my-table];')
For further information on how to use this library please refer to the API docs.
Installation
$ npm install bigquery-model
Requirements
Contribute
Source code contributions are most welcome. The following rules apply:
- JavaScript source code needs to follow the Airbnb Style Guide;
- Functions need to be well documented in API docs;
- Unit tests are necessary.
Support
If you are having issues with this library, please let us know.
License
MIT