schema

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnMeta

type ColumnMeta struct {
	TableCat        string
	TableSchemeName string
	TableName       string
	ColumnName      string
	DataType        int32
	DataTypeName    string
	ColumnSize      int32
	DecimalDigits   int32
	NumPrecRadix    int32
	Nullable        int32
	Remarks         string
	ColumnDef       string
	SqlDataType     int32
	SqlDatetimeSub  int32
	CharOctetLength int32
	OrdinalPosition int32
	IsNullable      string
	IsAutoIncrement string
}

type Field

type Field struct {
	Name    string
	KeyType KeyType
	Type    int32
	Value   interface{}
}

type IndexMeta

type IndexMeta struct {
	Values          []ColumnMeta
	NonUnique       bool
	IndexQualifier  string
	IndexName       string
	ColumnName      string
	Type            int16
	IndexType       IndexType
	AscOrDesc       string
	Cardinality     int32
	OrdinalPosition int32
}

type IndexType

type IndexType byte
const (
	IndexType_PRIMARY IndexType = iota
	IndexType_NORMAL
	IndexType_UNIQUE
	IndexType_FULL_TEXT
)

type KeyType

type KeyType byte
const (
	NULL KeyType = iota
	PRIMARY_KEY
)

type Row

type Row struct {
	Fields []*Field
}

func (*Row) NonPrimaryKeys

func (row *Row) NonPrimaryKeys() []*Field

func (*Row) PrimaryKeys

func (row *Row) PrimaryKeys() []*Field

type TableMeta

type TableMeta struct {
	TableName  string
	Columns    []string
	AllColumns map[string]ColumnMeta
	AllIndexes map[string]IndexMeta
}

func (TableMeta) GetPKName

func (meta TableMeta) GetPKName() string

func (TableMeta) GetPrimaryKeyMap

func (meta TableMeta) GetPrimaryKeyMap() map[string]ColumnMeta

func (TableMeta) GetPrimaryKeyOnlyName

func (meta TableMeta) GetPrimaryKeyOnlyName() []string

type TableRecords

type TableRecords struct {
	TableMeta TableMeta `json:"-"`
	TableName string
	Rows      []*Row
}

func NewTableRecords

func NewTableRecords(meta TableMeta) *TableRecords

func (*TableRecords) PKFields

func (records *TableRecords) PKFields() []*Field

Jump to

Keyboard shortcuts

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