Package @google-cloud/bigquery (7.1.1)

Classes

BigQuery

In the following examples from this page and the other modules (Dataset, Table, etc.), we are going to be using a dataset from data.gov of higher education institutions.

We will create a table with the correct schema, import the public CSV file into that table, and query it for data.

See What is BigQuery?

BigQueryDate

Date class for BigQuery.

BigQueryDatetime

Datetime class for BigQuery.

BigQueryInt

Build a BigQueryInt object. For long integers, a string can be provided.

BigQueryTime

Time class for BigQuery.

BigQueryTimestamp

Timestamp class for BigQuery.

Dataset

Interact with your BigQuery dataset. Create a Dataset instance with or .

Geography

Geography class for BigQuery.

Job

Job objects are returned from various places in the BigQuery API:


They can be used to check the status of a running job or fetching the results of a previously-executed one.

Model

Model objects are returned by methods such as and .

Routine

Routine objects are returned by methods such as , , and .

RowBatch

Call used to help batch rows.

RowQueue

Standard row queue used for inserting rows.

Table

Table objects are returned by methods such as , , and .

Interfaces

BigQueryDateOptions

BigQueryDatetimeOptions

BigQueryOptions

BigQueryTimeOptions

DatasetDeleteOptions

DatasetOptions

File_2

InsertRow

InsertStreamOptions

IntegerTypeCastOptions

Json

PagedCallback

PartialInsertFailure

ProvidedTypeStruct

RequestCallback

ResourceCallback

TableOptions

Variables

PROTOCOL_REGEX

PROTOCOL_REGEX: RegExp

Type Aliases

CancelCallback

export type CancelCallback = RequestCallback

CancelResponse

export type CancelResponse = [bigquery.IJobCancelResponse];

CopyTableMetadata

export type CopyTableMetadata = JobRequest

CreateCopyJobMetadata

export type CreateCopyJobMetadata = CopyTableMetadata;

CreateDatasetOptions

export type CreateDatasetOptions = bigquery.IDataset;

CreateExtractJobOptions

export type CreateExtractJobOptions = JobRequest

DatasetCallback

export type DatasetCallback = ResourceCallback

DatasetResource

export type DatasetResource = bigquery.IDataset & {
    projectId?: string;
};

DatasetResponse

export type DatasetResponse = [Dataset, bigquery.IDataset];

DatasetsCallback

export type DatasetsCallback = PagedCallback

DatasetsResponse

export type DatasetsResponse = PagedResponse

FormattedMetadata

export type FormattedMetadata = bigquery.ITable;

GetDatasetsOptions

export type GetDatasetsOptions = PagedRequest

GetJobsCallback

export type GetJobsCallback = PagedCallback

GetJobsOptions

export type GetJobsOptions = PagedRequest

GetJobsResponse

export type GetJobsResponse = PagedResponse

GetModelsCallback

export type GetModelsCallback = PagedCallback

GetModelsOptions

export type GetModelsOptions = PagedRequest

GetModelsResponse

export type GetModelsResponse = PagedResponse

GetPolicyOptions

export type GetPolicyOptions = bigquery.IGetPolicyOptions;

GetRoutinesCallback

export type GetRoutinesCallback = PagedCallback

GetRoutinesOptions

export type GetRoutinesOptions = PagedRequest

GetRoutinesResponse

export type GetRoutinesResponse = PagedResponse

GetRowsOptions

export type GetRowsOptions = PagedRequest

GetTablesCallback

export type GetTablesCallback = PagedCallback

GetTablesOptions

export type GetTablesOptions = PagedRequest

GetTablesResponse

export type GetTablesResponse = PagedResponse

InsertRowsCallback

export type InsertRowsCallback = RequestCallback

InsertRowsOptions

export type InsertRowsOptions = bigquery.ITableDataInsertAllRequest & {
    createInsertId?: boolean;
    partialRetries?: number;
    raw?: boolean;
    schema?: string | {};
};

