diff --git a/chain.go b/chain.go index f0ea72e..969a648 100644 --- a/chain.go +++ b/chain.go @@ -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