driver

package
v0.0.1-rc13 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 6 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 {
	CustomDefineType map[string]string
	// contains filtered or unexported fields
}

func NewMySQL

func NewMySQL(db *gorm.DB, customDefineType map[string]string) *MySQL

func (*MySQL) GetCreateTableSQL

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

GetCreateTableSQL get create table sql

func (*MySQL) GetDatabase

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

GetDatabase get database information

func (*MySQL) GetTableColumns

func (sf *MySQL) GetTableColumns(dbName string, tb view.TableAttribute) (*view.Table, error)

GetTableColumns get table's column info.

func (*MySQL) GetTables

func (sf *MySQL) GetTables(dbName string, tbNames ...string) ([]view.TableAttribute, error)

GetTables get all table name and comments

type SQLite

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

func NewSQLite

func NewSQLite(db *gorm.DB, customDefineType map[string]string) *SQLite

func (*SQLite) GetCreateTableSQL

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

GetCreateTableSQL get create table sql

func (*SQLite) GetDatabase

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

GetDbInfo get database info 获取数据库信息

func (*SQLite) GetTableColumns

func (sf *SQLite) GetTableColumns(dbName string, tb view.TableAttribute) (*view.Table, error)

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

func (*SQLite) GetTables

func (sf *SQLite) GetTables(dbName string, tbNames ...string) ([]view.TableAttribute, error)

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

Jump to

Keyboard shortcuts

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