update tests and stubs

This commit is contained in:
Alvaro Muñoz
2023-07-12 22:21:49 +02:00
parent 300584c4bb
commit 4b85d54089
3 changed files with 567 additions and 15 deletions

View File

@@ -1,10 +1,20 @@
| go-pg.go:37:22:37:30 | untrusted | github.com/go-pg/pg/v10 | Conn | ExecContext |
| go-pg.go:37:22:37:30 | untrusted | github.com/go-pg/pg/v10 | DB | ExecContext |
| go-pg.go:37:22:37:30 | untrusted | github.com/go-pg/pg/v10 | baseDB | ExecContext |
| go-pg.go:38:45:38:53 | untrusted | github.com/go-pg/pg/v10 | Conn | QueryOneContext |
| go-pg.go:38:45:38:53 | untrusted | github.com/go-pg/pg/v10 | DB | QueryOneContext |
| go-pg.go:38:45:38:53 | untrusted | github.com/go-pg/pg/v10 | baseDB | QueryOneContext |
| go-pg.go:42:14:42:22 | untrusted | github.com/go-pg/pg/v10/orm | Query | ColumnExpr |
| go-pg.go:43:8:43:16 | untrusted | github.com/go-pg/pg/v10/orm | Query | Join |
| go-pg.go:44:9:44:17 | untrusted | github.com/go-pg/pg/v10/orm | Query | Where |
| go-pg.go:45:13:45:21 | untrusted | github.com/go-pg/pg/v10/orm | Query | OrderExpr |
| go-pg.go:38:10:38:18 | untrusted | github.com/go-pg/pg/v10 | DB | Exec |
| go-pg.go:39:13:39:21 | untrusted | github.com/go-pg/pg/v10 | DB | ExecOne |
| go-pg.go:40:13:40:21 | untrusted | github.com/go-pg/pg/v10 | DB | Prepare |
| go-pg.go:42:22:42:30 | untrusted | github.com/go-pg/pg/v10 | DB | ExecContext |
| go-pg.go:43:25:43:33 | untrusted | github.com/go-pg/pg/v10 | DB | ExecOneContext |
| go-pg.go:44:21:44:29 | untrusted | github.com/go-pg/pg/v10 | DB | Query |
| go-pg.go:45:24:45:32 | untrusted | github.com/go-pg/pg/v10 | DB | QueryOne |
| go-pg.go:47:45:47:53 | untrusted | github.com/go-pg/pg/v10 | DB | QueryOneContext |
| go-pg.go:48:33:48:41 | untrusted | github.com/go-pg/pg/v10 | DB | QueryContext |
| go-pg.go:52:14:52:22 | untrusted | github.com/go-pg/pg/v10/orm | Query | ColumnExpr |
| go-pg.go:53:8:53:16 | untrusted | github.com/go-pg/pg/v10/orm | Query | Join |
| go-pg.go:54:9:54:17 | untrusted | github.com/go-pg/pg/v10/orm | Query | Where |
| go-pg.go:55:13:55:21 | untrusted | github.com/go-pg/pg/v10/orm | Query | OrderExpr |
| go-pg.go:56:13:56:21 | untrusted | github.com/go-pg/pg/v10/orm | Query | GroupExpr |
| go-pg.go:57:13:57:21 | untrusted | github.com/go-pg/pg/v10/orm | Query | TableExpr |
| go-pg.go:58:11:58:19 | untrusted | github.com/go-pg/pg/v10/orm | Query | WhereIn |
| go-pg.go:59:16:59:24 | untrusted | github.com/go-pg/pg/v10/orm | Query | WhereInMulti |
| go-pg.go:60:11:60:19 | untrusted | github.com/go-pg/pg/v10/orm | Query | WhereOr |
| go-pg.go:61:7:61:15 | untrusted | github.com/go-pg/pg/v10/orm | Query | For |
| go-pg.go:62:10:62:18 | untrusted | github.com/go-pg/pg/v10/orm | Query | Having |

View File

