From 880a7b297dce5cec3fb71b06f62c88db127c66a3 Mon Sep 17 00:00:00 2001 From: chendy Date: Mon, 24 Jan 2022 12:48:25 +0800 Subject: [PATCH] =?UTF-8?q?oracle=E6=95=B0=E6=8D=AE=E5=BA=93=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E6=8B=BC=E6=8E=A5AS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dialects/table_name.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dialects/table_name.go b/dialects/table_name.go index 48b44de2..d314fe80 100644 --- a/dialects/table_name.go +++ b/dialects/table_name.go @@ -29,6 +29,9 @@ func TableNameNoSchema(dialect Dialect, mapper names.Mapper, tableName interface switch tt := tableName.(type) { case []string: if len(tt) > 1 { + if dialect.URI().DBType == schemas.ORACLE { + return fmt.Sprintf("%v %v", quote(tt[0]), quote(tt[1])) + } return fmt.Sprintf("%v AS %v", quote(tt[0]), quote(tt[1])) } else if len(tt) == 1 { return quote(tt[0]) @@ -54,6 +57,9 @@ func TableNameNoSchema(dialect Dialect, mapper names.Mapper, tableName interface } } if l > 1 { + if dialect.URI().DBType == schemas.ORACLE { + return fmt.Sprintf("%v %v", quote(table), quote(fmt.Sprintf("%v", tt[1]))) + } return fmt.Sprintf("%v AS %v", quote(table), quote(fmt.Sprintf("%v", tt[1]))) } else if l == 1 { return quote(table)