Documentation
¶
Index ¶
- Variables
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames(ext string) (files []string)
- func CommandExist(command string) bool
- func Contains(s string, sub ...string) bool
- func DownloadColumn(w http.ResponseWriter, req *http.Request)
- func ExportDatabase(w http.ResponseWriter, r *http.Request)
- func FindDbName(dsn string) (string, error)
- func FirstWord(s string) string
- func ImportDatabase(w http.ResponseWriter, r *http.Request)
- func InitCfgFile(configTplFileName, configFileName string) error
- func InitConf()
- func InitCtl(ctlTplName, ctlFilename string) error
- func IsQuerySQL(sql string) (string, bool)
- func LoadDapsConfigFile(w http.ResponseWriter, r *http.Request) error
- func LoadDapsOpptions(w http.ResponseWriter, r *http.Request) error
- func MustAsset(name string) []byte
- func ParseUploadedFile(r *http.Request, w http.ResponseWriter) (string, string, error)
- func SaveDapsConfigFile(w http.ResponseWriter, r *http.Request) error
- func SaveDapsOpptions(w http.ResponseWriter, r *http.Request) error
- func ServeAction(w http.ResponseWriter, r *http.Request)
- func ServeFont(prefix string) http.HandlerFunc
- func ServeHome(w http.ResponseWriter, r *http.Request)
- func ServeLoadLinksConfig(w http.ResponseWriter, r *http.Request)
- func ServeQuery(w http.ResponseWriter, req *http.Request)
- func ServeSaveLinksConfig(w http.ResponseWriter, r *http.Request)
- func ServeSearchDb(w http.ResponseWriter, req *http.Request)
- func ServeTablesByColumn(w http.ResponseWriter, req *http.Request)
- func ServeUpdate(w http.ResponseWriter, r *http.Request) (interface{}, error)
- func TenantsQuery(w http.ResponseWriter, r *http.Request)
- func TimeNow() string
- func WrapHandlerFunc(f func(http.ResponseWriter, *http.Request) (interface{}, error)) http.HandlerFunc
- func WriteExportedSqlFile(tcode string, w http.ResponseWriter, file multipart.File) (string, error)
- type Action
- type ActionProxy
- type AppConfig
- type CacheAction
- type Conn
- type ContextKey
- type DSNS
- type Daps
- type ImportResult
- type LoginUser
- type Merchant
- type MerchantDb
- type QueryResult
- type Result
- type RunResult
- type UnknownAction
- type UpdateResult
- type UpdateResultRow
Constants ¶
This section is empty.
Variables ¶
View Source
var IsWindows = runtime.GOOS == "windows"
Functions ¶
func AssetNames ¶
func CommandExist ¶
func DownloadColumn ¶
func DownloadColumn(w http.ResponseWriter, req *http.Request)
func ExportDatabase ¶
func ExportDatabase(w http.ResponseWriter, r *http.Request)
func FindDbName ¶
func ImportDatabase ¶
func ImportDatabase(w http.ResponseWriter, r *http.Request)
func InitCfgFile ¶
InitCfgFile initializes the cfg file.
func IsQuerySQL ¶
IsQuerySQL tests a sql is a query or not.
func LoadDapsConfigFile ¶
func LoadDapsConfigFile(w http.ResponseWriter, r *http.Request) error
func LoadDapsOpptions ¶
func LoadDapsOpptions(w http.ResponseWriter, r *http.Request) error
func ParseUploadedFile ¶
func SaveDapsConfigFile ¶
func SaveDapsConfigFile(w http.ResponseWriter, r *http.Request) error
func SaveDapsOpptions ¶
func SaveDapsOpptions(w http.ResponseWriter, r *http.Request) error
func ServeAction ¶
func ServeAction(w http.ResponseWriter, r *http.Request)
func ServeFont ¶
func ServeFont(prefix string) http.HandlerFunc
func ServeLoadLinksConfig ¶
func ServeLoadLinksConfig(w http.ResponseWriter, r *http.Request)
func ServeQuery ¶
func ServeQuery(w http.ResponseWriter, req *http.Request)
func ServeSaveLinksConfig ¶
func ServeSaveLinksConfig(w http.ResponseWriter, r *http.Request)
func ServeSearchDb ¶
func ServeSearchDb(w http.ResponseWriter, req *http.Request)
func ServeTablesByColumn ¶
func ServeTablesByColumn(w http.ResponseWriter, req *http.Request)
func ServeUpdate ¶
func ServeUpdate(w http.ResponseWriter, r *http.Request) (interface{}, error)
func TenantsQuery ¶
func TenantsQuery(w http.ResponseWriter, r *http.Request)
func WrapHandlerFunc ¶
func WrapHandlerFunc(f func(http.ResponseWriter, *http.Request) (interface{}, error)) http.HandlerFunc
func WriteExportedSqlFile ¶
Types ¶
type ActionProxy ¶
type ActionProxy struct {
Proxy string
}
type AppConfig ¶
type AppConfig struct {
ContextPath string
ListenPort int
MaxQueryRows int
DSN string
DefaultDB string
TrrHomeArea string
DevMode bool // to disable css/js minify
BasicAuth []string
ImportDb bool
ActionProxy map[string]ActionProxy
EncryptKey string
CookieName string
RedirectUri string
LocalUrl string
ForceLogin bool
// 是否只显示sqlweb表定义的库,不自动补充show databases()的库列表
OnlyShowSqlWebDatabases bool
WriteAuthUserNames []string // UserNames which has write auth
DSNS []DSNS // 配置文件中的多数据源配置
BasicAuthGroups [][]string `toml:"-"`
}
var AppConf AppConfig
func (AppConfig) BasicAuthRequired ¶
type CacheAction ¶
type CacheAction struct {
Tenant *Merchant
Key string
Value string
Score string
Ttl string
Op string // Set/Get/Clear
Db int
}
func (*CacheAction) Execute ¶
func (t *CacheAction) Execute() ([]byte, error)
type Conn ¶
type Conn struct {
Name string `yaml:"name"` // 链接名称
Url string `yaml:"url"` // 链接 URL
User string `yaml:"user"` // 用户名
Driver string `yaml:"driver"` // daps6 底层驱动
Debug int `yaml:"debug"` // 调试级别
ConfigFile string `yaml:"configFile"` // 配置文件
AlterDbNames string `yaml:"alterDbNames"` // 替换数据库名称
AlterSchemaNames string `yaml:"alterSchemaNames"` // 替换 schema 名称
AlterDbHosts string `yaml:"alterDbHosts"` // 替换数据库主机
}
type Daps ¶
type ImportResult ¶
type MerchantDb ¶
type QueryResult ¶
type Result ¶
type Result struct {
Query bool `json:"query"`
FirstWordLower string `json:"first_word_lower"`
Executed bool `json:"executed"`
Effected int `json:"effected"`
ResultSet []any `json:"resultSet"`
RowCount int `json:"rowCount"`
CostNano int `js:"costNano"`
CipherColumns []string `json:"cipherColumns"`
ColumnTypes map[string]string `json:"resultColumnTypes"`
ColumnLabels []string `json:"columnLabels"`
ColumnCount int `json:"columnCount"`
ExecuteBatch []int `js:"executeBatch"`
TimesResult []Result `js:"timesResult"`
ExeTimes int `js:"exeTimes"`
Args []any `js:"args"`
RewrittenSql string `js:"rewrittenSql"`
RewrittenParameters []any `js:"rewrittenParameters"`
G4CostNano int `json:"g4CostNano"` // antlr 解析 SQL 的时间
RealCost int `json:"realCost"` // 实际时间(缓存后不需要再次 antlr 解析了)
HasEncryptionTable bool `json:"hasEncryptionTable"` // 是否包含加密表
RewriteTokens int `json:"rewriteTokens"` // SQL 改写的 token 数量
ParsedOK bool `json:"parsedOK"` // SQL 解析是否成功
Error string `json:"error"` // 异常消息
RunResult *RunResult `json:"runResult"`
}
func (*Result) IndexedRows ¶
type UnknownAction ¶
type UnknownAction struct {
}
func (*UnknownAction) Execute ¶
func (t *UnknownAction) Execute() ([]byte, error)
type UpdateResult ¶
type UpdateResult struct {
Ok bool
Message string
RowsResult []UpdateResultRow
}
func DapsUpdate ¶
func DapsUpdate(connName, querySql string) (updateResult UpdateResult, err error)
type UpdateResultRow ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.









