From a3412d6ba6cfdd5b11353072c6d29824f7be386d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 3 Feb 2019 18:56:45 +0800 Subject: [PATCH] add oracle tests --- dialects/oracle.go | 2 +- oracle_test.go | 11 +++++++++++ test_oracle.sh | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 oracle_test.go create mode 100755 test_oracle.sh diff --git a/dialects/oracle.go b/dialects/oracle.go index 2620b0bb..d3c889d7 100644 --- a/dialects/oracle.go +++ b/dialects/oracle.go @@ -690,7 +690,7 @@ func (db *oracle) GetColumns(queryer core.Queryer, ctx context.Context, tableNam col.SQLType = schemas.SQLType{Name: schemas.TimeStampz, DefaultLength: 0, DefaultLength2: 0} case "NUMBER": col.SQLType = schemas.SQLType{Name: schemas.Double, DefaultLength: len1, DefaultLength2: len2} - case "LONG", "LONG RAW": + case "LONG", "LONG RAW", "NCLOB", "CLOB": col.SQLType = schemas.SQLType{Name: schemas.Text, DefaultLength: 0, DefaultLength2: 0} case "RAW": col.SQLType = schemas.SQLType{Name: schemas.Binary, DefaultLength: 0, DefaultLength2: 0} diff --git a/oracle_test.go b/oracle_test.go new file mode 100644 index 00000000..ccebd965 --- /dev/null +++ b/oracle_test.go @@ -0,0 +1,11 @@ +// Copyright 20190 The Xorm Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build oracle + +package xorm + +import ( + _ "github.com/mattn/go-oci8" +) diff --git a/test_oracle.sh b/test_oracle.sh new file mode 100755 index 00000000..56bd4609 --- /dev/null +++ b/test_oracle.sh @@ -0,0 +1 @@ +go test -tags=oracle -db=oci8 -conn_str="system/oracle@localhost:1521/xe" \ No newline at end of file