mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Add Ormer models for v1 of the beego ORM
This commit is contained in:
@@ -20,6 +20,9 @@ extensions:
|
||||
- ["group:beego-orm", "DQL", True, "ReadForUpdateWithCtx", "", "", "Argument[1]", "database", "manual"]
|
||||
- ["group:beego-orm", "DQL", True, "ReadOrCreate", "", "", "Argument[0]", "database", "manual"]
|
||||
- ["group:beego-orm", "DQL", True, "ReadOrCreateWithCtx", "", "", "Argument[1]", "database", "manual"]
|
||||
- ["group:beego-orm", "Ormer", True, "Read", "", "", "Argument[0]", "database", "manual"]
|
||||
- ["group:beego-orm", "Ormer", True, "ReadForUpdate", "", "", "Argument[0]", "database", "manual"]
|
||||
- ["group:beego-orm", "Ormer", True, "ReadOrCreate", "", "", "Argument[0]", "database", "manual"]
|
||||
- addsTo:
|
||||
pack: codeql/go-all
|
||||
extensible: sinkModel
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
oldOrm "github.com/astaxie/beego/orm"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
@@ -18,6 +19,13 @@ func test_DB(db orm.DB) {
|
||||
ignore(row)
|
||||
}
|
||||
|
||||
func test_Ormer() {
|
||||
o := oldOrm.NewOrm()
|
||||
o.Read(&User{}) // $ source
|
||||
o.ReadForUpdate(&User{}) // $ source
|
||||
o.ReadOrCreate(&User{}, "name") // $ source
|
||||
}
|
||||
|
||||
func test_DQL() {
|
||||
o := orm.NewOrm()
|
||||
o.Read(&User{}) // $ source
|
||||
|
||||
150
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/astaxie/beego/orm/stub.go
generated
vendored
Normal file
150
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/astaxie/beego/orm/stub.go
generated
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
// Code generated by depstubber. DO NOT EDIT.
|
||||
// This is a simple stub for github.com/astaxie/beego/orm, strictly for use in testing.
|
||||
|
||||
// See the LICENSE file for information about the licensing of the original library.
|
||||
// Source: github.com/astaxie/beego/orm (exports: Ormer; functions: NewOrm)
|
||||
|
||||
// Package orm is a stub of github.com/astaxie/beego/orm, generated by depstubber.
|
||||
package orm
|
||||
|
||||
import (
|
||||
context "context"
|
||||
sql "database/sql"
|
||||
)
|
||||
|
||||
type Condition struct{}
|
||||
|
||||
func (_ Condition) And(_ string, _ ...interface{}) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ Condition) AndNot(_ string, _ ...interface{}) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ Condition) Or(_ string, _ ...interface{}) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ Condition) OrNot(_ string, _ ...interface{}) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ Condition) Raw(_ string, _ string) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ *Condition) AndCond(_ *Condition) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ *Condition) AndNotCond(_ *Condition) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ *Condition) IsEmpty() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (_ *Condition) OrCond(_ *Condition) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ *Condition) OrNotCond(_ *Condition) *Condition {
|
||||
return nil
|
||||
}
|
||||
|
||||
type Driver interface {
|
||||
Name() string
|
||||
Type() DriverType
|
||||
}
|
||||
|
||||
type DriverType int
|
||||
|
||||
type Inserter interface {
|
||||
Close() error
|
||||
Insert(_ interface{}) (int64, error)
|
||||
}
|
||||
|
||||
func NewOrm() Ormer {
|
||||
return nil
|
||||
}
|
||||
|
||||
type Ormer interface {
|
||||
Begin() error
|
||||
BeginTx(_ context.Context, _ *sql.TxOptions) error
|
||||
Commit() error
|
||||
DBStats() *sql.DBStats
|
||||
Delete(_ interface{}, _ ...string) (int64, error)
|
||||
Driver() Driver
|
||||
Insert(_ interface{}) (int64, error)
|
||||
InsertMulti(_ int, _ interface{}) (int64, error)
|
||||
InsertOrUpdate(_ interface{}, _ ...string) (int64, error)
|
||||
LoadRelated(_ interface{}, _ string, _ ...interface{}) (int64, error)
|
||||
QueryM2M(_ interface{}, _ string) QueryM2Mer
|
||||
QueryTable(_ interface{}) QuerySeter
|
||||
Raw(_ string, _ ...interface{}) RawSeter
|
||||
Read(_ interface{}, _ ...string) error
|
||||
ReadForUpdate(_ interface{}, _ ...string) error
|
||||
ReadOrCreate(_ interface{}, _ string, _ ...string) (bool, int64, error)
|
||||
Rollback() error
|
||||
Update(_ interface{}, _ ...string) (int64, error)
|
||||
Using(_ string) error
|
||||
}
|
||||
|
||||
type Params map[string]interface{}
|
||||
|
||||
type ParamsList []interface{}
|
||||
|
||||
type QueryM2Mer interface {
|
||||
Add(_ ...interface{}) (int64, error)
|
||||
Clear() (int64, error)
|
||||
Count() (int64, error)
|
||||
Exist(_ interface{}) bool
|
||||
Remove(_ ...interface{}) (int64, error)
|
||||
}
|
||||
|
||||
type QuerySeter interface {
|
||||
All(_ interface{}, _ ...string) (int64, error)
|
||||
Count() (int64, error)
|
||||
Delete() (int64, error)
|
||||
Distinct() QuerySeter
|
||||
Exclude(_ string, _ ...interface{}) QuerySeter
|
||||
Exist() bool
|
||||
Filter(_ string, _ ...interface{}) QuerySeter
|
||||
FilterRaw(_ string, _ string) QuerySeter
|
||||
ForUpdate() QuerySeter
|
||||
GetCond() *Condition
|
||||
GroupBy(_ ...string) QuerySeter
|
||||
Limit(_ interface{}, _ ...interface{}) QuerySeter
|
||||
Offset(_ interface{}) QuerySeter
|
||||
One(_ interface{}, _ ...string) error
|
||||
OrderBy(_ ...string) QuerySeter
|
||||
PrepareInsert() (Inserter, error)
|
||||
RelatedSel(_ ...interface{}) QuerySeter
|
||||
RowsToMap(_ *Params, _ string, _ string) (int64, error)
|
||||
RowsToStruct(_ interface{}, _ string, _ string) (int64, error)
|
||||
SetCond(_ *Condition) QuerySeter
|
||||
Update(_ Params) (int64, error)
|
||||
Values(_ *[]Params, _ ...string) (int64, error)
|
||||
ValuesFlat(_ *ParamsList, _ string) (int64, error)
|
||||
ValuesList(_ *[]ParamsList, _ ...string) (int64, error)
|
||||
}
|
||||
|
||||
type RawPreparer interface {
|
||||
Close() error
|
||||
Exec(_ ...interface{}) (sql.Result, error)
|
||||
}
|
||||
|
||||
type RawSeter interface {
|
||||
Exec() (sql.Result, error)
|
||||
Prepare() (RawPreparer, error)
|
||||
QueryRow(_ ...interface{}) error
|
||||
QueryRows(_ ...interface{}) (int64, error)
|
||||
RowsToMap(_ *Params, _ string, _ string) (int64, error)
|
||||
RowsToStruct(_ interface{}, _ string, _ string) (int64, error)
|
||||
SetArgs(_ ...interface{}) RawSeter
|
||||
Values(_ *[]Params, _ ...string) (int64, error)
|
||||
ValuesFlat(_ *ParamsList, _ ...string) (int64, error)
|
||||
ValuesList(_ *[]ParamsList, _ ...string) (int64, error)
|
||||
}
|
||||
Reference in New Issue
Block a user