sdata

package
v0.15.80 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBColumn

type DBColumn struct {
	Name       string
	Key        string
	Type       string
	Array      bool
	NotNull    bool
	PrimaryKey bool
	UniqueKey  bool
	FullText   bool
	FKeySchema string
	FKeyTable  string
	FKeyCol    string
	Blocked    bool
	Table      string
	Schema     string
}

func DiscoverColumns added in v0.15.70

func DiscoverColumns(db *sql.DB, dbtype string, blockList []string) ([]DBColumn, error)

func (DBColumn) String

func (col DBColumn) String() string

type DBFuncParam

type DBFuncParam struct {
	ID   int
	Name sql.NullString
	Type string
}

type DBFunction

type DBFunction struct {
	Name   string
	Params []DBFuncParam
}

func DiscoverFunctions added in v0.15.70

func DiscoverFunctions(db *sql.DB, blockList []string) ([]DBFunction, error)

type DBInfo

type DBInfo struct {
	Version   int
	Type      string
	Tables    []DBTable
	Functions []DBFunction
	VTables   []VirtualTable
	// contains filtered or unexported fields
}

func GetDBInfo

func GetDBInfo(
	db *sql.DB,
	dbtype string,
	blockList []string,
	enableInflection bool) (*DBInfo, error)

func GetTestDBInfo

func GetTestDBInfo() *DBInfo

func NewDBInfo added in v0.15.70

func NewDBInfo(
	dbtype string,
	version string,
	cols []DBColumn,
	funcs []DBFunction,
	blockList []string,
	enableInflection bool) *DBInfo

func (*DBInfo) AddTable

func (di *DBInfo) AddTable(t DBTable)

func (*DBInfo) GetColumn

func (di *DBInfo) GetColumn(schema, table, column string) (*DBColumn, error)

func (*DBInfo) GetTable added in v0.15.70

func (di *DBInfo) GetTable(schema, table string) (*DBTable, error)

type DBRel

type DBRel struct {
	Type    RelType
	Through DBRelThrough
	Left    DBRelLeft
	Right   DBRelRight
}

func PathToRel added in v0.15.70

func PathToRel(p TPath) DBRel

func (*DBRel) String

func (re *DBRel) String() string

type DBRelLeft added in v0.15.63

type DBRelLeft struct {
	Ti  TInfo
	Col DBColumn
}

type DBRelRight added in v0.15.63

type DBRelRight struct {
	VTable string
	Ti     TInfo
	Col    DBColumn
}

type DBRelThrough added in v0.15.63

type DBRelThrough struct {
	Ti   DBTable
	ColL DBColumn
	ColR DBColumn
}

type DBSchema

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

func GetTestSchema

func GetTestSchema() (*DBSchema, error)

func NewDBSchema

func NewDBSchema(
	info *DBInfo,
	aliases map[string][]string,
	enableInflection bool) (*DBSchema, error)

func (*DBSchema) DBVersion

func (s *DBSchema) DBVersion() int

func (*DBSchema) Find added in v0.15.70

func (s *DBSchema) Find(schema, name string) (TInfo, error)

func (*DBSchema) FindPath added in v0.15.70

func (s *DBSchema) FindPath(s1, from, s2, to string) ([]TPath, error)

func (*DBSchema) GetAliases added in v0.15.50

func (s *DBSchema) GetAliases() map[string]DBTable

func (*DBSchema) GetFunctions

func (s *DBSchema) GetFunctions() map[string]DBFunction

func (*DBSchema) GetTables added in v0.15.80

func (s *DBSchema) GetTables() []DBTable

func (*DBSchema) Type added in v0.15.57

func (s *DBSchema) Type() string

type DBTable

type DBTable struct {
	Schema       string
	Name         string
	Type         string
	Columns      []DBColumn
	PrimaryCol   DBColumn
	SecondaryCol DBColumn
	FullText     []DBColumn
	Singular     string
	Plural       string
	Blocked      bool
	// contains filtered or unexported fields
}

func NewDBTable added in v0.15.70

func NewDBTable(schema, name, _type string, cols []DBColumn, ei bool) DBTable

func (*DBTable) GetColumn added in v0.15.70

func (ti *DBTable) GetColumn(name string) (DBColumn, error)

func (*DBTable) String added in v0.15.70

func (ti *DBTable) String() string

type RelType

type RelType int
const (
	RelNone RelType = iota
	RelOneToOne
	RelOneToMany
	RelPolymorphic
	RelRecursive
	RelEmbedded
	RelRemote
	RelSkip
)

func (RelType) String

func (i RelType) String() string

type TEdge added in v0.15.70

type TEdge struct {
	Type RelType

	LT, RT DBTable
	L, R   DBColumn

	graph.WeightedEdge
}

type TInfo added in v0.15.70

type TInfo struct {
	IsSingular bool
	DBTable
}

type TPath added in v0.15.70

type TPath struct {
	Rel RelType
	LTi TInfo
	L   DBColumn
	RTi TInfo
	R   DBColumn
}

type VirtualTable

type VirtualTable struct {
	Name       string
	IDColumn   string
	TypeColumn string
	FKeyColumn string
}

Jump to

Keyboard shortcuts

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