-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nehhhhha6
committed
Oct 8, 2024
1 parent
fb13661
commit 8dc4057
Showing
4 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
package bigqueryclient | ||
|
||
import ( | ||
"context" | ||
"cloud.google.com/go/bigquery" | ||
) | ||
|
||
// BigQueryClient defines the interface for the BigQuery client | ||
type BigQueryClient interface { | ||
CreateTable(ctx context.Context, datasetID string, tableID string, schema bigquery.Schema) error | ||
} | ||
|
||
// MyBigQueryClient implements the BigQueryClient interface | ||
type MyBigQueryClient struct { | ||
client *bigquery.Client | ||
} | ||
|
||
// CreateTable creates a new table in BigQuery | ||
func (m *MyBigQueryClient) CreateTable(ctx context.Context, datasetID string, tableID string, schema bigquery.Schema) error { | ||
table := m.client.Dataset(datasetID).Table(tableID) | ||
return table.Create(ctx, &bigquery.TableMetadata{Schema: schema}) | ||
} |
Empty file.
Empty file.