Documentation ¶
Index ¶
- func GenSubDir(db *Database) (subdir string)
- type Column
- type Conn
- type Database
- func (db *Database) ExecProcedure(q string)
- func (db *Database) GenLink(conn *Conn, table string, cols []Column, pkey []PKey) (sqld, sqlc string)
- func (db *Database) GenTable(conn *Conn, table string, cols []Column, pkey []PKey) (sqld, sqlc string)
- func (db *Database) GenTableIndexSQL(conn *Conn, tableName string) (sqld, sqlc string)
- func (db *Database) GenUpdate(conn *Conn, table string, cols []Column, pkey []PKey) (sqld, sqlc string)
- func (db *Database) GetColumnDetail(conn *Conn, t string, debug bool, timeout int) ([]Column, error)
- func (db *Database) GetForeignTableSchema(conn *Conn, table string, timeout int) (sqld, sqlc string)
- func (db *Database) GetIndexSchema(schema, index string) (Index, error)
- func (db *Database) GetIndexes(schema string, timeout int) ([]IndexList, error)
- func (db *Database) GetPKey(conn *Conn, table string, timeout int) ([]PKey, error)
- func (db *Database) GetRoutine(d Database, schema string, r Routine, dbg bool)
- func (db *Database) GetRoutineSchema(schema, routine string) (Routine, error)
- func (db *Database) GetRoutines(schema string, timeout int) ([]RoutineList, error)
- func (db *Database) GetSchemas(timeout int) ([]Schema, error)
- func (db *Database) GetTableIndexSchema(schema, table string) ([]Index, error)
- func (db *Database) GetTableSchema(conn *Conn, table string, timeout int) (sqld, sqlc, sqldi, sqlci string)
- func (db *Database) GetTables(schemaName, ttype string, timeout int) ([]Table, error)
- func (db *Database) GetURI()
- func (db *Database) GetUpdateTableSchema(conn *Conn, table string, timeout int) (sqld, sqlc string)
- func (db *Database) GetView(d Database, schema string, view View, dbg bool)
- func (db *Database) GetViewSchema(schema, view string) (View, error)
- func (db *Database) GetViews(schema string, timeout int) ([]ViewList, error)
- type Index
- type IndexList
- type PKey
- type Routine
- type RoutineList
- type Schema
- type Table
- type View
- type ViewList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
type Column struct { Column string `db:"CL"` ColumnName string `db:"CN"` DataType string `db:"DT"` }
Column struct
type Database ¶
type Database struct { Name string `json:"name,omitempty"` Driver string `json:"driver,omitempty"` Host string `json:"host,omitempty"` Port string `json:"port,omitempty"` Database string `json:"database,omitempty"` Schema []string `json:"schema,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` PoolSize string `json:"poolsize,omitempty"` Drive string `json:"drive,omitempty"` SubDir string `json:"subdir,omitempty"` URI string Log *zap.SugaredLogger *sqlx.DB }
Database struct contains sql pointer
func (*Database) ExecProcedure ¶
ExecProcedure executes stored procedure
func (*Database) GenLink ¶
func (db *Database) GenLink(conn *Conn, table string, cols []Column, pkey []PKey) (sqld, sqlc string)
GenLink generate table creation
func (*Database) GenTable ¶
func (db *Database) GenTable(conn *Conn, table string, cols []Column, pkey []PKey) (sqld, sqlc string)
GenTable generate table craeation
func (*Database) GenTableIndexSQL ¶
func (*Database) GenUpdate ¶
func (db *Database) GenUpdate(conn *Conn, table string, cols []Column, pkey []PKey) (sqld, sqlc string)
GenUpdate generate update procedure
func (*Database) GetColumnDetail ¶
func (db *Database) GetColumnDetail(conn *Conn, t string, debug bool, timeout int) ([]Column, error)
GetColumnDetail func
func (*Database) GetForeignTableSchema ¶
func (db *Database) GetForeignTableSchema(conn *Conn, table string, timeout int) (sqld, sqlc string)
GetForeignTableSchema gets table definition
func (*Database) GetIndexSchema ¶
GetIndexeschema returns Indexes and definition
func (*Database) GetIndexes ¶
GetIndexes returns list of Indexes and definitions
func (*Database) GetRoutine ¶
GetRoutine gets procedure definition
func (*Database) GetRoutineSchema ¶
GetRoutineSchema returns routine and definition
func (*Database) GetRoutines ¶
func (db *Database) GetRoutines(schema string, timeout int) ([]RoutineList, error)
GetRoutines returns list of routines and definitions
func (*Database) GetSchemas ¶
GetSchemas returns schema list
func (*Database) GetTableIndexSchema ¶
GetIndexeschema returns Indexes and definition
func (*Database) GetTableSchema ¶
func (db *Database) GetTableSchema(conn *Conn, table string, timeout int) (sqld, sqlc, sqldi, sqlci string)
GetTableSchema gets table definition
func (*Database) GetUpdateTableSchema ¶
GetUpdateTableSchema gets table definition
func (*Database) GetViewSchema ¶
GetViewSchema returns views and definition
type Index ¶
type Index struct { Schema string `db:"schemaname"` Table string `db:"tablename"` Name string `db:"indexname"` Columns string `db:"indexcolumns"` Definition string `db:"indexdef"` }
Index list of Indexes
type Routine ¶
type Routine struct { Name string `db:"ROUTINE_NAME"` Type string `db:"ROUTINE_TYPE"` Definition string `db:"ROUTINE_DEFINITION"` DataType string `db:"DATA_TYPE"` ExternalLanguage string `db:"EXTERNAL_LANGUAGE"` }
Routine list of routines (procedures, functions)
type RoutineList ¶
type RoutineList struct {
Name string `db:"ROUTINE_NAME"`
}