postgres

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeBit     = "bit"
	TypeBitVar  = "bit varying"
	TypeBoolean = "boolean"
	TypeBool    = "bool" // boolean.
	TypeBytea   = "bytea"

	TypeCharacter = "character"
	TypeChar      = "char" // character
	TypeCharVar   = "character varying"
	TypeVarChar   = "varchar" // character varying
	TypeText      = "text"

	TypeSmallInt = "smallint"
	TypeInteger  = "integer"
	TypeBigInt   = "bigint"
	TypeInt      = "int"  // integer.
	TypeInt2     = "int2" // smallint.
	TypeInt4     = "int4" // integer.
	TypeInt8     = "int8" // bigint.

	TypeCIDR     = "cidr"
	TypeInet     = "inet"
	TypeMACAddr  = "macaddr"
	TypeMACAddr8 = "macaddr8"

	TypeCircle     = "circle"
	TypeLine       = "line"
	TypeLseg       = "lseg"
	TypeBox        = "box"
	TypePath       = "path"
	TypePolygon    = "polygon"
	TypePoint      = "point"
	TypePgLSN      = "pg_lsn"
	TypePgSnapshot = "pg_snapshot"
	TypeTSQuery    = "tsquery"
	TypeTSVector   = "tsvector"

	TypeDate               = "date"
	TypeTime               = "time" // time without time zone
	TypeTimeWithTZ         = "time with time zone"
	TypeTimeWithoutTZ      = "time without time zone"
	TypeTimestamp          = "timestamp" // timestamp without time zone
	TypeTimestampTZ        = "timestamptz"
	TypeTimestampWithTZ    = "timestamp with time zone"
	TypeTimestampWithoutTZ = "timestamp without time zone"

	TypeDouble = "double precision"
	TypeReal   = "real"
	TypeFloat8 = "float8" // double precision
	TypeFloat4 = "float4" // real

	TypeNumeric = "numeric"
	TypeDecimal = "decimal" // numeric

	TypeSmallSerial = "smallserial" // smallint with auto_increment.
	TypeSerial      = "serial"      // integer with auto_increment.
	TypeBigSerial   = "bigserial"   // bigint with auto_increment.
	TypeSerial2     = "serial2"     // smallserial
	TypeSerial4     = "serial4"     // serial
	TypeSerial8     = "serial8"     // bigserial

	TypeArray       = "array"
	TypeXML         = "xml"
	TypeJSON        = "json"
	TypeJSONB       = "jsonb"
	TypeUUID        = "uuid"
	TypeMoney       = "money"
	TypeInterval    = "interval"
	TypeUserDefined = "user-defined"
)

Variables

View Source
var (
	// VariablesQuery 系统变量查询语句
	VariablesQuery = `SELECT setting FROM pg_settings WHERE name IN ('lc_collate', 'lc_ctype', 'server_version_num') ORDER BY name`

	// TableQuery 表查询语句
	TablesQuery = `` /* 271-byte string literal not displayed */

	// ColumnsQuery 列查询语句
	ColumnsQueryFields = []string{
		"column_name",
		"data_type",
		"comment",
		"is_nullable",
		"column_default",
		"character_set_name",
		"collation_name",
		"numeric_precision",
		"numeric_scale",
		"character_maximum_length",
		"udt_name",
		"typtype",
		"oid",
	}

	ColumnsQuery = `` /* 533-byte string literal not displayed */

	EnumQuery = "SELECT enumlabel FROM pg_enum WHERE enumtypid = $1"

	// IndexesQuery 索引查询语句
	IndexesQueryFields = []string{
		"index_name",
		"index_type",
		"column_name",
		"primary",
		"unique",
		"constraint_type",
		"predicate",
		"expression",
		"asc",
		"desc",
		"nulls_first",
		"nulls_last",
		"comment",
	}
	IndexesQuery = `` /* 1032-byte string literal not displayed */

	// ForeignKeysQuery 外键查询语句
	ForeignKeysQueryFields = []string{
		"constraint_name",
		"table_name",
		"column_name",
		"table_schema",
		"referenced_table_name",
		"referenced_column_name",
		"referenced_schema_name",
		"update_rule",
		"delete_rule",
	}
	ForeignKeysQuery = `` /* 817-byte string literal not displayed */

)

From: https://github.com/ariga/atlas/tree/v0.4.1/sql/postgres/inspect.go#823

Functions

func NewInspector

func NewInspector(drv cre.Driver) schema.Inspector

Types

This section is empty.

Jump to

Keyboard shortcuts

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