origin

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTextEncoding

func ConvertTextEncoding(reader io.Reader, textEncoding *string) io.Reader

Types

type BaseTableConfig

type BaseTableConfig struct {
	Name    string        `yaml:"name,omitempty"`
	Columns ColumnConfigs `yaml:"columns,omitempty"`
	// contains filtered or unexported fields
}

func (*BaseTableConfig) DetectSchema

func (cfg *BaseTableConfig) DetectSchema(ctx context.Context, fetcher Fetcher, ignoreLines int, allowUnicodeColumnName bool) error

func (*BaseTableConfig) FetchRows

func (cfg *BaseTableConfig) FetchRows(ctx context.Context, fetcher Fetcher, ignoreLines int) ([][]interface{}, error)

func (*BaseTableConfig) Restrict

func (cfg *BaseTableConfig) Restrict(schema string) error

func (*BaseTableConfig) ToTable

func (cfg *BaseTableConfig) ToTable() *psqlfront.Table

type ColumnConfig

type ColumnConfig struct {
	Name        string `yaml:"name,omitempty"`
	DataType    string `yaml:"data_type,omitempty"`
	DataLength  *int   `yaml:"length,omitempty"`
	Contraint   string `yaml:"contraint,omitempty"`
	ColumnIndex *int   `yaml:"column_index,omitempty"`
}

type ColumnConfigs

type ColumnConfigs []*ColumnConfig

func PerformSchemaInference

func PerformSchemaInference(rows [][]string, ignoreLines int, allowUnicodeColumName bool) (ColumnConfigs, error)

func (ColumnConfigs) Restrict

func (cfgs ColumnConfigs) Restrict() error

func (ColumnConfigs) ToColumns

func (cfgs ColumnConfigs) ToColumns() []*psqlfront.Column

func (ColumnConfigs) ToRows

func (cfgs ColumnConfigs) ToRows(records [][]string, ignoreLines int) [][]interface{}

type Fetcher

type Fetcher func(context.Context) ([][]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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