postgres

package
v0.0.0-...-4742106 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable() *types.Table

func FillIDMinimum_ManyPK

func FillIDMinimum_ManyPK(MapTable map[string]*types.Table) error

FillIDMinimum_ManyPK - находим минимальный ID, для тестов с этим ID, для многих Primary Key

func FillMapTable1

func FillMapTable1(SettingsFill types.SettingsFillFromDatabase) (map[string]*types.Table, error)

FillMapTable1 - возвращает массив MassTable данными из БД

func FillRowsCount

func FillRowsCount(MapTable map[string]*types.Table) error

FillRowsCount - находим количество строк в таблице, для кэша

func FillTypeGo

func FillTypeGo(SettingsFill types.SettingsFillFromDatabase, Column1 *types.Column)

FillTypeGo - заполняет тип golang из типа postgres

func FindNameType_from_PrimaryKey

func FindNameType_from_PrimaryKey(Table1 *types.Table) (string, string)

FindNameType_from_PrimaryKey - возвращает наименование и тип БД для колонки PrimaryKey (ID)

func StartAll

func StartAll(SettingsFill types.SettingsFillFromDatabase) (map[string]*types.Table, error)

StartAll - заполняет MapTable данными из БД, и другие колонки

Types

type TableColumn

type TableColumn struct {
	TableName         string `json:"table_name"   gorm:"column:table_name;default:''"`
	ColumnName        string `json:"column_name"   gorm:"column:column_name;default:''"`
	ColumnType        string `json:"type_name"   gorm:"column:type_name;default:''"`
	ColumnIsIdentity  string `json:"is_identity"   gorm:"column:is_identity;default:''"`
	ColumnIsNullable  string `json:"is_nullable"   gorm:"column:is_nullable;default:''"`
	ColumnDescription string `json:"description"   gorm:"column:description;default:''"`
	ColumnTableKey    string `json:"table_key"   gorm:"column:table_key;default:''"`
	ColumnColumnKey   string `json:"column_key"   gorm:"column:column_key;default:''"`
	TableComment      string `json:"table_comment"   gorm:"column:table_comment;default:''"`
	IsPrimaryKey      bool   `json:"is_primary_key"   gorm:"column:is_primary_key;default:false"`
	TableIsView       bool   `json:"table_is_view"   gorm:"column:table_is_view;default:false"`
}

type TableRowsStruct

type TableRowsStruct struct {
	IDMinimum sql.NullString `json:"id_min"   gorm:"column:id_min;default:0"`
	RowsCount sql.NullInt64  `json:"rows_count"   gorm:"column:rows_count;default:0"`
}

Jump to

Keyboard shortcuts

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