2
0

Use pgconn.PreparedStatementDescription directly

Instead of having similar pgx.PreparedStatement
This commit is contained in:
Jack Christensen
2019-08-24 14:29:05 -05:00
parent 6972a57421
commit 31705e586a
5 changed files with 38 additions and 66 deletions
+3 -3
View File
@@ -95,7 +95,7 @@ type Tx interface {
SendBatch(ctx context.Context, b *Batch) BatchResults
LargeObjects() LargeObjects
Prepare(ctx context.Context, name, sql string) (*PreparedStatement, error)
Prepare(ctx context.Context, name, sql string) (*pgconn.PreparedStatementDescription, error)
Exec(ctx context.Context, sql string, arguments ...interface{}) (commandTag pgconn.CommandTag, err error)
Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
@@ -174,7 +174,7 @@ func (tx *dbTx) Exec(ctx context.Context, sql string, arguments ...interface{})
}
// Prepare delegates to the underlying *Conn
func (tx *dbTx) Prepare(ctx context.Context, name, sql string) (*PreparedStatement, error) {
func (tx *dbTx) Prepare(ctx context.Context, name, sql string) (*pgconn.PreparedStatementDescription, error) {
if tx.closed {
return nil, ErrTxClosed
}
@@ -264,7 +264,7 @@ func (sp *dbSavepoint) Exec(ctx context.Context, sql string, arguments ...interf
}
// Prepare delegates to the underlying Tx
func (sp *dbSavepoint) Prepare(ctx context.Context, name, sql string) (*PreparedStatement, error) {
func (sp *dbSavepoint) Prepare(ctx context.Context, name, sql string) (*pgconn.PreparedStatementDescription, error) {
if sp.closed {
return nil, ErrTxClosed
}