2
0

Refactor pgio and types to append buffers

This commit is contained in:
Jack Christensen
2017-05-02 20:38:26 -05:00
parent ee001a7cae
commit 6e64a0c867
78 changed files with 1551 additions and 2627 deletions
+4 -5
View File
@@ -4,7 +4,6 @@ import (
"context"
"database/sql"
"fmt"
"io"
"os"
"reflect"
"testing"
@@ -61,16 +60,16 @@ type forceTextEncoder struct {
e pgtype.TextEncoder
}
func (f forceTextEncoder) EncodeText(ci *pgtype.ConnInfo, w io.Writer) (bool, error) {
return f.e.EncodeText(ci, w)
func (f forceTextEncoder) EncodeText(ci *pgtype.ConnInfo, buf []byte) ([]byte, error) {
return f.e.EncodeText(ci, buf)
}
type forceBinaryEncoder struct {
e pgtype.BinaryEncoder
}
func (f forceBinaryEncoder) EncodeBinary(ci *pgtype.ConnInfo, w io.Writer) (bool, error) {
return f.e.EncodeBinary(ci, w)
func (f forceBinaryEncoder) EncodeBinary(ci *pgtype.ConnInfo, buf []byte) ([]byte, error) {
return f.e.EncodeBinary(ci, buf)
}
func ForceEncoder(e interface{}, formatCode int16) interface{} {