File tree Expand file tree Collapse file tree 1 file changed +0
-45
lines changed
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database Expand file tree Collapse file tree 1 file changed +0
-45
lines changed Original file line number Diff line number Diff line change @@ -2,40 +2,15 @@ package test
22
33import (
44 "context"
5- "database/sql"
65 "fmt"
76
87 beegoOrm "github.com/beego/beego/orm"
98 gocb "github.com/couchbase/gocb/v2"
109 "github.com/gogf/gf/database/gdb"
11- "github.com/jmoiron/sqlx"
1210 "github.com/rqlite/gorqlite"
1311 "go.mongodb.org/mongo-driver/mongo"
14- "gorm.io/gorm"
1512)
1613
17- func stdlib () {
18- pool , err := sql .Open ("mysql" , "user:password@localhost:5555/dbname" )
19- if err != nil {
20- return
21- }
22-
23- row := pool .QueryRow ("SELECT * FROM users WHERE id = ?" , 1 ) // $source
24- fmt .Println (row )
25- }
26-
27- func gormDB (db * gorm.DB ) {
28- type User struct {
29- gorm.Model
30- }
31-
32- var u1 User
33- var u2 User
34-
35- db .Find (& u1 , 1 ) // $source
36- db .FirstOrCreate (& u2 , 1 ) // $source
37- }
38-
3914func mongoDB (ctx context.Context , userCollection mongo.Collection ) {
4015 type User struct {
4116 }
@@ -58,26 +33,6 @@ func gogf(g gdb.DB) {
5833 fmt .Println (u1 )
5934}
6035
61- func Sqlx () {
62- db , err := sqlx .Connect ("mysql" , "user:password@localhost:5555/dbname" )
63-
64- if err != nil {
65- return
66- }
67-
68- u1 := db .QueryRow ("SELECT * FROM users WHERE id = ?" , 1 ) // $source
69-
70- fmt .Println (u1 )
71-
72- type User struct {}
73-
74- rows , err := db .Queryx ("SELECT * FROM users" ) // $source
75- for rows .Next () {
76- var user User
77- rows .StructScan (& user )
78- }
79- }
80-
8136func beego () {
8237 orm := beegoOrm .NewOrm ()
8338
You can’t perform that action at this time.
0 commit comments