Class: Yancya::BigQuery::Tabledata
- Inherits:
-
Object
- Object
- Yancya::BigQuery::Tabledata
- Includes:
- RequestExecutor
- Defined in:
- lib/yancya/big_query/tabledata.rb
Instance Method Summary collapse
-
#initialize(project_id:, dataset_id:, table_id:, bq:) ⇒ Tabledata
constructor
A new instance of Tabledata.
- #insert_all(rows) ⇒ Object
- #list ⇒ Object
Constructor Details
#initialize(project_id:, dataset_id:, table_id:, bq:) ⇒ Tabledata
8 9 10 11 12 13 |
# File 'lib/yancya/big_query/tabledata.rb', line 8 def initialize(project_id:, dataset_id:, table_id:, bq:) @project_id = project_id @dataset_id = dataset_id @table_id = table_id @bq = bq end |
Instance Method Details
#insert_all(rows) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/yancya/big_query/tabledata.rb', line 15 def insert_all(rows) execute( api_method: @bq.api.tabledata.insert_all, body_object: {rows: rows}, parameters: { datasetId: @dataset_id, projectId: @project_id, tableId: @table_id } ) end |
#list ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/yancya/big_query/tabledata.rb', line 27 def list execute( api_method: @bq.api.tabledata.list, parameters: { datasetId: @dataset_id, projectId: @project_id, tableId: @table_id } ) end |