pgxgen

package module
v0.0.0-...-a9d5cc3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportedName

func ExportedName(s string) string

Types

type Column

type Column struct {
	Position int
	Nullable bool
	Name     string
	DataType string
	IsPK     bool
}

func (*Column) ExportedName

func (c *Column) ExportedName() string

func (*Column) GoType

func (c *Column) GoType() string

func (*Column) GoValueTemplate

func (c *Column) GoValueTemplate(v string) string

func (*Column) GoVar

func (c *Column) GoVar() string

func (*Column) GoVarTemplate

func (c *Column) GoVarTemplate() string

func (*Column) PgStringTemplate

func (c *Column) PgStringTemplate(v ...interface{}) string

func (*Column) PgValueTemplate

func (c *Column) PgValueTemplate(v string) string

func (*Column) PgxType

func (c *Column) PgxType() string

func (*Column) QualifiedGoType

func (c *Column) QualifiedGoType(s string) string

func (*Column) QualifiedPgxType

func (c *Column) QualifiedPgxType(s string) string

func (*Column) ShortName

func (c *Column) ShortName() string

type Enum

type Enum struct {
	Name   string
	Values []*EnumValue
}

func (*Enum) ExportedName

func (e *Enum) ExportedName() string

func (*Enum) GoType

func (e *Enum) GoType() string

func (*Enum) PgxType

func (e *Enum) PgxType() string

func (*Enum) ShortName

func (e *Enum) ShortName() string

type EnumValue

type EnumValue struct {
	Value string
}

func (*EnumValue) ExportedName

func (e *EnumValue) ExportedName() string

func (*EnumValue) GoType

func (e *EnumValue) GoType() string

type Filter

type Filter struct {
	Column Column
	Op     string
}

func (Filter) SQLOp

func (f Filter) SQLOp() string

type PGData

type PGData struct {
	Enums  map[string]*Enum
	Tables map[string]*Table
}

func Inspect

func Inspect(conn *pgx.Conn, schema string) (*PGData, error)

type Query

type Query struct {
	Name       string
	Table      Table
	Filter     []Filter
	Sort       []Sort
	ReturnOne  bool
	ReturnMany bool
	Paged      bool
}

func ProcessQueryDefinitions

func ProcessQueryDefinitions(def QueryDefinitions, data PGData) []Query

func (*Query) ExportedName

func (q *Query) ExportedName() string

type QueryDefinition

type QueryDefinition struct {
	Name   string
	Table  string
	Fields []string
	Sort   []string
	Return string
}

type QueryDefinitions

type QueryDefinitions struct {
	Query []QueryDefinition
}

type Sort

type Sort struct {
	Column Column
	Desc   bool
}

func (Sort) String

func (s Sort) String() string

type Table

type Table struct {
	Catalog     string
	Schema      string
	Name        string
	Columns     []*Column
	PrimaryKeys []*Column
	Indexes     map[string][]*Column
}

func (*Table) ExportedName

func (t *Table) ExportedName() string

func (*Table) GoType

func (t *Table) GoType() string

func (*Table) ShortName

func (t *Table) ShortName() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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