driver

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Primary = "PRIMARY"

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	DB               *gorm.DB
	DbName           string
	TableNames       []string
	CustomDefineType map[string]string
}

func (*MySQL) GetCreateTableSQL

func (sf *MySQL) GetCreateTableSQL(tbName string) (string, error)

GetCreateTableSQL get create table sql

func (*MySQL) GetDatabase

func (sf *MySQL) GetDatabase() (*view.Database, error)

GetDatabase get database information

func (*MySQL) GetTableAttributes

func (sf *MySQL) GetTableAttributes() ([]view.TableAttribute, error)

GetTables get all table name and comments

func (*MySQL) GetTables

func (sf *MySQL) GetTables(tb view.TableAttribute) (*view.Table, error)

GetTableColumns get table's column info.

type SQL

type SQL struct {
	CreateTableSQL   string
	CustomDefineType map[string]string
	// contains filtered or unexported fields
}

func (*SQL) GetCreateTableSQL

func (sf *SQL) GetCreateTableSQL(tbName string) (string, error)

func (*SQL) GetDatabase

func (sf *SQL) GetDatabase() (*view.Database, error)

func (*SQL) GetTableAttributes

func (sf *SQL) GetTableAttributes() ([]view.TableAttribute, error)

func (*SQL) GetTables

func (sf *SQL) GetTables(tb view.TableAttribute) (*view.Table, error)

func (*SQL) Parse

func (sf *SQL) Parse() error

type SQLite

type SQLite struct {
	DB               *gorm.DB
	DbName           string
	TableNames       []string
	CustomDefineType map[string]string
}

func (*SQLite) GetCreateTableSQL

func (sf *SQLite) GetCreateTableSQL(tbName string) (string, error)

GetCreateTableSQL get create table sql

func (*SQLite) GetDatabase

func (sf *SQLite) GetDatabase() (*view.Database, error)

GetDbInfo get database info 获取数据库信息

func (*SQLite) GetTableAttributes

func (sf *SQLite) GetTableAttributes() ([]view.TableAttribute, error)

GetTables get all table name and comments 获取所有表及注释

func (*SQLite) GetTables

func (sf *SQLite) GetTables(tb view.TableAttribute) (*view.Table, error)

GetTableColumns get table's column info. 获取表的所有列的信息

Jump to

Keyboard shortcuts

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