From 155e124c631d7366fe76e2f424b4d8cbee17fb8e Mon Sep 17 00:00:00 2001 From: zhenghaorong Date: Tue, 11 Oct 2022 11:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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