tabledef

package
v0.0.0-...-7220889 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 8 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",
	}
	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,
	}
)

Enum value maps for Type.

View Source
var File_infra_libs_bqschema_tabledef_table_def_proto protoreflect.FileDescriptor

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"`
	// contains filtered or unexported fields
}

func (*FieldSchema) Descriptor deprecated

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

Deprecated: Use FieldSchema.ProtoReflect.Descriptor instead.

func (*FieldSchema) GetDescription

func (x *FieldSchema) GetDescription() string

func (*FieldSchema) GetIsRepeated

func (x *FieldSchema) GetIsRepeated() bool

func (*FieldSchema) GetIsRequired

func (x *FieldSchema) GetIsRequired() bool

func (*FieldSchema) GetName

func (x *FieldSchema) GetName() string

func (*FieldSchema) GetSchema

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

func (*FieldSchema) GetType

func (x *FieldSchema) GetType() Type

func (*FieldSchema) ProtoMessage

func (*FieldSchema) ProtoMessage()

func (*FieldSchema) ProtoReflect

func (x *FieldSchema) ProtoReflect() protoreflect.Message

func (*FieldSchema) Reset

func (x *FieldSchema) Reset()

func (*FieldSchema) String

func (x *FieldSchema) String() string

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 */
	// contains filtered or unexported fields
}

func (*TableDef) Descriptor deprecated

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

Deprecated: Use TableDef.ProtoReflect.Descriptor instead.

func (*TableDef) GetDatasetId

func (x *TableDef) GetDatasetId() string

func (*TableDef) GetDescription

func (x *TableDef) GetDescription() string

func (*TableDef) GetFields

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

func (*TableDef) GetName

func (x *TableDef) GetName() string

func (*TableDef) GetPartitionExpirationSeconds

func (x *TableDef) GetPartitionExpirationSeconds() int64

func (*TableDef) GetPartitionTable

func (x *TableDef) GetPartitionTable() bool

func (*TableDef) GetTableId

func (x *TableDef) GetTableId() string

func (*TableDef) ProtoMessage

func (*TableDef) ProtoMessage()

func (*TableDef) ProtoReflect

func (x *TableDef) ProtoReflect() protoreflect.Message

func (*TableDef) Reset

func (x *TableDef) Reset()

func (*TableDef) String

func (x *TableDef) String() string

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) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

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

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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