sqladvisor

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advise

func Advise(c *gin.Context)

@Tags sqladvisor @Summary get advice @Accept application/json @Param token body string true "token" @Param db_id body int true "db id" @Param sql_text body string true "sql text" @Param login_name body string true "account name or employee id" @Produce application/json @Success 200 {string} string "{"ID": "B95017DB61875675", "Fingerprint": "select * from t_meta_db_info where create_time<?", "Score": 85, "Sample": "select * from t_meta_db_info where create_time<'2021-01-01'", "Explain": null, "HeuristicRules": [{"Item": "COL.001", "Severity": "L1", "Summary": "不建议使用 SELECT * 类型查询", "Content": "当表结构变更时,使用 * 通配符选择所有列将导致查询的含义和行为会发生更改,可能导致查询返回更多的数据。", "Case": "select * from tbl where id=1", "Position": 0}], "IndexRules": [{"Item": "IDX.001", "Severity": "L2", "Summary": "为das库的t_meta_db_info表添加索引", "Content": "为列create_time添加索引; 由于未开启数据采样,各列在索引中的顺序需要自行调整。", "Case": "ALTER TABLE `das`.`t_meta_db_info` add index `idx_create_time` (`create_time`) ; ", "Position": 0}], "Tables": ["`soar`.`t_meta_db_info`"]}" @Router /api/v1/sqladvisor/advise [post]

func GetFingerprint

func GetFingerprint(c *gin.Context)

@Tags sqladvisor @Summary get sql fingerprint @Accept application/json @Param token body string true "token" @Param sql_text body string true "sql text" @Produce application/json @Success 200 {string} string "{"fingerprint":"select * from a","sql_text":"select * from a;"}" @Router /api/v1/sqladvisor/fingerprint [post]

func GetSQLID

func GetSQLID(c *gin.Context)

@Tags sqladvisor @Summary get sql id @Accept application/json @Param token body string true "token" @Param sql_text body string true "sql text" @Produce application/json @Success 200 {string} string "{"sql_id":"EE56B94E867DC9D5","sql_text":"select * from a;"}" @Router /api/v1/sqladvisor/sql-id [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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