dao

package
v0.0.0-...-66c7839 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultDao

type DefaultDao struct {
	DB *gorm.DB
}

func NewDefaultDao

func NewDefaultDao() *DefaultDao

func (*DefaultDao) DropNotExistsTable

func (this *DefaultDao) DropNotExistsTable() error

删除一个不存在的表

func (*DefaultDao) ExecDML

func (this *DefaultDao) ExecDML(sql string) error

执行dml

func (*DefaultDao) FindTableColumnNames

func (this *DefaultDao) FindTableColumnNames(sName string, tName string) ([]string, error)

获取表中所有的字段

func (*DefaultDao) FindTablePKColumnNames

func (this *DefaultDao) FindTablePKColumnNames(sName string, tName string) ([]string, error)

获取主键字段名

func (*DefaultDao) FindTableUKColumnNames

func (this *DefaultDao) FindTableUKColumnNames(sName string, tName string) ([]string, string, error)

获取唯一键字段

func (*DefaultDao) FindTablesBySchema

func (this *DefaultDao) FindTablesBySchema(sName string) ([]*models.DBTable, error)

获取表通过schema

func (*DefaultDao) GetOldestAndNewestPos

func (this *DefaultDao) GetOldestAndNewestPos() (*models.Position, *models.Position, error)

获取最老和最新的日志位点

func (*DefaultDao) GetUKName

func (this *DefaultDao) GetUKName(sName string, tName string) (string, error)

获取第一个唯一键

func (*DefaultDao) ShowBinaryLogs

func (this *DefaultDao) ShowBinaryLogs() ([]*models.BinaryLog, error)

func (*DefaultDao) ShowMasterStatus

func (this *DefaultDao) ShowMasterStatus() (*models.Position, error)

Jump to

Keyboard shortcuts

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