blanton v0.1.0 Blanton.Table

Handles BigQuery table schema.

Link to this section Summary

Functions

create new table

create new table

Get table lists using config.exs

create new GoogleApi.BigQuery.V2.Model.Table

Update table schema

Link to this section Functions

Specs

create(Table.t()) :: GoogleApi.BigQuery.V2.Model.Table.t()

create new table

example

create(table)

%GoogleApi.BigQuery.V2.Model.Table{}

Link to this function

create(table_name, columns)

Specs

create new table

example

create( "table_name", [

%{name: "column", type: :string, mode: :required},

] ) :: GoogleApi.BigQuery.V2.Model.Table.t()

%GoogleApi.BigQuery.V2.Model.Table{}

Link to this function

create(project_id, dataset_id, table)

Specs

Create new table

example

create("PROJECT_ID", "DATASET_ID", table)

%GoogleApi.BigQuery.V2.Model.Table{}

Link to this function

delete(project_id, dataset_id, table_name)

Specs

delete(String.t(), String.t(), String.t()) :: Tesla.Env.t()

delete specific Table

example

delete("PROJECT_ID", "DATASET_ID", "TABLE")

Tesla.Env.t()

Specs

Link to this function

get(project_id, dataset_id, table_id)

Specs

Get table structs

example

get("PROJECT_ID", "DATASET_ID", "TABLE_ID")

%GoogleApi.BigQuery.V2.Model.Table{}

Specs

lists() :: [String.t()]

Get table lists using config.exs

example

lists()

["table_a", "table_b"]

Link to this function

lists(project_id, dataset_id)

Specs

lists(String.t(), String.t()) :: [String.t()]

Get table lists

example

lists("PROJECT_ID", "DATASET_ID")

["table_a", "table_b"]

Link to this function

new(name, columns)

Specs

create new GoogleApi.BigQuery.V2.Model.Table

example

iex(1)> Blanton.Table.new("TABLE_NAME", [%{name: "column", type: :string, mode: :required}]) %GoogleApi.BigQuery.V2.Model.Table{ clustering: nil, creationTime: nil, description: nil, encryptionConfiguration: nil, etag: nil, expirationTime: nil, externalDataConfiguration: nil, friendlyName: nil, id: nil, kind: nil, labels: nil, lastModifiedTime: nil, location: nil, materializedView: nil, model: nil, numBytes: nil, numLongTermBytes: nil, numPhysicalBytes: nil, numRows: nil, rangePartitioning: nil, requirePartitionFilter: nil, schema: %GoogleApi.BigQuery.V2.Model.TableSchema{

fields: [%GoogleApi.BigQuery.V2.Model.TableFieldSchema{mode: "REQUIRED", name: "column", type: "STRING"}]

}, selfLink: nil, snapshotDefinition: nil, streamingBuffer: nil, tableReference: %GoogleApi.BigQuery.V2.Model.TableReference{

datasetId: "",
projectId: "",
tableId: "TABLE_NAME"

}, timePartitioning: nil, type: nil, view: nil }

Link to this function

new(project_id, dataset_id, name, columns)

Specs

create new table struct

example

iex(1)> Blanton.Table.new("PROJECT_ID", "DATASET_ID", "TABLE_NAME", [%{name: "column", type: :string, mode: :required}]) %GoogleApi.BigQuery.V2.Model.Table{ clustering: nil, creationTime: nil, description: nil, encryptionConfiguration: nil, etag: nil, expirationTime: nil, externalDataConfiguration: nil, friendlyName: nil, id: nil, kind: nil, labels: nil, lastModifiedTime: nil, location: nil, materializedView: nil, model: nil, numBytes: nil, numLongTermBytes: nil, numPhysicalBytes: nil, numRows: nil, rangePartitioning: nil, requirePartitionFilter: nil, schema: %GoogleApi.BigQuery.V2.Model.TableSchema{

fields: [%GoogleApi.BigQuery.V2.Model.TableFieldSchema{mode: "REQUIRED", name: "column", type: "STRING"}]

}, selfLink: nil, snapshotDefinition: nil, streamingBuffer: nil, tableReference: %GoogleApi.BigQuery.V2.Model.TableReference{

datasetId: "DATASET_ID",
projectId: "PROJECT_ID",
tableId: "TABLE_NAME"

}, timePartitioning: nil, type: nil, view: nil }

Link to this function

schema(table_id)

Specs

Link to this function

schema(project_id, dataset_id, table_id)

Specs

Get table schema

example

schema("PROJECT_ID", "DATASET_ID", "TABLE_ID")

[%GoogleApi.BigQuery.V2.Model.TableFieldSchema{}]

Link to this function

update(table_id, table)

Specs

update(String.t(), Table.t()) :: GoogleApi.BigQuery.V2.Model.TableRefence.t()

Update table schema

update("TABLE_NAME", Table.new())

Link to this function

update(project_id, dataset_id, table_id, table)

Specs

update(String.t(), String.t(), String.t(), Table.t()) ::
  GoogleApi.BigQuery.V2.Model.TableRefence.t()

Update table schema

update("PROJECT_ID", "DATASET_ID", "TABLE_NAME", Table.new())