@@ -0,0 +1,537 @@
// Code generated by depstubber. DO NOT EDIT.
// This is a simple stub for github.com/go-pg/pg/v10/orm, strictly for use in testing.
// See the LICENSE file for information about the licensing of the original library.
// Source: github.com/go-pg/pg/v10/orm (exports: Query; functions: )
// Package orm is a stub of github.com/go-pg/pg/v10/orm, generated by depstubber.
package orm
import (
context "context"
io "io"
reflect "reflect"
)
type ColumnScanner interface {
ScanColumn(_ interface{}, _ interface{}, _ int) error
}
type CreateCompositeOptions struct {
Varchar int
}
type CreateTableOptions struct {
Varchar int
Temp bool
IfNotExists bool
FKConstraints bool
}
type DB interface {
Context() context.Context
CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (Result, error)
CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (Result, error)
Exec(_ interface{}, _ ...interface{}) (Result, error)
ExecContext(_ context.Context, _ interface{}, _ ...interface{}) (Result, error)
ExecOne(_ interface{}, _ ...interface{}) (Result, error)
ExecOneContext(_ context.Context, _ interface{}, _ ...interface{}) (Result, error)
Formatter() QueryFormatter
Model(_ ...interface{}) *Query
ModelContext(_ context.Context, _ ...interface{}) *Query
Query(_ interface{}, _ interface{}, _ ...interface{}) (Result, error)
QueryContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (Result, error)
QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (Result, error)
QueryOneContext(_ context.Context, _ interface{}, _ interface{}, _ ...interface{}) (Result, error)
}
type DropCompositeOptions struct {
IfExists bool
Cascade bool
}
type DropTableOptions struct {
IfExists bool
Cascade bool
}
type Field struct {
Field reflect.StructField
Type reflect.Type
Index []int
GoName string
SQLName string
Column interface{}
SQLType string
UserSQLType string
Default interface{}
OnDelete string
OnUpdate string
}
func (_ *Field) AppendValue(_ []byte, _ reflect.Value, _ int) []byte {
return nil
}
func (_ *Field) Clone() *Field {
return nil
}
func (_ *Field) HasZeroValue(_ reflect.Value) bool {
return false
}
func (_ *Field) NullZero() bool {
return false
}
func (_ *Field) ScanValue(_ reflect.Value, _ interface{}, _ int) error {
return nil
}
func (_ *Field) Value(_ reflect.Value) reflect.Value {
return reflect.Value{}
}
type Method struct {
Index int
}
func (_ *Method) AppendValue(_ []byte, _ reflect.Value, _ int) []byte {
return nil
}
func (_ *Method) Has(_ int8) bool {
return false
}
func (_ *Method) Value(_ reflect.Value) reflect.Value {
return reflect.Value{}
}
type Model interface {
AddColumnScanner(_ ColumnScanner) error
AfterDelete(_ context.Context) error
AfterInsert(_ context.Context) error
AfterScan(_ context.Context) error
AfterSelect(_ context.Context) error
AfterUpdate(_ context.Context) error
BeforeDelete(_ context.Context) (context.Context, error)
BeforeInsert(_ context.Context) (context.Context, error)
BeforeUpdate(_ context.Context) (context.Context, error)
Init() error
NextColumnScanner() ColumnScanner
}
type Query struct{}
func (_ *Query) AllWithDeleted() *Query {
return nil
}
func (_ *Query) AppendQuery(_ QueryFormatter, _ []byte) ([]byte, error) {
return nil, nil
}
func (_ *Query) Apply(_ func(*Query) (*Query, error)) *Query {
return nil
}
func (_ *Query) Clone() *Query {
return nil
}
func (_ *Query) Column(_ ...string) *Query {
return nil
}
func (_ *Query) ColumnExpr(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Context(_ context.Context) *Query {
return nil
}
func (_ *Query) CopyFrom(_ io.Reader, _ interface{}, _ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) CopyTo(_ io.Writer, _ interface{}, _ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Count() (int, error) {
return 0, nil
}
func (_ *Query) CountEstimate(_ int) (int, error) {
return 0, nil
}
func (_ *Query) CreateComposite(_ *CreateCompositeOptions) error {
return nil
}
func (_ *Query) CreateTable(_ *CreateTableOptions) error {
return nil
}
func (_ *Query) DB(_ DB) *Query {
return nil
}
func (_ *Query) Delete(_ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Deleted() *Query {
return nil
}
func (_ *Query) Distinct() *Query {
return nil
}
func (_ *Query) DistinctOn(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) DropComposite(_ *DropCompositeOptions) error {
return nil
}
func (_ *Query) DropTable(_ *DropTableOptions) error {
return nil
}
func (_ *Query) Except(_ *Query) *Query {
return nil
}
func (_ *Query) ExceptAll(_ *Query) *Query {
return nil
}
func (_ *Query) ExcludeColumn(_ ...string) *Query {
return nil
}
func (_ *Query) Exec(_ interface{}, _ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) ExecOne(_ interface{}, _ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Exists() (bool, error) {
return false, nil
}
func (_ *Query) First() error {
return nil
}
func (_ *Query) For(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) ForEach(_ interface{}) error {
return nil
}
func (_ *Query) ForceDelete(_ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Group(_ ...string) *Query {
return nil
}
func (_ *Query) GroupExpr(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Having(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Insert(_ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Intersect(_ *Query) *Query {
return nil
}
func (_ *Query) IntersectAll(_ *Query) *Query {
return nil
}
func (_ *Query) Join(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) JoinOn(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) JoinOnOr(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Last() error {
return nil
}
func (_ *Query) Limit(_ int) *Query {
return nil
}
func (_ *Query) Model(_ ...interface{}) *Query {
return nil
}
func (_ *Query) New() *Query {
return nil
}
func (_ *Query) Offset(_ int) *Query {
return nil
}
func (_ *Query) OnConflict(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Order(_ ...string) *Query {
return nil
}
func (_ *Query) OrderExpr(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Query(_ interface{}, _ interface{}, _ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) QueryOne(_ interface{}, _ interface{}, _ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Relation(_ string, _ ...func(*Query) (*Query, error)) *Query {
return nil
}
func (_ *Query) Returning(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Select(_ ...interface{}) error {
return nil
}
func (_ *Query) SelectAndCount(_ ...interface{}) (int, error) {
return 0, nil
}
func (_ *Query) SelectAndCountEstimate(_ int, _ ...interface{}) (int, error) {
return 0, nil
}
func (_ *Query) SelectOrInsert(_ ...interface{}) (bool, error) {
return false, nil
}
func (_ *Query) Set(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Table(_ ...string) *Query {
return nil
}
func (_ *Query) TableExpr(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) TableModel() TableModel {
return nil
}
func (_ *Query) Union(_ *Query) *Query {
return nil
}
func (_ *Query) UnionAll(_ *Query) *Query {
return nil
}
func (_ *Query) Update(_ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) UpdateNotZero(_ ...interface{}) (Result, error) {
return nil, nil
}
func (_ *Query) Value(_ string, _ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) Where(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) WhereGroup(_ func(*Query) (*Query, error)) *Query {
return nil
}
func (_ *Query) WhereIn(_ string, _ interface{}) *Query {
return nil
}
func (_ *Query) WhereInMulti(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) WhereInOr(_ string, _ interface{}) *Query {
return nil
}
func (_ *Query) WhereNotGroup(_ func(*Query) (*Query, error)) *Query {
return nil
}
func (_ *Query) WhereOr(_ string, _ ...interface{}) *Query {
return nil
}
func (_ *Query) WhereOrGroup(_ func(*Query) (*Query, error)) *Query {
return nil
}
func (_ *Query) WhereOrNotGroup(_ func(*Query) (*Query, error)) *Query {
return nil
}
func (_ *Query) WherePK() *Query {
return nil
}
func (_ *Query) With(_ string, _ *Query) *Query {
return nil
}
func (_ *Query) WithDelete(_ string, _ *Query) *Query {
return nil
}
func (_ *Query) WithInsert(_ string, _ *Query) *Query {
return nil
}
func (_ *Query) WithUpdate(_ string, _ *Query) *Query {
return nil
}
func (_ *Query) WrapWith(_ string) *Query {
return nil
}
type QueryFormatter interface {
FormatQuery(_ []byte, _ string, _ ...interface{}) []byte
}
type Relation struct {
Type int
Field *Field
JoinTable *Table
BaseFKs []*Field
JoinFKs []*Field
Polymorphic *Field
M2MTableName interface{}
M2MTableAlias interface{}
M2MBaseFKs []string
M2MJoinFKs []string
}
func (_ *Relation) String() string {
return ""
}
type Result interface {
Model() Model
RowsAffected() int
RowsReturned() int
}
type Table struct {
Type reflect.Type
TypeName string
Alias interface{}
ModelName string
SQLName interface{}
SQLNameForSelects interface{}
Tablespace interface{}
PartitionBy string
Fields []*Field
PKs []*Field
DataFields []*Field
FieldsMap map[string]*Field
Methods map[string]*Method
Relations map[string]*Relation
Unique map[string][]*Field
SoftDeleteField *Field
SetSoftDeleteField func(reflect.Value) error
}
func (_ *Table) AddField(_ *Field) {}
func (_ *Table) AppendParam(_ []byte, _ reflect.Value, _ string) ([]byte, bool) {
return nil, false
}
func (_ *Table) GetField(_ string) (*Field, error) {
return nil, nil
}
func (_ *Table) HasField(_ string) bool {
return false
}
func (_ *Table) RemoveField(_ *Field) {}
func (_ *Table) String() string {
return ""
}
type TableModel interface {
AddColumnScanner(_ ColumnScanner) error
AddJoin(_ interface{}) interface{}
AfterDelete(_ context.Context) error
AfterInsert(_ context.Context) error
AfterScan(_ context.Context) error
AfterSelect(_ context.Context) error
AfterUpdate(_ context.Context) error
AppendParam(_ QueryFormatter, _ []byte, _ string) ([]byte, bool)
BeforeDelete(_ context.Context) (context.Context, error)
BeforeInsert(_ context.Context) (context.Context, error)
BeforeUpdate(_ context.Context) (context.Context, error)
GetJoin(_ string) interface{}
GetJoins() []interface{}
Index() []int
Init() error
IsNil() bool
Join(_ string, _ func(*Query) (*Query, error)) interface{}
Kind() reflect.Kind
Mount(_ reflect.Value)
NextColumnScanner() ColumnScanner
ParentIndex() []int
Relation() *Relation
Root() reflect.Value
Table() *Table
Value() reflect.Value
}

View File

@@ -2,7 +2,7 @@
// This is a simple stub for github.com/go-pg/pg/v10, strictly for use in testing.
// See the LICENSE file for information about the licensing of the original library.
// Source: github.com/go-pg/pg/v10 (exports: DB; functions: Connect)
// Source: github.com/go-pg/pg/v10 (exports: DB; functions: Connect,Scan)
// Package pg is a stub of github.com/go-pg/pg/v10, generated by depstubber.
package pg
@@ -13,6 +13,7 @@ import (
io "io"
net "net"
time "time"
orm "github.com/go-pg/pg/v10/orm"
)
type Conn struct{}
@@ -59,8 +60,8 @@ func (_ Conn) Formatter() interface{} {
return nil
}
func (_ Conn) Model(_ ...interface{}) interface{} {
return nil
func (_ Conn) Model(_ ...interface{}) *orm.Query {
return new(orm.Query)
}
func (_ Conn) ModelContext(_ context.Context, _ ...interface{}) interface{} {
@@ -167,8 +168,8 @@ func (_ DB) Formatter() interface{} {
return nil
}
func (_ DB) Model(_ ...interface{}) interface{} {
return nil
func (_ DB) Model(_ ...interface{}) *orm.Query {
return new(orm.Query)
}
func (_ DB) ModelContext(_ context.Context, _ ...interface{}) interface{} {
@@ -340,6 +341,10 @@ type QueryHook interface {
BeforeQuery(_ context.Context, _ *QueryEvent) (context.Context, error)
}
func Scan(_ ...interface{}) interface{} {
return nil
}
type Stmt struct{}
func (_ *Stmt) Close() error {