sink

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Catalog       string  `sqlx:"TABLE_CATALOG"`
	Schema        string  `sqlx:"TABLE_SCHEMA"`
	Table         string  `sqlx:"TABLE_NAME"`
	Name          string  `sqlx:"COLUMN_NAME"`
	Position      int     `sqlx:"ORDINAL_POSITION"`
	Comments      string  `sqlx:"COLUMN_COMMENT"`
	Type          string  `sqlx:"DATA_TYPE"`
	Length        *int64  `sqlx:"CHARACTER_MAXIMUM_LENGTH"`
	Precision     *int64  `sqlx:"NUMERIC_PRECISION"`
	Scale         *int64  `sqlx:"NUMERIC_SCALE"`
	Nullable      string  `sqlx:"IS_NULLABLE"`
	Default       *string `sqlx:"COLUMN_DEFAULT"`
	Key           string  `sqlx:"COLUMN_KEY"`
	Descending    string  `sqlx:"DESCENDING"`
	Index         string  `sqlx:"INDEX_NAME"`
	IndexPosition int     `sqlx:"INDEX_POSITION"`
	Collation     *string `sqlx:"COLLATION"`
}

Column represents column metadata

type Function

type Function struct {
	Catalog       string `sqlx:"ROUTINE_CATALOG"`
	Schema        string `sqlx:"ROUTINE_SCHEMA"`
	Name          string `sqlx:"ROUTINE_NAME"`
	Body          string `sqlx:"ROUTINE_BODY"`
	DataType      string `sqlx:"DATA_TYPE"`    // The data type name that the SQL function returns.
	Type          string `sqlx:"ROUTINE_TYPE"` // Native or user defined ("NATIVE" or "")
	Charset       string `sqlx:"CHARACTER_SET_NAME"`
	Deterministic string `sqlx:"IS_DETERMINISTIC"`
}

Function represents information schema function

type Index

type Index struct {
	Catalog     string `sqlx:"TABLE_CATALOG"`
	Table       string `sqlx:"TABLE_NAME"`
	Type        string `sqlx:"INDEX_TYPE"`
	TableSchema string `sqlx:"TABLE_SCHEMA"`
	Schema      string `sqlx:"INDEX_SCHEMA"`
	Position    int    `sqlx:"INDEX_POSITION"`
	Name        string `sqlx:"INDEX_NAME"`
	Unique      string `sqlx:"INDEX_UNIQUE"`
	Columns     string `sqlx:"INDEX_COLUMNS"`
	Origin      string `sqlx:"INDEX_ORIGIN"`
	Partial     string `sqlx:"INDEX_PARTIAL"`
}

Index represent index metadata

type Key

type Key struct {
	Name              string `sqlx:"CONSTRAINT_NAME"`
	Type              string `sqlx:"CONSTRAINT_TYPE"`
	Catalog           string `sqlx:"CONSTRAINT_CATALOG"`
	Schema            string `sqlx:"CONSTRAINT_SCHEMA"`
	Table             string `sqlx:"TABLE_NAME"`
	Position          int    `sqlx:"ORDINAL_POSITION"`
	Column            string `sqlx:"COLUMN_NAME"`
	ReferenceTable    string `sqlx:"REFERENCED_TABLE_NAME"`
	ReferenceColumn   string `sqlx:"REFERENCED_COLUMN_NAME"`
	ReferenceSchema   string `sqlx:"REFERENCED_TABLE_SCHEMA"`
	ConstrainPosition int    `sqlx:"POSITION_IN_UNIQUE_CONSTRAINT"`
	OnUpdate          string `sqlx:"ON_UPDATE"`
	OnDelete          string `sqlx:"ON_DELETE"`
	OnMatch           string `sqlx:"ON_MATCH"`
}

Key represents information schema constraint key

type Lock

type Lock struct {
	Catalog string `sqlx:"LOCK_CATALOG"`
	Schema  string `sqlx:"LOCK_SCHEMA"`
	Table   string `sqlx:"LOCK_TABLE"`
	Name    string `sqlx:"LOCK_NAME"`
	Success int    `sqlx:"SUCCESS"`
}

Lock represents lock

type Schema

type Schema struct {
	Catalog      string `sqlx:"CATALOG_NAME"`
	Name         string `sqlx:"SCHEMA_NAME"`
	CharacterSet string `sqlx:"DEFAULT_CHARACTER_SET_NAME"`
	Collation    string `sqlx:"DEFAULT_COLLATION_NAME"`
	Path         string `sqlx:"SCHEMA_FILE|SQL_PATH"`
	Sequence     int64  `sqlx:"SCHEMA_POS"`
	Region       string `sqlx:"REGION"`
}

Schema represents information schema schema

type Sequence

type Sequence struct {
	Catalog     string `sqlx:"SEQUENCE_CATALOG"`
	Schema      string `sqlx:"SEQUENCE_SCHEMA"`
	Name        string `sqlx:"SEQUENCE_NAME"`
	Value       int64  `sqlx:"SEQUENCE_VALUE"`
	IncrementBy int64  `sqlx:"INCREMENT_BY"`
	DataType    string `sqlx:"DATA_TYPE"`
	StartValue  int64  `sqlx:"START_VALUE"`
	MaxValue    int64  `sqlx:"MAX_VALUE"`
}

Sequence represents information schema sequence

func (*Sequence) MinValue

func (s *Sequence) MinValue(recordCount int64) int64

MinValue returns previous sequence's next value for given record count

func (*Sequence) NextValue

func (s *Sequence) NextValue(recordCount int64) int64

NextValue returns sequence's next value for given record count

type Session

type Session struct {
	PID      string `sqlx:"PID"`
	Username string `sqlx:"USER_NAME"`
	Region   string `sqlx:"REGION"`
	Catalog  string `sqlx:"CATALOG_NAME"`
	Schema   string `sqlx:"SCHEMA_NAME"`
	AppName  string `sqlx:"APP_NAME"`
}

Session represents connection session info

type Table

type Table struct {
	Catalog       string `sqlx:"TABLE_CATALOG"`
	Schema        string `sqlx:"TABLE_SCHEMA"`
	Name          string `sqlx:"TABLE_NAME"`
	Comment       string `sqlx:"TABLE_COMMENT"`
	Type          string `sqlx:"TABLE_TYPE"`
	AutoIncrement string `sqlx:"AUTO_INCREMENT"`
	CreateTime    string `sqlx:"CREATE_TIME"`
	UpdateTime    string `sqlx:"UPDATE_TIME"`
	Rows          int    `sqlx:"TABLE_ROWS"`
	Version       string `sqlx:"VERSION"`
	Engine        string `sqlx:"ENGINE"`
	SQL           string `sqlx:"DDL"`
}

Table represent metadata table

Jump to

Keyboard shortcuts

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