Documentation ¶
Index ¶
- type ColumnInfo
- type DMOperator
- func (o DMOperator) Close(dbName string) error
- func (o DMOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (o DMOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (o DMOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (o DMOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (o DMOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (o DMOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (o DMOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (o DMOperator) Open(config *gormx.Config) error
- func (o DMOperator) Ping(dbName string) error
- type GPOperator
- func (G GPOperator) Close(dbName string) error
- func (G GPOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (G GPOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (G GPOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (G GPOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (G GPOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (G GPOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (G GPOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (G GPOperator) Open(config *gormx.Config) error
- func (G GPOperator) Ping(dbName string) error
- type GormDBTable
- type GormTableColumn
- type IConnector
- type IDataExplorer
- type IOperator
- type LogicDBInfo
- type MySQLOperator
- func (m MySQLOperator) Close(dbName string) error
- func (m MySQLOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (m MySQLOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (m MySQLOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (m MySQLOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (m MySQLOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (m MySQLOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (m MySQLOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (m MySQLOperator) Open(config *gormx.Config) error
- func (m MySQLOperator) Ping(dbName string) error
- type OracleOperator
- func (o OracleOperator) Close(dbName string) error
- func (o OracleOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (o OracleOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (o OracleOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (o OracleOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (o OracleOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (o OracleOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (o OracleOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (o OracleOperator) Open(config *gormx.Config) error
- func (o OracleOperator) Ping(dbName string) error
- type PGOperator
- func (P PGOperator) Close(dbName string) error
- func (P PGOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (P PGOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (P PGOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (P PGOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (P PGOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (P PGOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (P PGOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (P PGOperator) Open(config *gormx.Config) error
- func (P PGOperator) Ping(dbName string) error
- type Pagination
- type SQLiteOperator
- func (m SQLiteOperator) Close(dbName string) error
- func (m SQLiteOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (m SQLiteOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (m SQLiteOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (m SQLiteOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (m SQLiteOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (m SQLiteOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (m SQLiteOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (m SQLiteOperator) Open(config *gormx.Config) error
- func (m SQLiteOperator) Ping(dbName string) error
- type SQLiteTableColumn
- type SqlServerOperator
- func (s SqlServerOperator) Close(dbName string) error
- func (s SqlServerOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
- func (s SqlServerOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
- func (s SqlServerOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
- func (s SqlServerOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
- func (s SqlServerOperator) GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error)
- func (s SqlServerOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, ...) (rows []map[string]interface{}, err error)
- func (s SqlServerOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
- func (s SqlServerOperator) Open(config *gormx.Config) error
- func (s SqlServerOperator) Ping(dbName string) error
- type TableColInfo
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
type DMOperator ¶ added in v1.0.10
type DMOperator struct{}
func (DMOperator) Close ¶ added in v1.0.10
func (o DMOperator) Close(dbName string) error
func (DMOperator) CreateSchema ¶ added in v1.0.10
func (o DMOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (DMOperator) ExecuteDDL ¶ added in v1.0.10
func (o DMOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (DMOperator) GetColumns ¶ added in v1.0.10
func (o DMOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (DMOperator) GetColumnsUnderTables ¶ added in v1.0.10
func (o DMOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (DMOperator) GetDataBySQL ¶ added in v1.0.10
func (DMOperator) GetTableData ¶ added in v1.0.10
func (o DMOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (DMOperator) GetTablesUnderDB ¶ added in v1.0.10
func (o DMOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (DMOperator) Ping ¶ added in v1.0.10
func (o DMOperator) Ping(dbName string) error
type GPOperator ¶
type GPOperator struct{}
func (GPOperator) Close ¶
func (G GPOperator) Close(dbName string) error
func (GPOperator) CreateSchema ¶
func (G GPOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (GPOperator) ExecuteDDL ¶
func (G GPOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (GPOperator) GetColumns ¶
func (G GPOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (GPOperator) GetColumnsUnderTables ¶
func (G GPOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (GPOperator) GetDataBySQL ¶
func (GPOperator) GetTableData ¶
func (G GPOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (GPOperator) GetTablesUnderDB ¶
func (G GPOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (GPOperator) Ping ¶
func (G GPOperator) Ping(dbName string) error
type GormDBTable ¶
type GormTableColumn ¶
type IConnector ¶
type IConnector interface { Open(config *gormx.Config) error Ping(dbName string) error Close(dbName string) error }
IConnector 数据库连接器接口
type IDataExplorer ¶
type IDataExplorer interface { // GetTablesUnderDB 获取该库下所有逻辑库及表名 GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error) // GetColumns 获取指定库所有逻辑库及表下字段列表 GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error) // GetColumnsUnderTables 获取指定库表下字段列表 GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error) // CreateSchema 创建逻辑库 CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error) // ExecuteDDL 执行DDL ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error) // GetDataBySQL 执行自定义 GetDataBySQL(ctx context.Context, dbName, sqlStatement string) (rows []map[string]interface{}, err error) // GetTableData 执行查询表数据, pageInfo为nil时不分页 GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error) }
IDataExplorer 数据探查
type IOperator ¶
type IOperator interface { IConnector IDataExplorer }
func NewDMOperator ¶ added in v1.0.10
func NewDMOperator() IOperator
func NewGPOperator ¶
func NewGPOperator() IOperator
func NewMySQLOperator ¶
func NewMySQLOperator() IOperator
func NewOracleOperator ¶
func NewOracleOperator() IOperator
func NewPGOperator ¶
func NewPGOperator() IOperator
func NewSQLiteOperator ¶ added in v1.0.10
func NewSQLiteOperator() IOperator
func NewSqlserverOperator ¶
func NewSqlserverOperator() IOperator
type LogicDBInfo ¶
type MySQLOperator ¶
type MySQLOperator struct{}
func (MySQLOperator) Close ¶
func (m MySQLOperator) Close(dbName string) error
func (MySQLOperator) CreateSchema ¶
func (m MySQLOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (MySQLOperator) ExecuteDDL ¶
func (m MySQLOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (MySQLOperator) GetColumns ¶
func (m MySQLOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (MySQLOperator) GetColumnsUnderTables ¶
func (m MySQLOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (MySQLOperator) GetDataBySQL ¶
func (MySQLOperator) GetTableData ¶
func (m MySQLOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (MySQLOperator) GetTablesUnderDB ¶
func (m MySQLOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (MySQLOperator) Ping ¶
func (m MySQLOperator) Ping(dbName string) error
type OracleOperator ¶
type OracleOperator struct{}
func (OracleOperator) Close ¶
func (o OracleOperator) Close(dbName string) error
func (OracleOperator) CreateSchema ¶
func (o OracleOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (OracleOperator) ExecuteDDL ¶
func (o OracleOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (OracleOperator) GetColumns ¶
func (o OracleOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (OracleOperator) GetColumnsUnderTables ¶
func (o OracleOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (OracleOperator) GetDataBySQL ¶
func (OracleOperator) GetTableData ¶
func (o OracleOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (OracleOperator) GetTablesUnderDB ¶
func (o OracleOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (OracleOperator) Ping ¶
func (o OracleOperator) Ping(dbName string) error
type PGOperator ¶
type PGOperator struct{}
func (PGOperator) Close ¶
func (P PGOperator) Close(dbName string) error
func (PGOperator) CreateSchema ¶
func (P PGOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (PGOperator) ExecuteDDL ¶
func (P PGOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (PGOperator) GetColumns ¶
func (P PGOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (PGOperator) GetColumnsUnderTables ¶
func (P PGOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (PGOperator) GetDataBySQL ¶
func (PGOperator) GetTableData ¶
func (P PGOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (PGOperator) GetTablesUnderDB ¶
func (P PGOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (PGOperator) Ping ¶
func (P PGOperator) Ping(dbName string) error
type Pagination ¶
type Pagination struct { Page int64 `json:"page"` // 当前页 PageSize int64 `json:"page_size"` // 每页多少条记录 PageCount int64 `json:"page_count"` // 一共多少页 Total int64 `json:"total"` // 一共多少条记录 }
Pagination 分页结构体(该分页只适合数据量很少的情况)
func (*Pagination) GetOffset ¶
func (p *Pagination) GetOffset() (offset int64)
func (*Pagination) SetPageCount ¶
func (p *Pagination) SetPageCount()
type SQLiteOperator ¶ added in v1.0.10
type SQLiteOperator struct{}
func (SQLiteOperator) Close ¶ added in v1.0.10
func (m SQLiteOperator) Close(dbName string) error
func (SQLiteOperator) CreateSchema ¶ added in v1.0.10
func (m SQLiteOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (SQLiteOperator) ExecuteDDL ¶ added in v1.0.10
func (m SQLiteOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (SQLiteOperator) GetColumns ¶ added in v1.0.10
func (m SQLiteOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (SQLiteOperator) GetColumnsUnderTables ¶ added in v1.0.10
func (m SQLiteOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (SQLiteOperator) GetDataBySQL ¶ added in v1.0.10
func (SQLiteOperator) GetTableData ¶ added in v1.0.10
func (m SQLiteOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (SQLiteOperator) GetTablesUnderDB ¶ added in v1.0.10
func (m SQLiteOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (SQLiteOperator) Open ¶ added in v1.0.10
func (m SQLiteOperator) Open(config *gormx.Config) error
func (SQLiteOperator) Ping ¶ added in v1.0.10
func (m SQLiteOperator) Ping(dbName string) error
type SQLiteTableColumn ¶ added in v1.0.10
type SqlServerOperator ¶
type SqlServerOperator struct{}
func (SqlServerOperator) Close ¶
func (s SqlServerOperator) Close(dbName string) error
func (SqlServerOperator) CreateSchema ¶
func (s SqlServerOperator) CreateSchema(ctx context.Context, dbName, schemaName, commentInfo string) (err error)
func (SqlServerOperator) ExecuteDDL ¶
func (s SqlServerOperator) ExecuteDDL(ctx context.Context, dbName, ddlStatement string) (err error)
func (SqlServerOperator) GetColumns ¶
func (s SqlServerOperator) GetColumns(ctx context.Context, dbName string) (dbTableColMap map[string]map[string]*TableColInfo, err error)
func (SqlServerOperator) GetColumnsUnderTables ¶
func (s SqlServerOperator) GetColumnsUnderTables(ctx context.Context, dbName, logicDBName string, tableNames []string) (tableColMap map[string]*TableColInfo, err error)
func (SqlServerOperator) GetDataBySQL ¶
func (SqlServerOperator) GetTableData ¶
func (s SqlServerOperator) GetTableData(ctx context.Context, dbName, schemaName, tableName string, pageInfo *Pagination) (rows []map[string]interface{}, err error)
func (SqlServerOperator) GetTablesUnderDB ¶
func (s SqlServerOperator) GetTablesUnderDB(ctx context.Context, dbName string) (dbTableMap map[string]*LogicDBInfo, err error)
func (SqlServerOperator) Ping ¶
func (s SqlServerOperator) Ping(dbName string) error
type TableColInfo ¶
type TableColInfo struct { TableName string ColumnInfoList []*ColumnInfo // 列 }
Click to show internal directories.
Click to hide internal directories.