pqm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTable

func InitTable(tx *sql.Tx, table *Table) error

Types

type Column

type Column struct {
	Type      string
	IsNotNull bool
	Default   interface{}
	Length    int64
}

func Array

func Array(def []interface{}, isNotNull bool) *Column

func Bigint

func Bigint(def int64, isNotNull bool) *Column

func Boolean

func Boolean(def bool) *Column

func Bytea

func Bytea(def []byte, isNotNull bool) *Column

func DPrecision

func DPrecision(def float64, isNotNull bool) *Column

func Integer

func Integer(def int32, isNotNull bool) *Column

func JsonB

func JsonB(def json.RawMessage, isNotNull bool) *Column

func Text

func Text(def string, isNotNull bool) *Column

func Timestamp

func Timestamp(def time.Time, isNotNull bool) *Column

func VarChar

func VarChar(def string, length int64, isNotNull bool) *Column

type Key

type Key struct {
	FromColumns     []string
	ToColumns       []string
	ToTableTitle    string
	IsUnicue        bool
	IsReferences    bool
	IsUpdateCascade bool
}

func Reference

func Reference(fromColumn, toTable, toColumn string) *Key

func Unique

func Unique(fromColumn []string) *Key

type Table

type Table struct {
	Title  string
	Column map[string]*Column
	Keys   map[string]*Key
}

Jump to

Keyboard shortcuts

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