Cursor
(
connection
)
DB-API Cursor to Google BigQuery.
Parameter
connection
Properties
query_job
google.cloud.bigquery.job
.query.QueryJob | None: The query job
created by the last execute ()
call, if a query job was created.
Methods
close
close
()
Mark the cursor as closed, preventing its further use.
execute
execute
(
operation
,
parameters
=
None
,
job_id
=
None
,
job_config
=
None
)
Prepare and execute a database operation.
Adatetime.datetime
parameter without timezone information uses
the 'DATETIME' BigQuery type (example: Global Pi Day Celebration
March 14, 2017 at 1:59pm). A datetime.datetime
parameter with
timezone information uses the 'TIMESTAMP' BigQuery type (example:
a wedding on April 29, 2011 at 11am, British Summer Time). For more information about BigQuery data types, see:
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types
`STRUCT`/`RECORD` and `REPEATED` query parameters are not
yet supported. See:
https://github.com/GoogleCloudPlatform/google-cloud-python/issues/3524
operation
str
A Google BigQuery query string.
parameters
Union[Mapping[str, Any], Sequence[Any]]
(Optional) dictionary or sequence of parameter values.
job_id
str None
(Optional and discouraged) The job ID to use when creating the query job. For best performance and reliability, manually setting a job ID is discouraged.
job_config
executemany
executemany
(
operation
,
seq_of_parameters
)
Prepare and execute a database operation multiple times.
operation
str
A Google BigQuery query string.
seq_of_parameters
Union[Sequence[Mapping[str, Any], Sequence[Any]]]
Sequence of many sets of parameter values.
fetchall
fetchall
()
Fetch all remaining results from the last execute*()
call.
List[Tuple]
fetchmany
fetchmany
(
size
=
None
)
Fetch multiple results from the last execute*()
call.
size
int
(Optional) Maximum number of rows to return. Defaults to the arraysize
property value. If arraysize
is not set, it defaults to 1
.
List[Tuple]
fetchone
fetchone
()
Fetch a single row from the results of the last execute*()
call.
Tuple
None
if no more data is available.setinputsizes
setinputsizes
(
sizes
)
No-op, but for consistency raise an error if cursor is closed.
setoutputsize
setoutputsize
(
size
,
column
=
None
)
No-op, but for consistency raise an error if cursor is closed.

