introspect

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseParamsAsNil

func ParseParamsAsNil(query string) (map[string]any, error)

Types

type Column

type Column struct {
	ColumnName        string `db:"column_name" json:"column_name"`
	Type              string `db:"type" json:"type"`
	TypeId            string `db:"type_id" json:"type_id"`
	IsArray           bool   `db:"is_array" json:"is_array"`
	IsSequence        bool   `db:"is_sequence" json:"is_sequence"`
	Nullable          bool   `db:"nullable" json:"nullable"`
	Generated         bool   `db:"generated" json:"generated"`
	PkName            string `db:"pk_name" json:"pk_name"`
	PkOrdinalPosition int    `db:"pk_ordinal_position" json:"pk_ordinal_position"`
	JsonType          string `db:"json_type" json:"json_type"`
}

func ParseParams

func ParseParams(query string) ([]Column, error)

func (*Column) Scan

func (column *Column) Scan(value interface{}) error

func (*Column) String

func (column *Column) String() string

func (*Column) Value

func (column *Column) Value() (driver.Value, error)

type Columns

type Columns []Column

func (*Columns) Scan

func (columns *Columns) Scan(value interface{}) error

func (*Columns) String

func (columns *Columns) String() string

func (*Columns) Value

func (columns *Columns) Value() (driver.Value, error)

type Introspect

type Introspect interface {
	IntrospectSchema(tx *sqlx.Tx) ([]Table, error)

	IntrospectQueries(tx *sqlx.Tx) ([]Query, error)
}

type Query

type Query struct {
	Filename   string  `db:"filename" json:"filename"`
	QueryName  string  `db:"query_name" json:"query_name"`
	PascalName string  `db:"pascal_name" json:"pascal_name"`
	CamelName  string  `db:"camel_name" json:"camel_name"`
	Columns    Columns `db:"columns" json:"columns"`
	Params     Columns `db:"params" json:"params"`
	SourceDir  string  `db:"source_dir" json:"source_dir"`
}

type Table

type Table struct {
	SchemaName string  `db:"schema_name" json:"schema_name"`
	TableName  string  `db:"table_name" json:"table_name"`
	Columns    Columns `db:"columns" json:"columns"`
}

func (*Table) PrimaryKey

func (table *Table) PrimaryKey() Columns

func (*Table) String

func (table *Table) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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