Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit f5caf7e

Browse files
committed
Add test for Gorm
1 parent a813607 commit f5caf7e

File tree

6 files changed

+746
-0
lines changed

6 files changed

+746
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module gormtest
2+
3+
go 1.14
4+
5+
require (
6+
github.com/jinzhu/gorm v1.9.15
7+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
| gorm.go:15:11:15:19 | untrusted |
2+
| gorm.go:16:9:16:17 | untrusted |
3+
| gorm.go:17:11:17:19 | untrusted |
4+
| gorm.go:18:8:18:16 | untrusted |
5+
| gorm.go:19:12:19:20 | untrusted |
6+
| gorm.go:20:11:20:19 | untrusted |
7+
| gorm.go:21:11:21:19 | untrusted |
8+
| gorm.go:22:12:22:20 | untrusted |
9+
| gorm.go:23:11:23:19 | untrusted |
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package gormtest
2+
3+
import (
4+
"github.com/jinzhu/gorm"
5+
)
6+
7+
func getUntrustedString() string {
8+
return "trouble"
9+
}
10+
11+
func main() {
12+
13+
db := gorm.DB{}
14+
untrusted := getUntrustedString()
15+
db.Where(untrusted)
16+
db.Not(untrusted)
17+
db.Order(untrusted)
18+
db.Or(untrusted)
19+
db.Select(untrusted)
20+
db.Table(untrusted)
21+
db.Group(untrusted)
22+
db.Having(untrusted)
23+
db.Joins(untrusted)
24+
25+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import go
2+
3+
from SQL::QueryString qs
4+
select qs

0 commit comments

Comments
 (0)