-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/oracle #1869
Feature/oracle #1869
Conversation
Oracle driver can only run above go 1.17
Codecov Report
@@ Coverage Diff @@
## master #1869 +/- ##
==========================================
- Coverage 73.24% 73.23% -0.02%
==========================================
Files 503 503
Lines 45392 45479 +87
==========================================
+ Hits 33249 33305 +56
- Misses 10116 10143 +27
- Partials 2027 2031 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
contrib/drivers/mssql/mssql.go
Outdated
fields[m["Field"].String()] = &gdb.TableField{ | ||
Index: i, | ||
Name: m["Field"].String(), | ||
Type: m["Type"].String(), | ||
Null: m["Null"].Bool(), | ||
Null: isNull, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用m["Null"].Bool()
会有什么问题吗?
contrib/drivers/oracle/oracle.go
Outdated
if reflect.TypeOf(v).Kind() == reflect.String { | ||
valueStr := gconv.String(v) | ||
if gregex.IsMatchString(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$`, valueStr) { | ||
// args[i] = fmt.Sprintf(`TO_DATE('%s','yyyy-MM-dd HH:MI:SS')`, valueStr) | ||
args[i], _ = time.ParseInLocation("2006-01-02 15:04:05", valueStr, time.Local) | ||
} | ||
} | ||
} | ||
}*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果确定不需要,那么请删除,而不是注释。
Name: strings.ToLower(m["FIELD"].String()), | ||
Type: strings.ToLower(m["TYPE"].String()), | ||
Name: m["FIELD"].String(), | ||
Type: m["TYPE"].String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
拿不到Comment
等其他信息吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个表里查不到
gtest.AssertEQ(ok, true) | ||
|
||
gtest.AssertEQ(res[k].Name, k) | ||
gtest.Assert(res[k].Type, v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
少了其他属性的断言,拿不到其他信息吗?
func TestFilteredLink(t *testing.T) { | ||
gtest.C(t, func(t *gtest.T) { | ||
s := db.FilteredLink() | ||
gtest.AssertEQ(s, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缺少Link
配置,以便使得FilteredLink
方法生效,这样才能返回结果,再执行断言。
gtest.C(t, func(t *gtest.T) { | ||
_, err := dbErr.Query(ctx, "select 1 from dual") | ||
gtest.AssertNE(err, nil) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于FilteredLink
方法的单例来讲,这两个SELECT
的case似乎没什么意义?
} | ||
}) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个只是个工具方法,并不是单测,并且不能和上面的单测原子执行。
写单测,需要保证单测的每个case结束完毕后,不会污染环境。
如果oracle有默认生成的日志文件的话,建议通过配置取消掉。
1.更换oracle驱动
2. 增加oracle单元测试
3. 修改mssql单元测试
4. ci中增加oracle镜像,oracle driver只在1.17上执行