pgslice

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(message string) error

func AddPartitions

func AddPartitions(ctx *cli.Context) error

func AdvanceDate

func AdvanceDate(date time.Time, period string, count int) time.Time

func Analyze

func Analyze(ctx *cli.Context) error

func Connection

func Connection(ctx *cli.Context) (*sqlx.DB, error)

func Contains

func Contains(s []string, e string) bool

func FetchSettings

func FetchSettings(db *sqlx.DB, originalTable Table, table Table) (string, string, string, bool)

func Fill

func Fill(ctx *cli.Context) error

func LogSQL

func LogSQL(s string)

func MakeFkDef

func MakeFkDef(def string, table Table) string

func MakeIndexDef

func MakeIndexDef(def string, table Table) string

func NameFormat

func NameFormat(period string) string

func PartitionDate

func PartitionDate(partition Table, nameFormat string) time.Time

func Prep

func Prep(ctx *cli.Context) error

func QuoteColumns

func QuoteColumns(key []string) string

func QuoteIdent

func QuoteIdent(column string) string

func QuoteNoSchema

func QuoteNoSchema(table Table) string

func QuoteTable

func QuoteTable(table Table) string

func RoundDate

func RoundDate(t time.Time, period string) time.Time

func RunQueries

func RunQueries(db *sqlx.DB, queries []string, ctx *cli.Context) error

func RunQueriesWithoutTransaction

func RunQueriesWithoutTransaction(db *sqlx.DB, queries []string, ctx *cli.Context) error

func RunQuery

func RunQuery(db *sqlx.DB, query string, ctx *cli.Context) error

func SQLDate

func SQLDate(time time.Time, cast string, addCast bool) string

func ServerVersionNum

func ServerVersionNum(db *sqlx.DB) int

func Swap

func Swap(ctx *cli.Context) error

func Unprep

func Unprep(ctx *cli.Context) error

func Unswap

func Unswap(ctx *cli.Context) error

Types

type Sequence

type Sequence struct {
	Name   string
	Column string
}

type Table

type Table struct {
	Schema string
	Name   string
}

func CreateTable

func CreateTable(name string) Table

func (Table) ColumnCast

func (t Table) ColumnCast(db *sqlx.DB, column string) string

func (Table) Columns

func (t Table) Columns(db *sqlx.DB) []string

func (Table) ExistingTables

func (t Table) ExistingTables(db *sqlx.DB, like string) []Table

func (Table) Exists

func (t Table) Exists(db *sqlx.DB) bool

func (Table) FetchComment

func (t Table) FetchComment(db *sqlx.DB) string

func (Table) FetchTrigger

func (t Table) FetchTrigger(db *sqlx.DB, triggerName string) string

func (Table) ForeignKeys

func (t Table) ForeignKeys(db *sqlx.DB) []string

func (Table) FullName

func (t Table) FullName() string

func (Table) IndexDefs

func (t Table) IndexDefs(db *sqlx.DB) []string

func (Table) IntermediateTable

func (t Table) IntermediateTable() Table

func (Table) MaxID

func (t Table) MaxID(db *sqlx.DB, primaryKey string, where string, below int) int

func (Table) MinID

func (t Table) MinID(db *sqlx.DB, primaryKey string, column string, cast string, startingTime time.Time, where string) int

func (Table) Partitions

func (t Table) Partitions(db *sqlx.DB) []Table

func (Table) PrimaryKey

func (t Table) PrimaryKey(db *sqlx.DB) []string

func (Table) Regclass

func (t Table) Regclass() string

func (Table) RetiredTable

func (t Table) RetiredTable() Table

func (Table) Sequences

func (t Table) Sequences(db *sqlx.DB) []Sequence

func (Table) TriggerName

func (t Table) TriggerName() string

Jump to

Keyboard shortcuts

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