pgsql

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Field      string `orm:"field"`    // 字段名
	Type       string `orm:"type"`     // 字段类型
	NotNull    string `orm:"not_null"` // 是否为空 t/f
	Length     int    `orm:"length"`   // 字段长度
	Typmod     int    `orm:"typmod"`   // 字段长度
	Comment    string `orm:"comment"`  // 字段注释
	Table      string `orm:"table"`    // 表名
	Num        int    `orm:"num"`      // 字段序号
	Conkey     []int  `orm:"conkey"`   // 主键字段序号
	PrimaryKey bool
}

type Index

type Index struct {
	IndexName  string `orm:"index_name"`
	ColumnName string `orm:"column_name"`
	IsUnique   bool   `orm:"is_unique"`
	Table      string `orm:"table"`
}

type Pgsql

type Pgsql struct {
	// contains filtered or unexported fields
}

func (*Pgsql) GetSqlType

func (d *Pgsql) GetSqlType(ctx context.Context, goType string, size string) string

func (*Pgsql) GetSyncSql

func (d *Pgsql) GetSyncSql(ctx context.Context, db gdb.DB, task model.SyncTask) (list []string, err error)

GetSyncSql 更新数据库结构

func (*Pgsql) LoadSchema

func (d *Pgsql) LoadSchema(ctx context.Context, db gdb.DB) (schema model.Schema, err error)

LoadSchema 获取数据库结构

func (*Pgsql) Schema

func (d *Pgsql) Schema(schema string)

Jump to

Keyboard shortcuts

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