-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pshapovalov
committed
Mar 10, 2024
1 parent
e5ead01
commit 37583a3
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,62 @@ | ||
package mock | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/jackc/pgx/v5" | ||
"github.com/jackc/pgx/v5/pgconn" | ||
) | ||
|
||
type Pgtx struct{} | ||
|
||
// Conn implements pgx.Tx. | ||
func (p *Pgtx) Conn() *pgx.Conn { | ||
panic("unimplemented") | ||
} | ||
|
||
// CopyFrom implements pgx.Tx. | ||
func (p *Pgtx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// Exec implements pgx.Tx. | ||
func (p *Pgtx) Exec(ctx context.Context, sql string, arguments ...any) (commandTag pgconn.CommandTag, err error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// LargeObjects implements pgx.Tx. | ||
func (p *Pgtx) LargeObjects() pgx.LargeObjects { | ||
panic("unimplemented") | ||
} | ||
|
||
// Prepare implements pgx.Tx. | ||
func (p *Pgtx) Prepare(ctx context.Context, name string, sql string) (*pgconn.StatementDescription, error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// Query implements pgx.Tx. | ||
func (p *Pgtx) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// QueryRow implements pgx.Tx. | ||
func (p *Pgtx) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row { | ||
panic("unimplemented") | ||
} | ||
|
||
// SendBatch implements pgx.Tx. | ||
func (p *Pgtx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults { | ||
panic("unimplemented") | ||
} | ||
|
||
func (*Pgtx) Commit(context.Context) error { | ||
return nil | ||
} | ||
|
||
func (*Pgtx) Rollback(context.Context) error { | ||
return nil | ||
} | ||
|
||
func (*Pgtx) Begin(context.Context) (pgx.Tx, error) { | ||
return &Pgtx{}, nil | ||
} |