{"id":23131229,"url":"https://github.com/emartech/google-big-query-js","last_synced_at":"2025-08-17T08:31:11.841Z","repository":{"id":56900081,"uuid":"102038896","full_name":"emartech/google-big-query-js","owner":"emartech","description":"Helper library to easily use BigQuery in NodeJS","archived":false,"fork":false,"pushed_at":"2023-01-23T12:19:41.000Z","size":384,"stargazers_count":5,"open_issues_count":5,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T07:41:00.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emartech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-31T19:48:29.000Z","updated_at":"2023-02-10T08:17:53.000Z","dependencies_parsed_at":"2023-02-12T23:01:41.305Z","dependency_job_id":null,"html_url":"https://github.com/emartech/google-big-query-js","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fgoogle-big-query-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fgoogle-big-query-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fgoogle-big-query-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emartech%2Fgoogle-big-query-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emartech","download_url":"https://codeload.github.com/emartech/google-big-query-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230105996,"owners_count":18173954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T11:12:21.925Z","updated_at":"2024-12-17T11:12:22.612Z","avatar_url":"https://github.com/emartech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @emartech/google-big-query\n\nHelper library to easily use Google BigQuery in NodeJS\n\n# Configuration\n\n`@emartech/google-big-query` uses the `config` package for configuration. You should make the following settings available under `\"GoogleCloud\" namespace:\n\n```json\n{\n  \"projectId\": \"\",\n  \"bucket\": \"\",\n  \"dataset\": \"\",\n  \"credentials\": {},\n  \"maximumBillingTier\": 10\n}\n```\n\n### projectId\n\nThe project you'll use for billing.\n\n### dataset\n\nThe default dataset to connect to if it was not specified.\n\n### credentials\n\nThe credentials the connection will use.\n\nExample:\n```json\n{\n  \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n\",\n  \"client_email\": \"example@my-service.iam.gserviceaccount.com\"\n}\n```\n\n### maximumBillingTier\n\nMore info about pricing: [https://cloud.google.com/bigquery/pricing](https://cloud.google.com/bigquery/pricing)\n\n# API\n\n```javascript\nconst BigQuery = require('@emartech/google-big-query');\n```\n\n## BigQuery\n\n### Methods\n\n#### create(datasetName):BigQuery `static`\n\nCreates a BigQuery instance.\n\n##### Parameters\n\n| Name          | Type   | Description                                                  |\n| ------------- | ------ | ------------------------------------------------------------ |\n| `datasetName` | string | The name of the default dataset.\u003cbr /\u003eDefault: `config.GoogleCloud.dataset`\u003cbr /\u003e`optional` |\n\n##### Returns\n\n| Type     | Description                             |\n| -------- | --------------------------------------- |\n| BigQuery | Instance of the BigQuery wrapper class. |\n\n#### constructor(datasetName, client):BigQuery\n\nConstructor of BigQuery wrapper.\n\n##### Parameters\n\n| Name          | Type                   | Description                      |\n| ------------- | ---------------------- | -------------------------------- |\n| `datasetName` | string                 | The name of the default dataset. |\n| `client`      | @google-cloud/bigquery | The BigQuery client.             |\n\n#### table(tableName):Table\n\nReturns a [Table](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Table) instance for the given table name.\n\n##### Parameters\n\n| Name        | Type   | Description                          |\n| ----------- | ------ | ------------------------------------ |\n| `tableName` | string | The name of the table in the dataset |\n\n##### Returns\n\n| Type                                                         | Description                                 |\n| ------------------------------------------------------------ | ------------------------------------------- |\n| [Table](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Table) | Google Cloud BigQuery Table class instance. |\n\n#### createQueryStream(query):ReadableStream\n\nThis is a wrapper of the original [createQueryStream()](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/BigQuery#createQueryStream) method.\n\n##### Parameters\n\n| Name    | Type             | Description                                                  |\n| ------- | ---------------- | ------------------------------------------------------------ |\n| `query` | string or object | The query to run.\u003cbr /\u003e[More info](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/BigQuery#query) about the parameter. |\n\n##### Returns\n\n| Type           | Description |\n| -------------- | ----------- |\n| ReadableStream |             |\n\n#### query(query):Promise\n\nThis is a wrapper of the original [query()](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/BigQuery#query) method.\n\n##### Parameters\n\n| Name    | Type             | Description                                                  |\n| ------- | ---------------- | ------------------------------------------------------------ |\n| `query` | string or object | The query to run.\u003cbr /\u003e[More info](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/BigQuery#query) about the parameter. |\n\n##### Returns\n\n| Type    | Description |\n| ------- | ----------- |\n| Promise |             |\n\n#### createQueryJob(query):Promise `generator`\n\nThis is a wrapper of the original [createQueryJob()](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/BigQuery#createQueryJob) method.\n\n##### Parameters\n\n| Name      | Type             | Description |\n| --------- | ---------------- | ----------- |\n| `options` | object or string |             |\n\n##### Returns\n\n| Type    | Description |\n| ------- | ----------- |\n| Promise |             |\n\n##### Example\n\n```javascript\nlet [job] = yield BigQuery.create().createQueryJob(query);\njob.getQueryResultsStream({ maxResults: 100000, startIndex: 0 }).pipe(processRow);\n```\n\n#### createTableIfNotExists(table, schema):Table `generator`\n\nCreates the table with the specified [schema](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#schema).\n\n##### Parameters\n\n| Name     | Type                                                         | Description                    |\n| -------- | ------------------------------------------------------------ | ------------------------------ |\n| `table`  | [Table](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Table) | The table instance             |\n| `schema` | object                                                       | Schema definition of the table |\n\n##### Returns\n\n| Type                                                         | Description    |\n| ------------------------------------------------------------ | -------------- |\n| [Table](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Table) | The new Table. |\n\n#### dropTableIfExists(table):void `generator`\n\nDrops the given table if exists.\n\n##### Parameters\n\n| Name    | Type                                                         | Description                                |\n| ------- | ------------------------------------------------------------ | ------------------------------------------ |\n| `table` | [Table](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Table) | The table instance that should be dropped. |\n\n#### createTable(tableName, options):Table `generator`\n\nThis is a wrapper of the original [createTable()](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Dataset#createTable) method.\n\n##### Parameters\n\n| Name        | Type   | Description                                                  |\n| ----------- | ------ | ------------------------------------------------------------ |\n| `tableName` | string | The name of the table.                                       |\n| `options`   | object | More info in the [original documentation](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Dataset#createTable). `optional` |\n\n##### Returns\n\n| Type                                                         | Description    |\n| ------------------------------------------------------------ | -------------- |\n| [Table](https://cloud.google.com/nodejs/docs/reference/bigquery/2.0.x/Table) | The new Table. |\n\n## BigQuery.FileToTable\n\n#### create(file, tableName, schema, options):FileToTable `static`\n\n#### createWith(file, table, schema, options):FileToTable `static`\n\n#### constructor(file, table, schema options):FileToTable\n\n#### run():Job\n\n## BigQuery.QueryToFile\n\n#### create(baseName, format, file):QueryToFile `static`\n\n#### constructor(tableName, format, file):QueryToFile\n\n#### run(query, options):File `generator`\n\n## BigQuery.QueryToFileToStream\n\n#### create(baseName):QueryToFileToStream `static`\n\n#### constructor(queryToFile):QueryToFileToStream\n\n#### createQueryStream(query, options):JSONStream `generator`\n\n## BigQuery.QueryToStream\n\n#### create():QueryToStream `static`\n\n#### constructor(client):QueryToStream\n\n#### run(query, parameters):ReadableStream\n\n## BigQuery.QueryToTable\n\n#### create(tableName, dataset):QueryToTable `static`\n\n#### constructor(client, tableName, dataset):QueryToTable\n\n#### run(query, params):Job `generator`\n\n## BigQuery.QueryToView\n\n#### create(viewName):QueryToView `static`\n\n#### constructor(client, viewName):QueryToView\n\n#### run():Table `generator`\n\n## BigQuery.StreamToTable\n\n#### create(tableName, tableSchema):StreamToTable `static`\n\n#### constructor(table, tableSchema):StreamToTable\n\n#### saveStream():Promise\n\n## BigQuery.TableToFile\n\n#### create(tableName, file, format):TableToFile `static`\n\n#### constructor(table, file, format):TableToFile\n\n#### run():Job `generator`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femartech%2Fgoogle-big-query-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femartech%2Fgoogle-big-query-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femartech%2Fgoogle-big-query-js/lists"}