Browse Source

增加查询表格信息

master v0.9.13
zhenghaorong 1 year ago
parent
commit
155e124c63
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      chain.go

+ 3
- 1
chain.go View File

@ -190,7 +190,9 @@ func (this *Query) GetTableInfo(table string) (map[string]interface{}, error) {
"IS_NULLABLE", //是否为空
}
sql := "select `" + strings.Join(field, "`,`") + "` from information_schema.COLUMNS where table_name = ? and table_schema = ?"
if this.conn == nil {
this.conn = DB
}
stmtSql, err := this.conn.Prepare(sql)
if err != nil {
return nil, err


Loading…
Cancel
Save