modelcols

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnsEqual

func ColumnsEqual(cols1, cols2 []string) bool

Types

type SQLColumn

type SQLColumn struct {
	ColName      string
	DataType     string
	DefaultValue string
	NotNull      bool
	PrimaryKey   bool
}

func (SQLColumn) Equal

func (sqc SQLColumn) Equal(cto SQLColumn) bool

type SQLColumns

type SQLColumns []SQLColumn

func (SQLColumns) FindColumnByName

func (sqs SQLColumns) FindColumnByName(name string) (SQLColumn, bool)

type SQLIndex

type SQLIndex struct {
	Name         string   `json:"name"`
	IsUnique     bool     `json:"isUnique,omitempty"`
	MethodName   string   `json:"methodName,omitempty"`
	Columns      []string `json:"columns"`
	Options      string   `json:"options,omitempty"` // jsonb_path_ops или (title NULLS FIRST)
	Concurrently bool     `json:"concurrently,omitempty"`
	With         string   `json:"with,omitempty"`
	Where        string   `json:"where,omitempty"`
}

func (SQLIndex) Equal

func (idx SQLIndex) Equal(to SQLIndex) bool

type SQLIndexes

type SQLIndexes []SQLIndex

func (SQLIndexes) FindByName

func (idxs SQLIndexes) FindByName(n string) (SQLIndex, bool)

type SQLModel

type SQLModel struct {
	Table          string     `json:"table"`
	Columns        SQLColumns `json:"cols,omitempty"`
	Indexes        SQLIndexes `json:"idxs,omitempty"`
	ViewQuery      string     `json:"viewQuery,omitempty"`
	IsView         bool       `json:"isView,omitempty"`
	IsMaterialized bool       `json:"isMaterialized,omitempty"`
}

func (SQLModel) AllIndexLowerNames

func (m SQLModel) AllIndexLowerNames() map[string]SQLIndex

func (*SQLModel) Equal

func (from *SQLModel) Equal(to *SQLModel) bool

func (*SQLModel) Scan

func (f *SQLModel) Scan(value interface{}) error

func (SQLModel) String

func (f SQLModel) String() string

func (SQLModel) Value

func (f SQLModel) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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