loader

package
v2.0.0-...-9f3f92a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	Config       *config.Config
	IgnoreFields []string
	IgnoreTables []string
}

type SchemaSource

type SchemaSource interface {
	TableList() ([]*SpannerTable, error)
	ColumnList(string) ([]*SpannerColumn, error)
	IndexList(string) ([]*SpannerIndex, error)
	IndexColumnList(string, string) ([]*SpannerIndexColumn, error)
}

func NewInformationSchemaSource

func NewInformationSchemaSource(client *spanner.Client) (SchemaSource, error)

func NewSchemaParserSource

func NewSchemaParserSource(fpath string) (SchemaSource, error)

type SpannerColumn

type SpannerColumn struct {
	FieldOrdinal int    // field_ordinal
	ColumnName   string // column_name
	DataType     string // data_type
	NotNull      bool   // not_null
	IsPrimaryKey bool   // is_primary_key
	IsGenerated  bool   // is_generated
}

SpannerColumn represents column info.

type SpannerIndex

type SpannerIndex struct {
	IndexName string // index name
	IsUnique  bool   // the index is unique ro not
	IsPrimary bool   // the index is primary key or not
}

SpannerIndex represents an index.

type SpannerIndexColumn

type SpannerIndexColumn struct {
	SeqNo      int    // seq_no. If is'a Storing Column, this value is 0.
	ColumnName string // column_name
	Storing    bool   // storing column or not
}

SpannerIndexColumn represents index column info.

type SpannerTable

type SpannerTable struct {
	TableName       string // table_name
	ParentTableName string
}

SpannerTable represents table info.

type TypeLoader

type TypeLoader struct {
	// contains filtered or unexported fields
}

TypeLoader provides a common Loader implementation used by the built in schema/query loaders.

func NewTypeLoader

func NewTypeLoader(source SchemaSource, inflector internal.Inflector, opt Option) *TypeLoader

func (*TypeLoader) LoadColumns

func (tl *TypeLoader) LoadColumns(typeTpl *models.Type) error

LoadColumns loads schema table/view columns.

func (*TypeLoader) LoadIndexColumns

func (tl *TypeLoader) LoadIndexColumns(ixTpl *models.Index) error

LoadIndexColumns loads the index column information.

func (*TypeLoader) LoadIndexes

func (tl *TypeLoader) LoadIndexes(tableMap map[string]*models.Type) (map[string]*models.Index, error)

LoadIndexes loads schema index definitions.

func (*TypeLoader) LoadSchema

func (tl *TypeLoader) LoadSchema() (*models.Schema, error)

LoadSchema loads schema definitions.

func (*TypeLoader) LoadTable

func (tl *TypeLoader) LoadTable() (map[string]*models.Type, error)

LoadTable loads a schema table/view definition.

func (*TypeLoader) LoadTableIndexes

func (tl *TypeLoader) LoadTableIndexes(typeTpl *models.Type, ixMap map[string]*models.Index) error

LoadTableIndexes loads schema index definitions per table.

func (*TypeLoader) Mask

func (tl *TypeLoader) Mask() string

Mask returns the parameter mask.

func (*TypeLoader) NthParam

func (tl *TypeLoader) NthParam(i int) string

NthParam satisifies Loader's NthParam.

Jump to

Keyboard shortcuts

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