Skip to content

feat(bigquery): typed returns, pagination, query polling, and streaming insert for table operations#167

Open
atharva-nagane wants to merge 3 commits into
c2siorg:mainfrom
atharva-nagane:feat/gcp-bigquery-table-ops
Open

feat(bigquery): typed returns, pagination, query polling, and streaming insert for table operations#167
atharva-nagane wants to merge 3 commits into
c2siorg:mainfrom
atharva-nagane:feat/gcp-bigquery-table-ops

Conversation

@atharva-nagane

Copy link
Copy Markdown
Contributor

Closes #166

Summary

Completes the BigQuery module by converting all remaining methods to typed returns, adding the two missing operations, and documenting everything.

New response types (gcp_bigquery_types.rs):

  • TableInfo { id, dataset_id } — returned by create_table
  • TablePage { tables, next_page_token } — returned by list_tables
  • QueryResult { rows: Vec, total_rows: Option } — returned by get_query_results
  • mode: Option added to TableField for schema mode control

Method changes (gcp_bigquery.rs):

  • create_table → Result<TableInfo, CloudError>
  • delete_table → Result<(), CloudError>
  • list_tables → Result<TablePage, CloudError> with page_token / max_results pagination
  • run_query → Result<String, CloudError> (returns job ID)
  • get_query_results(job_id) → Result<QueryResult, CloudError>; polls up to 60 attempts,
    sleeping 1s between each; first attempt fires immediately without sleeping
  • insert_rows(dataset_id, table_id, rows) → Result<(), CloudError>; checks insertErrors
    on 200 OK and surfaces the first error message

Documentation (examples/gcp/database/bigquery.md):
Covers credentials setup, client init, create dataset/table, list with pagination,
streaming insert, query + poll loop, and delete — in CRUD order.

Tests: 25 unit tests (11 new), 0 failed.

@atharva-nagane atharva-nagane force-pushed the feat/gcp-bigquery-table-ops branch from 7c5e826 to 101f88b Compare July 4, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: typed returns, pagination, query polling, and streaming insert for BigQuery table operations

1 participant