add oracle tests

This commit is contained in:
Lunny Xiao 2019-02-03 18:56:45 +08:00
parent 34dc7f8791
commit a3412d6ba6
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
3 changed files with 13 additions and 1 deletions

View File

@ -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} col.SQLType = schemas.SQLType{Name: schemas.TimeStampz, DefaultLength: 0, DefaultLength2: 0}
case "NUMBER": case "NUMBER":
col.SQLType = schemas.SQLType{Name: schemas.Double, DefaultLength: len1, DefaultLength2: len2} 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} col.SQLType = schemas.SQLType{Name: schemas.Text, DefaultLength: 0, DefaultLength2: 0}
case "RAW": case "RAW":
col.SQLType = schemas.SQLType{Name: schemas.Binary, DefaultLength: 0, DefaultLength2: 0} col.SQLType = schemas.SQLType{Name: schemas.Binary, DefaultLength: 0, DefaultLength2: 0}

11
oracle_test.go Normal file
View File

@ -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"
)

1
test_oracle.sh Executable file
View File

@ -0,0 +1 @@
go test -tags=oracle -db=oci8 -conn_str="system/oracle@localhost:1521/xe"