db

package
v0.0.0-...-f13fc7a Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StmtSelect = "select"
	StmtRow    = "row"
)

Variables

View Source
var Once sync.Once

Functions

func GetTableNames

func GetTableNames(v reflect.Value, tables []string, level int) []string

func ReplaceTableName

func ReplaceTableName(tableNames []string, sql, instanceID string) string

func UniqueNoNullSlice

func UniqueNoNullSlice(slice ...string) (newSlice []string)

Types

type DB

type DB struct {
	DbConn *sql.DB
}
var Instance *DB

func GetDB

func GetDB(dbName string) *DB

func (*DB) Exec

func (d *DB) Exec(sqlStr string) common_type.PluginError

func (*DB) ImportSql

func (d *DB) ImportSql(sqlFileName, appUUID, version, instanceUUID string) common_type.PluginError

func (*DB) Select

func (d *DB) Select(sqlStr string) (*protocol.TableMessage, common_type.PluginError)

type DataBase

type DataBase struct {
	Source   *protocol.PlatformMessage
	Distinct *protocol.PlatformMessage
	// contains filtered or unexported fields
}

func NewDataBase

func NewDataBase(sourceMessage *protocol.PlatformMessage, distinctMessage *protocol.PlatformMessage) *DataBase

func (*DataBase) Execute

func (d *DataBase) Execute()

Jump to

Keyboard shortcuts

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