-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(contrib/drivers/dm): add WherePri support
#4157
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
03179f2
fix The Dameng(DM) database supports the WherePri method.
tiger1103 8f44ff0
Merge branch 'gogf:master' into master
tiger1103 aff1560
Apply gci import order changes
github-actions[bot] 0021a18
Merge branch 'master' into master
gqcn 9c4b5e4
fix Add quotes to table names and field names in sql statements
tiger1103 0eb8039
Merge branch 'gogf:master' into master
tiger1103 942c1ce
Merge branch 'gogf:master' into master
tiger1103 cef7580
Merge branch 'gogf:master' into master
tiger1103 bb776a8
fix DM database unit test TestTableFields method
tiger1103 3923bab
add DM Database WherePri unit test
tiger1103 2d0ae31
Merge branch 'gogf:master' into master
tiger1103 56c6449
Merge branch 'gogf:master' into master
tiger1103 28a65dd
fix DM Database WherePri unit test and merge pr #4293 support get tab…
tiger1103 60787de
Apply gci import order changes
github-actions[bot] f587eec
add DM Database get table comments unit test
tiger1103 9ef24aa
fix(dm): 修复创建初始化表时字段名称错误,将“create_time”更正为“created_time”
hailaz 14dd8f5
feat(dm): 添加 createInitTables 函数以简化表初始化过程
hailaz ac4e94a
test(dm): 尝试恢复
hailaz 6e0125a
add DM Database unit test tableName,When comparing table names, alway…
tiger1103 ef6820e
fix remove err execute sql test CI
tiger1103 04447c5
Merge branch 'master' into master
hailaz b2adf77
Merge branch 'master' into master
hailaz 30da11a
fix(contrib/drivers/dm): improve SQL queries and enhance unit tests f…
hailaz 623c682
fix(contrib/drivers/dm): enhance SQL injection prevention by escaping…
hailaz 6f6a701
fix(contrib/drivers/dm): update table field comment for ACCOUNT_NAME …
hailaz 6fde455
fix(dm): update comments for escapeSingleQuote function and improve t…
hailaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved. | ||
| // | ||
| // This Source Code Form is subject to the terms of the MIT License. | ||
| // If a copy of the MIT was not distributed with this file, | ||
| // You can obtain one at https://github.com/gogf/gf. | ||
|
|
||
| package dm_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/gogf/gf/v2/test/gtest" | ||
| ) | ||
|
|
||
| // PR #4157 WherePri | ||
| func Test_WherePri_PR4157(t *testing.T) { | ||
| tableName := "A_tables" | ||
| createInitTable(tableName) | ||
| defer dropTable(tableName) | ||
| gtest.C(t, func(t *gtest.T) { | ||
| var resOne *User | ||
| err := db.Model(tableName).WherePri(1).Scan(&resOne) | ||
| t.AssertNil(err) | ||
| t.AssertNQ(resOne, nil) | ||
| t.AssertEQ(resOne.ID, int64(1)) | ||
| }) | ||
| } | ||
|
|
||
| // PR #4157 get table field comments | ||
| func Test_TableFields_Comment_PR4157(t *testing.T) { | ||
| tableName := "A_tables" | ||
| schema := "SYSDBA" | ||
| createInitTable(tableName) | ||
| defer dropTable(tableName) | ||
| gtest.C(t, func(t *gtest.T) { | ||
| fields, err := db.Model().TableFields(tableName, schema) | ||
| t.AssertNil(err) | ||
| t.AssertEQ(fields["ACCOUNT_NAME"].Comment, "Account Name") | ||
| }) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.