schema

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TablesQuery = `
SELECT * FROM pg_tables WHERE schemaname='public'
`

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

	ColumnsFullQuery = `` /* 940-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	TableCatalog           sql.NullString `db:"table_catalog"`
	TableSchema            sql.NullString `db:"table_schema"`
	TableName              sql.NullString `db:"table_name"`
	ColumnName             sql.NullString `db:"column_name"`
	OridinalPosition       sql.NullInt64  `db:"ordinal_position"`
	ColumnDefault          sql.NullString `db:"column_default"`
	IsNullable             sql.NullString `db:"is_nullable"`
	DataType               sql.NullString `db:"data_type"`
	CharactorMaximumLength sql.NullInt64  `db:"character_maximum_length"`
	CharactorOctetLength   sql.NullInt64  `db:"character_octet_length"`
	NumericPrecision       sql.NullInt64  `db:"numeric_precision"`
	UDTCatalog             sql.NullString `db:"udt_catalog"`
	UDTSchema              sql.NullString `db:"udt_schema"`
	UDTName                sql.NullString `db:"udt_name"`
	IsUpdatable            sql.NullString `db:"is_updatable"`
}

func GetColumns

func GetColumns(ctx context.Context, db *psql.PSQLHandler, table string) ([]Column, error)

type Table

type Table struct {
	SchemaName     sql.NullString `db:"schemaname"`
	TableName      sql.NullString `db:"tablename"`
	TableOwner     sql.NullString `db:"tableowner"`
	TableSpace     sql.NullString `db:"tablespace"`
	HasIndexes     bool           `db:"hasindexes"`
	HasRules       bool           `db:"hasrules"`
	HasTriggers    bool           `db:"hastriggers"`
	HasRowSecurity bool           `db:"rowsecurity"`
}

func GetTables

func GetTables(ctx context.Context, db *psql.PSQLHandler) ([]Table, error)

Jump to

Keyboard shortcuts

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