Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indatawetrust/bigquery-api
A quick and easy to use package for Google Cloud BigQuery
https://github.com/indatawetrust/bigquery-api
bigdata bigquery google-cloud
Last synced: about 1 month ago
JSON representation
A quick and easy to use package for Google Cloud BigQuery
- Host: GitHub
- URL: https://github.com/indatawetrust/bigquery-api
- Owner: indatawetrust
- Created: 2018-03-21T12:52:45.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-18T16:19:41.000Z (over 2 years ago)
- Last Synced: 2024-04-26T17:42:10.323Z (9 months ago)
- Topics: bigdata, bigquery, google-cloud
- Language: JavaScript
- Size: 21.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bigquery-api
A quick and easy to use package for Google Cloud BigQuery. bigquery-api requires node v7.6.0 or higher for ES2015 and async function support.#### install
```
npm i --save bigquery-api
```You can check this document to learn how to generate the service account key https://cloud.google.com/iam/docs/creating-managing-service-account-keys
#### usage
```js
const bigqueryapi = require('bigquery-api')bigqueryapi({
projectId: process.env.projectId,
keyFilename: process.env.keyFilename,
datasetId: "myproject",
tables: [{
name: 'user',
options: {
schema: 'name:string, date:datetime'
}
},{
name: 'post',
options: {
schema: 'text:string, date:datetime'
}
}]
})
.then(async ({ bigquery, table }) => {// insert
await table.user.insert({ name: "ahmet şimşek", date: "2018-04-01T12:34:56" })await table.post.insert({ text: "lorem ipsum", date: "2018-04-01T12:34:52" })
// query
await bigquery.query({ query: 'SELECT * FROM myproject.user' })})
```For more information https://cloud.google.com/nodejs/docs/reference/bigquery/latest