InsertRowsResponse

export type InsertRowsResponse = [
    bigquery.ITableDataInsertAllResponse | bigquery.ITable
];

InsertRowsStreamResponse

export type InsertRowsStreamResponse = bigquery.ITableDataInsertAllResponse;

IntegerTypeCastValue

export type IntegerTypeCastValue = {
    integerValue: string | number;
    schemaFieldName?: string;
};

JobCallback

export type JobCallback = ResourceCallback

JobLoadMetadata

export type JobLoadMetadata = JobRequest

JobMetadata

export type JobMetadata = bigquery.IJob;

JobMetadataCallback

export type JobMetadataCallback = RequestCallback

JobMetadataResponse

export type JobMetadataResponse = [JobMetadata];

JobOptions

export type JobOptions = JobRequest

JobRequest

export type JobRequest
Type Parameter
TypeDescription
J

JobResponse

export type JobResponse = [Job, bigquery.IJob];

PagedRequest

export type PagedRequest

= P & { autoPaginate?: boolean; maxApiCalls?: number; };

Type Parameter
TypeDescription
P

PagedResponse

export type PagedResponse
Type Parameters
TypeDescription
T
Q
R

PermissionsCallback

export type PermissionsCallback = RequestCallback

PermissionsResponse

export type PermissionsResponse = [bigquery.ITestIamPermissionsResponse];

Policy

export type Policy = bigquery.IPolicy;

PolicyCallback

export type PolicyCallback = RequestCallback

PolicyRequest

export type PolicyRequest = bigquery.IGetIamPolicyRequest;

PolicyResponse

export type PolicyResponse = [Policy];

ProvidedTypeArray

export type ProvidedTypeArray = Array

Query

export type Query = JobRequest

QueryOptions

export type QueryOptions = QueryResultsOptions;

QueryParameter

export type QueryParameter = bigquery.IQueryParameter;

QueryResultsOptions

export type QueryResultsOptions = {
    job?: Job;
    wrapIntegers?: boolean | IntegerTypeCastOptions;
    parseJSON?: boolean;
} & PagedRequest

QueryRowsCallback

export type QueryRowsCallback = PagedCallback

QueryRowsResponse

export type QueryRowsResponse = PagedResponse

QueryStreamOptions

export type QueryStreamOptions = {
    wrapIntegers?: boolean | IntegerTypeCastOptions;
    parseJSON?: boolean;
};

RoutineCallback

export type RoutineCallback = ResourceCallback

RoutineMetadata

export type RoutineMetadata = bigquery.IRoutine;

RoutineResponse

export type RoutineResponse = [Routine, bigquery.IRoutine];

RowMetadata

export type RowMetadata = any;

RowsCallback

export type RowsCallback = PagedCallback

RowsResponse

export type RowsResponse = PagedResponse

SetPolicyOptions

export type SetPolicyOptions = Omit

SetTableMetadataOptions

export type SetTableMetadataOptions = TableMetadata;

SimpleQueryRowsCallback

export type SimpleQueryRowsCallback = ResourceCallback

SimpleQueryRowsResponse

export type SimpleQueryRowsResponse = [RowMetadata[], bigquery.IJob];

TableCallback

export type TableCallback = ResourceCallback

TableField

export type TableField = bigquery.ITableFieldSchema;

TableMetadata

export type TableMetadata = bigquery.ITable & {
    name?: string;
    schema?: string | TableField[] | TableSchema;
    partitioning?: string;
    view?: string | ViewDefinition;
};

TableResponse

export type TableResponse = [Table, bigquery.ITable];

TableRow

export type TableRow = bigquery.ITableRow;

TableRowField

export type TableRowField = bigquery.ITableCell;

TableRowValue

export type TableRowValue = string | TableRow;

TableSchema

export type TableSchema = bigquery.ITableSchema;

ValueType

export type ValueType = bigquery.IQueryParameterType;

ViewDefinition

export type ViewDefinition = bigquery.IViewDefinition;