analysis

package
v0.0.0-...-fe15b3c Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeInteger   = "Integer"
	TypeNull      = "Null"
	TypeDecimal   = "Decimal"
	TypeTimestamp = "Timestamp"
	TypeDate      = "Date"
	TypeDatetime  = "Datetime"
	TypeString    = "String"
)

Variables

This section is empty.

Functions

func GetGroupByFields

func GetGroupByFields(query string) (columnNames []string, err error)

Types

type AsNameTableInfo

type AsNameTableInfo map[string]map[string]map[string]map[string]string

AsNameTableINfo likes the following:

{
    "tableAsName": {
        "colName": {
            "entity-dbname": {
                "entity-tablename": "entity-colname"
            }
        }
    }
}

type ColumnInfo

type ColumnInfo struct {
	Name          string
	Type          string
	Length        int64
	Unique        bool
	AutoIncrement bool
	MustNotNull   bool
	DefaultValue  string
}

type ColumnName

type ColumnName struct {
	Schema    string
	Table     string
	Name      string
	ColAsName string
}

func (ColumnName) String

func (c ColumnName) String() string

type EntityInfo

type EntityInfo map[string]map[string]map[string]bool

EntityInfo likes as the following:

{
   "entity-dbname": {
       "entity-tablename": {"entity-colname": true}
   }
}

type FKRelation

type FKRelation map[RelationTuple]bool

func DeduplicateFKRelation

func DeduplicateFKRelation(originalFKRelations []FKRelation) []FKRelation

func GetFKRelation

func GetFKRelation(query string) (fkRelations []FKRelation, err error)

type JoinConditionCol

type JoinConditionCol []ColumnName

type RelationTuple

type RelationTuple struct {
	DbName     string
	TableName  string
	ColumnName string
}

func (RelationTuple) String

func (rt RelationTuple) String() string

type SchemaInfo

type SchemaInfo struct {
	DbName          string
	TableName       string
	ColumnNames     map[string]*ColumnInfo
	KeyWithMultiCol map[string]*[]string
}

func GetSchemaInfo

func GetSchemaInfo(query string) ([]SchemaInfo, error)

type SelectColumns

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

func (*SelectColumns) Enter

func (s *SelectColumns) Enter(in ast.Node) (ast.Node, bool)

func (*SelectColumns) Leave

func (s *SelectColumns) Leave(in ast.Node) (ast.Node, bool)

Jump to

Keyboard shortcuts

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