tabledef

package
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Type_name = map[int32]string{
	0: "STRING",
	1: "BYTES",
	2: "INTEGER",
	3: "FLOAT",
	4: "BOOLEAN",
	5: "TIMESTAMP",
	6: "RECORD",
	7: "DATE",
	8: "TIME",
	9: "DATETIME",
}
View Source
var Type_value = map[string]int32{
	"STRING":    0,
	"BYTES":     1,
	"INTEGER":   2,
	"FLOAT":     3,
	"BOOLEAN":   4,
	"TIMESTAMP": 5,
	"RECORD":    6,
	"DATE":      7,
	"TIME":      8,
	"DATETIME":  9,
}

Functions

func BQSchema

func BQSchema(fields []*FieldSchema) bigquery.Schema

BQSchema constructs a bigquery.Schema from a []*TableDef.FieldSchema

Types

type FieldSchema

type FieldSchema struct {
	// Name of the field/column.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Human-readable description of the field. (optional)
	Description          string         `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	IsRepeated           bool           `protobuf:"varint,3,opt,name=is_repeated,json=isRepeated,proto3" json:"is_repeated,omitempty"`
	IsRequired           bool           `protobuf:"varint,4,opt,name=is_required,json=isRequired,proto3" json:"is_required,omitempty"`
	Type                 Type           `protobuf:"varint,5,opt,name=type,proto3,enum=tabledef.Type" json:"type,omitempty"`
	Schema               []*FieldSchema `protobuf:"bytes,6,rep,name=schema,proto3" json:"schema,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*FieldSchema) Descriptor

func (*FieldSchema) Descriptor() ([]byte, []int)

func (*FieldSchema) GetDescription

func (m *FieldSchema) GetDescription() string

func (*FieldSchema) GetIsRepeated

func (m *FieldSchema) GetIsRepeated() bool

func (*FieldSchema) GetIsRequired

func (m *FieldSchema) GetIsRequired() bool

func (*FieldSchema) GetName

func (m *FieldSchema) GetName() string

func (*FieldSchema) GetSchema

func (m *FieldSchema) GetSchema() []*FieldSchema

func (*FieldSchema) GetType

func (m *FieldSchema) GetType() Type

func (*FieldSchema) ProtoMessage

func (*FieldSchema) ProtoMessage()

func (*FieldSchema) Reset

func (m *FieldSchema) Reset()

func (*FieldSchema) String

func (m *FieldSchema) String() string

func (*FieldSchema) XXX_DiscardUnknown

func (m *FieldSchema) XXX_DiscardUnknown()

func (*FieldSchema) XXX_Marshal

func (m *FieldSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FieldSchema) XXX_Merge

func (m *FieldSchema) XXX_Merge(src proto.Message)

func (*FieldSchema) XXX_Size

func (m *FieldSchema) XXX_Size() int

func (*FieldSchema) XXX_Unmarshal

func (m *FieldSchema) XXX_Unmarshal(b []byte) error

type TableDef

type TableDef struct {
	// Name of the dataset.
	DatasetId string `protobuf:"bytes,1,opt,name=dataset_id,json=datasetId,proto3" json:"dataset_id,omitempty"`
	// Name of the table.
	TableId string `protobuf:"bytes,2,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"`
	// Human-readable name of the table. (optional)
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// Human-readable description of the table. (optional)
	Description string         `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	Fields      []*FieldSchema `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty"`
	// Whether to partition the table by day.
	PartitionTable bool `protobuf:"varint,6,opt,name=partition_table,json=partitionTable,proto3" json:"partition_table,omitempty"`
	// The lifetime for each partition. If zero, partitions do not expire.
	// Ignored if partition_table is false. (optional)
	PartitionExpirationSeconds int64    `` /* 142-byte string literal not displayed */
	XXX_NoUnkeyedLiteral       struct{} `json:"-"`
	XXX_unrecognized           []byte   `json:"-"`
	XXX_sizecache              int32    `json:"-"`
}

func (*TableDef) Descriptor

func (*TableDef) Descriptor() ([]byte, []int)

func (*TableDef) GetDatasetId

func (m *TableDef) GetDatasetId() string

func (*TableDef) GetDescription

func (m *TableDef) GetDescription() string

func (*TableDef) GetFields

func (m *TableDef) GetFields() []*FieldSchema

func (*TableDef) GetName

func (m *TableDef) GetName() string

func (*TableDef) GetPartitionExpirationSeconds

func (m *TableDef) GetPartitionExpirationSeconds() int64

func (*TableDef) GetPartitionTable

func (m *TableDef) GetPartitionTable() bool

func (*TableDef) GetTableId

func (m *TableDef) GetTableId() string

func (*TableDef) ProtoMessage

func (*TableDef) ProtoMessage()

func (*TableDef) Reset

func (m *TableDef) Reset()

func (*TableDef) String

func (m *TableDef) String() string

func (*TableDef) XXX_DiscardUnknown

func (m *TableDef) XXX_DiscardUnknown()

func (*TableDef) XXX_Marshal

func (m *TableDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDef) XXX_Merge

func (m *TableDef) XXX_Merge(src proto.Message)

func (*TableDef) XXX_Size

func (m *TableDef) XXX_Size() int

func (*TableDef) XXX_Unmarshal

func (m *TableDef) XXX_Unmarshal(b []byte) error

type Type

type Type int32
const (
	Type_STRING    Type = 0
	Type_BYTES     Type = 1
	Type_INTEGER   Type = 2
	Type_FLOAT     Type = 3
	Type_BOOLEAN   Type = 4
	Type_TIMESTAMP Type = 5
	Type_RECORD    Type = 6
	Type_DATE      Type = 7
	Type_TIME      Type = 8
	Type_DATETIME  Type = 9
)

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL