relation

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Version string = "v1"

Version of the YAML strcuture.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db2Dialect added in v1.4.0

type Db2Dialect struct{}

func (Db2Dialect) SQL added in v1.4.0

func (d Db2Dialect) SQL(schema string) string

type Db2ExtractorFactory added in v1.4.0

type Db2ExtractorFactory struct{}

Db2ExtractorFactory exposes methods to create new Db2 extractors.

func NewDb2ExtractorFactory added in v1.4.0

func NewDb2ExtractorFactory() *Db2ExtractorFactory

NewDb2ExtractorFactory creates a new db2 extractor factory.

func (*Db2ExtractorFactory) New added in v1.4.0

func (e *Db2ExtractorFactory) New(url string, schema string) relation.Extractor

New return a Db2 extractor

type Dialect

type Dialect interface {
	SQL(schema string) string
}

type HTTPExtractor added in v1.7.0

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

HTTPExtractor provides table extraction logic from an HTTP Rest Endpoint.

func NewHTTPExtractor added in v1.7.0

func NewHTTPExtractor(url string, schema string) *HTTPExtractor

NewHTTPExtractor creates a new HTTP extractor.

func (*HTTPExtractor) Extract added in v1.7.0

func (e *HTTPExtractor) Extract() ([]relation.Relation, *relation.Error)

Extract tables from the database.

type HTTPExtractorFactory added in v1.7.0

type HTTPExtractorFactory struct{}

HTTPExtractorFactory exposes methods to create new HTTP extractors.

func NewHTTPExtractorFactory added in v1.7.0

func NewHTTPExtractorFactory() *HTTPExtractorFactory

NewHTTPExtractorFactory creates a new HTTP extractor factory.

func (*HTTPExtractorFactory) New added in v1.7.0

func (e *HTTPExtractorFactory) New(url string, schema string) relation.Extractor

New return a HTTP extractor

type MockDialect

type MockDialect struct {
	mock.Mock
}

MockDialect is an autogenerated mock type for the Dialect type

func (*MockDialect) SQL

func (_m *MockDialect) SQL(schema string) string

SQL provides a mock function with given fields: schema

type OracleDialect

type OracleDialect struct{}

func (OracleDialect) SQL

func (d OracleDialect) SQL(schema string) string

type OracleExtractorFactory

type OracleExtractorFactory struct{}

OracleExtractorFactory exposes methods to create new Oracle extractors.

func NewOracleExtractorFactory

func NewOracleExtractorFactory() *OracleExtractorFactory

NewOracleExtractorFactory creates a new oracle extractor factory.

func (*OracleExtractorFactory) New

New return a Oracle extractor

type PostgresDialect

type PostgresDialect struct{}

func (PostgresDialect) SQL

func (d PostgresDialect) SQL(schema string) string

type PostgresExtractorFactory

type PostgresExtractorFactory struct{}

PostgresExtractorFactory exposes methods to create new Postgres extractors.

func NewPostgresExtractorFactory

func NewPostgresExtractorFactory() *PostgresExtractorFactory

NewPostgresExtractorFactory creates a new postgres extractor factory.

func (*PostgresExtractorFactory) New

New return a Postgres extractor

type SQLExtractor

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

SQLExtractor provides relation extraction logic from SQL database.

func NewSQLExtractor

func NewSQLExtractor(url string, schema string, dialect Dialect) *SQLExtractor

NewSQLExtractor creates a new SQL extractor.

func (*SQLExtractor) Extract

func (e *SQLExtractor) Extract() ([]relation.Relation, *relation.Error)

Extract relations from the database.

type YAMLRelation

type YAMLRelation struct {
	Name   string    `yaml:"name"`
	Parent YAMLTable `yaml:"parent"`
	Child  YAMLTable `yaml:"child"`
}

YAMLRelation defines how to store a relation in YAML format.

type YAMLStorage

type YAMLStorage struct{}

YAMLStorage provides storage in a local YAML file

func NewYAMLStorage

func NewYAMLStorage() *YAMLStorage

NewYAMLStorage create a new YAML storage

func (YAMLStorage) List

func (s YAMLStorage) List() ([]relation.Relation, *relation.Error)

List all relations stored in the YAML file

func (YAMLStorage) Store

func (s YAMLStorage) Store(relations []relation.Relation) *relation.Error

Store relations in the YAML file

type YAMLStructure

type YAMLStructure struct {
	Version   string         `yaml:"version"`
	Relations []YAMLRelation `yaml:"relations,omitempty"`
}

YAMLStructure of the file.

type YAMLTable

type YAMLTable struct {
	Name string   `yaml:"name"`
	Keys []string `yaml:"keys"`
}

YAMLTable defines how to store a relation in YAML format.

Jump to

Keyboard shortcuts

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