From 2d94f24f43071f5aa62d73e4867005ec7f782c93 Mon Sep 17 00:00:00 2001 From: zhenghaorong Date: Tue, 24 Sep 2024 11:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djoin=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BD=BF=E7=94=A8with=E4=B8=B4=E6=97=B6=E8=A1=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chain.go | 2 ++ db.go | 4 ++++ transaction_chain.go | 2 ++ 3 files changed, 8 insertions(+) diff --git a/chain.go b/chain.go index 3ddeb8a..8bc4367 100644 --- a/chain.go +++ b/chain.go @@ -291,6 +291,7 @@ func (this *Query) BuildSelectSql() (map[string]interface{}, error) { withSql := "" if len(this.with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range this.with { @@ -351,6 +352,7 @@ func (this *Query) BuildSelectSql() (map[string]interface{}, error) { if len(this.join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range this.join { if len(joinitem) < 2 { continue diff --git a/db.go b/db.go index 43c7340..32d6c77 100644 --- a/db.go +++ b/db.go @@ -307,6 +307,7 @@ func GetRow(dbName, table_name, alias string, titles string, with, join [][]stri withSql := "" if len(with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range with { @@ -353,6 +354,7 @@ func GetRow(dbName, table_name, alias string, titles string, with, join [][]stri if len(join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range join { if len(joinitem) < 2 { continue @@ -496,6 +498,7 @@ func FetchRows(dbName, table_name, alias string, titles string, with, join [][]s withSql := "" if len(with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range with { @@ -543,6 +546,7 @@ func FetchRows(dbName, table_name, alias string, titles string, with, join [][]s if len(join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range join { if len(joinitem) < 2 { continue diff --git a/transaction_chain.go b/transaction_chain.go index d73b639..9686a04 100644 --- a/transaction_chain.go +++ b/transaction_chain.go @@ -225,6 +225,7 @@ func (this *TxQuery) BuildSelectSql() (map[string]interface{}, error) { withSql := "" if len(this.with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range this.with { @@ -269,6 +270,7 @@ func (this *TxQuery) BuildSelectSql() (map[string]interface{}, error) { if len(this.join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range this.join { if len(joinitem) < 2 { continue