diff --git a/CHANGELOG.md b/CHANGELOG.md index 198a6ea4..1f285400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# Unreleased v5 + +* Import pgtype repository + +## pgtype Changes + +* Types now have Valid boolean field instead of Status byte. This matches database/sql pattern. +* Extracted integrations with github.com/shopspring/decimal and github.com/gofrs/uuid to https://github.com/jackc/pgx-shopspring-decimal and https://github.com/jackc/pgx-gofrs-uuid respectively. + + # 4.14.1 (November 28, 2021) * Upgrade pgtype to v1.9.1 (fixes unintentional change to timestamp binary decoding) diff --git a/README.md b/README.md index 110d4f02..5a65a00f 100644 --- a/README.md +++ b/README.md @@ -172,9 +172,9 @@ from pgx for lower-level control. This is a `database/sql` compatibility layer for pgx. pgx can be used as a normal `database/sql` driver, but at any time, the native interface can be acquired for more performance or PostgreSQL specific functionality. -### [github.com/jackc/pgtype](https://github.com/jackc/pgtype) +### [github.com/jackc/pgx/v5/pgtype](https://github.com/jackc/pgx/tree/master/pgtype) -Over 70 PostgreSQL types are supported including `uuid`, `hstore`, `json`, `bytea`, `numeric`, `interval`, `inet`, and arrays. These types support `database/sql` interfaces and are usable outside of pgx. They are fully tested in pgx and pq. They also support a higher performance interface when used with the pgx driver. +Over 70 PostgreSQL types are supported including `uuid`, `hstore`, `json`, `bytea`, `numeric`, `interval`, `inet`, and arrays. ### [github.com/jackc/pgproto3](https://github.com/jackc/pgproto3) diff --git a/bench_test.go b/bench_test.go index f2d98bab..1a35a1a4 100644 --- a/bench_test.go +++ b/bench_test.go @@ -14,8 +14,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgconn/stmtcache" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" "github.com/stretchr/testify/require" ) @@ -459,12 +459,12 @@ func newBenchmarkWriteTableCopyFromSrc(count int) pgx.CopyFromSource { row: []interface{}{ "varchar_1", "varchar_2", - &pgtype.Text{Status: pgtype.Null}, + &pgtype.Text{}, time.Date(2000, 1, 1, 0, 0, 0, 0, time.Local), - &pgtype.Date{Status: pgtype.Null}, + &pgtype.Date{}, 1, 2, - &pgtype.Int4{Status: pgtype.Null}, + &pgtype.Int4{}, time.Date(2001, 1, 1, 0, 0, 0, 0, time.Local), time.Date(2002, 1, 1, 0, 0, 0, 0, time.Local), true, diff --git a/conn.go b/conn.go index 102158ab..b0cbf72b 100644 --- a/conn.go +++ b/conn.go @@ -11,8 +11,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgconn/stmtcache" "github.com/jackc/pgproto3/v2" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4/internal/sanitize" + "github.com/jackc/pgx/v4/pgtype" ) // ConnConfig contains all the options used to establish a connection. It must be created by ParseConfig and @@ -508,7 +508,7 @@ func (c *Conn) execParamsAndPreparedPrefix(sd *pgconn.StatementDescription, argu } for i := range sd.Fields { - c.eqb.AppendResultFormat(c.ConnInfo().ResultFormatCodeForOID(sd.Fields[i].DataTypeOID)) + c.eqb.AppendResultFormat(c.ConnInfo().FormatCodeForOID(sd.Fields[i].DataTypeOID)) } return nil @@ -668,7 +668,7 @@ optionLoop: if resultFormats == nil { for i := range sd.Fields { - c.eqb.AppendResultFormat(c.ConnInfo().ResultFormatCodeForOID(sd.Fields[i].DataTypeOID)) + c.eqb.AppendResultFormat(c.ConnInfo().FormatCodeForOID(sd.Fields[i].DataTypeOID)) } resultFormats = c.eqb.resultFormats @@ -819,7 +819,7 @@ func (c *Conn) SendBatch(ctx context.Context, b *Batch) BatchResults { } for i := range sd.Fields { - c.eqb.AppendResultFormat(c.ConnInfo().ResultFormatCodeForOID(sd.Fields[i].DataTypeOID)) + c.eqb.AppendResultFormat(c.ConnInfo().FormatCodeForOID(sd.Fields[i].DataTypeOID)) } if sd.Name == "" { diff --git a/conn_test.go b/conn_test.go index beddcdcd..d18ad1d9 100644 --- a/conn_test.go +++ b/conn_test.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgconn/stmtcache" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/example_custom_type_test.go b/example_custom_type_test.go index 34331f5b..7723df6a 100644 --- a/example_custom_type_test.go +++ b/example_custom_type_test.go @@ -7,16 +7,16 @@ import ( "regexp" "strconv" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" ) var pointRegexp *regexp.Regexp = regexp.MustCompile(`^\((.*),(.*)\)$`) // Point represents a point that may be null. type Point struct { - X, Y float64 // Coordinates of point - Status pgtype.Status + X, Y float64 // Coordinates of point + Valid bool } func (dst *Point) Set(src interface{}) error { @@ -24,14 +24,11 @@ func (dst *Point) Set(src interface{}) error { } func (dst *Point) Get() interface{} { - switch dst.Status { - case pgtype.Present: - return dst - case pgtype.Null: + if !dst.Valid { return nil - default: - return dst.Status } + + return dst } func (src *Point) AssignTo(dst interface{}) error { @@ -40,7 +37,7 @@ func (src *Point) AssignTo(dst interface{}) error { func (dst *Point) DecodeText(ci *pgtype.ConnInfo, src []byte) error { if src == nil { - *dst = Point{Status: pgtype.Null} + *dst = Point{} return nil } @@ -59,13 +56,13 @@ func (dst *Point) DecodeText(ci *pgtype.ConnInfo, src []byte) error { return fmt.Errorf("Received invalid point: %v", s) } - *dst = Point{X: x, Y: y, Status: pgtype.Present} + *dst = Point{X: x, Y: y, Valid: true} return nil } func (src *Point) String() string { - if src.Status == pgtype.Null { + if !src.Valid { return "null point" } diff --git a/extended_query_builder.go b/extended_query_builder.go index d06f63fd..53ea75ff 100644 --- a/extended_query_builder.go +++ b/extended_query_builder.go @@ -5,7 +5,7 @@ import ( "fmt" "reflect" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type extendedQueryBuilder struct { diff --git a/go.mod b/go.mod index 1bc04650..577cc76a 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/jackc/pgconn v1.10.1 github.com/jackc/pgio v1.0.0 github.com/jackc/pgproto3/v2 v2.2.0 - github.com/jackc/pgtype v1.9.1 github.com/jackc/puddle v1.2.0 github.com/rs/zerolog v1.15.0 github.com/shopspring/decimal v1.2.0 diff --git a/go.sum b/go.sum index 90193e6d..e95937cc 100644 --- a/go.sum +++ b/go.sum @@ -29,9 +29,6 @@ github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.0 h1:4EYhlDVEMsJ30nNj0mmgwIUXoq7e9sMJrVC2ED6QlCU= -github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.10.1 h1:DzdIHIjG1AxGwoEEqS+mGsURyjt4enSmqzACXvVzOT8= github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= @@ -49,7 +46,6 @@ github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1 h1:7PQ/4gLoqnl87ZxL7xjO0DR5gYuviDCZxQJsUlFW1eI= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.2.0 h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns= github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= @@ -58,23 +54,11 @@ github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4 github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.8.1 h1:9k0IXtdJXHJbyAWQgbWr1lU+MEhPXZz6RIXxfR5oxXs= -github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgtype v1.9.0 h1:/SH1RxEtltvJgsDqp3TbiTFApD3mey3iygpuEGeuBXk= -github.com/jackc/pgtype v1.9.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgtype v1.9.1 h1:MJc2s0MFS8C3ok1wQTdQxWuXQcB6+HwAm5x1CzW7mf0= -github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3 h1:JnPg/5Q9xVJGfjsO5CPUOjnJps1JaRUm8I9FXVCFK94= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.4 h1:5Ey/o5IfV7dYX6Znivq+N9MdK1S18OJI5OJq6EAAADw= -github.com/jackc/puddle v1.1.4/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.0 h1:DNDKdn/pDrWvDWyT2FYvpZVE81OAhWrjCv19I9n108Q= github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -89,16 +73,13 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -127,13 +108,11 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -144,7 +123,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -153,7 +131,6 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -168,8 +145,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -187,13 +162,11 @@ golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114 h1:DnSr2mCsxyCE6ZgIkmcWUQY2R5cH/6wL7eIxEmQOMSE= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/messages.go b/messages.go index 5324cbb5..d7af6973 100644 --- a/messages.go +++ b/messages.go @@ -3,7 +3,7 @@ package pgx import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) func convertDriverValuers(args []interface{}) ([]interface{}, error) { diff --git a/pgtype/CHANGELOG.md b/pgtype/CHANGELOG.md deleted file mode 100644 index e34c7979..00000000 --- a/pgtype/CHANGELOG.md +++ /dev/null @@ -1,121 +0,0 @@ -# 1.9.1 (November 28, 2021) - -* Fix: binary timestamp is assumed to be in UTC (restored behavior changed in v1.9.0) - -# 1.9.0 (November 20, 2021) - -* Fix binary hstore null decoding -* Add shopspring/decimal.NullDecimal support to integration (Eli Treuherz) -* Inet.Set supports bare IP address (Carl Dunham) -* Add zeronull.Float8 -* Fix NULL being lost when scanning unknown OID into sql.Scanner -* Fix BPChar.AssignTo **rune -* Add support for fmt.Stringer and driver.Valuer in String fields encoding (Jan Dubsky) -* Fix really big timestamp(tz)s binary format parsing (e.g. year 294276) (Jim Tsao) -* Support `map[string]*string` as hstore (Adrian Sieger) -* Fix parsing text array with negative bounds -* Add infinity support for numeric (Jim Tsao) - -# 1.8.1 (July 24, 2021) - -* Cleaned up Go module dependency chain - -# 1.8.0 (July 10, 2021) - -* Maintain host bits for inet types (Cameron Daniel) -* Support pointers of wrapping structs (Ivan Daunis) -* Register JSONBArray at NewConnInfo() (Rueian) -* CompositeTextScanner handles backslash escapes - -# 1.7.0 (March 25, 2021) - -* Fix scanning int into **sql.Scanner implementor -* Add tsrange array type (Vasilii Novikov) -* Fix: escaped strings when they start or end with a newline char (Stephane Martin) -* Accept nil *time.Time in Time.Set -* Fix numeric NaN support -* Use Go 1.13 errors instead of xerrors - -# 1.6.2 (December 3, 2020) - -* Fix panic on assigning empty array to non-slice or array -* Fix text array parsing disambiguates NULL and "NULL" -* Fix Timestamptz.DecodeText with too short text - -# 1.6.1 (October 31, 2020) - -* Fix simple protocol empty array support - -# 1.6.0 (October 24, 2020) - -* Fix AssignTo pointer to pointer to slice and named types. -* Fix zero length array assignment (Simo Haasanen) -* Add float64, float32 convert to int2, int4, int8 (lqu3j) -* Support setting infinite timestamps (Erik Agsjö) -* Polygon improvements (duohedron) -* Fix Inet.Set with nil (Tomas Volf) - -# 1.5.0 (September 26, 2020) - -* Add slice of slice mapping to multi-dimensional arrays (Simo Haasanen) -* Fix JSONBArray -* Fix selecting empty array -* Text formatted values except bytea can be directly scanned to []byte -* Add JSON marshalling for UUID (bakmataliev) -* Improve point type conversions (bakmataliev) - -# 1.4.2 (July 22, 2020) - -* Fix encoding of a large composite data type (Yaz Saito) - -# 1.4.1 (July 14, 2020) - -* Fix ArrayType DecodeBinary empty array breaks future reads - -# 1.4.0 (June 27, 2020) - -* Add JSON support to ext/gofrs-uuid -* Performance improvements in Scan path -* Improved ext/shopspring-numeric binary decoding performance -* Add composite type support (Maxim Ivanov and Jack Christensen) -* Add better generic enum type support -* Add generic array type support -* Clarify and normalize Value semantics -* Fix hstore with empty string values -* Numeric supports NaN values (leighhopcroft) -* Add slice of pointer support to array types (megaturbo) -* Add jsonb array type (tserakhau) -* Allow converting intervals with months and days to duration - -# 1.3.0 (March 30, 2020) - -* Get implemented on T instead of *T -* Set will call Get on src if possible -* Range types Set method supports its own type, string, and nil -* Date.Set parses string -* Fix correct format verb for unknown type error (Robert Welin) -* Truncate nanoseconds in EncodeText for Timestamptz and Timestamp - -# 1.2.0 (February 5, 2020) - -* Add zeronull package for easier NULL <-> zero conversion -* Add JSON marshalling for shopspring-numeric extension -* Add JSON marshalling for Bool, Date, JSON/B, Timestamptz (Jeffrey Stiles) -* Fix null status in UnmarshalJSON for some types (Jeffrey Stiles) - -# 1.1.0 (January 11, 2020) - -* Add PostgreSQL time type support -* Add more automatic conversions of integer arrays of different types (Jean-Philippe Quéméner) - -# 1.0.3 (November 16, 2019) - -* Support initializing Array types from a slice of the value (Alex Gaynor) - -# 1.0.2 (October 22, 2019) - -* Fix scan into null into pointer to pointer implementing Decode* interface. (Jeremy Altavilla) - -# 1.0.1 (September 19, 2019) - -* Fix daterange OID diff --git a/pgtype/LICENSE b/pgtype/LICENSE deleted file mode 100644 index 5c486c39..00000000 --- a/pgtype/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013-2021 Jack Christensen - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/pgtype/README.md b/pgtype/README.md deleted file mode 100644 index bc4e72f9..00000000 --- a/pgtype/README.md +++ /dev/null @@ -1,8 +0,0 @@ -[![](https://godoc.org/github.com/jackc/pgtype?status.svg)](https://godoc.org/github.com/jackc/pgtype) -![CI](https://github.com/jackc/pgtype/workflows/CI/badge.svg) - -# pgtype - -pgtype implements Go types for over 70 PostgreSQL types. pgtype is the type system underlying the -https://github.com/jackc/pgx PostgreSQL driver. These types support the binary format for enhanced performance with pgx. -They also support the database/sql `Scan` and `Value` interfaces. diff --git a/pgtype/aclitem_array_test.go b/pgtype/aclitem_array_test.go index 0d6adb1d..736d0967 100644 --- a/pgtype/aclitem_array_test.go +++ b/pgtype/aclitem_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestACLItemArrayTranscode(t *testing.T) { diff --git a/pgtype/aclitem_test.go b/pgtype/aclitem_test.go index 4e9bc5b0..afc6a1e3 100644 --- a/pgtype/aclitem_test.go +++ b/pgtype/aclitem_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestACLItemTranscode(t *testing.T) { diff --git a/pgtype/array_test.go b/pgtype/array_test.go index f1fe90f4..549467bf 100644 --- a/pgtype/array_test.go +++ b/pgtype/array_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" "github.com/stretchr/testify/require" ) diff --git a/pgtype/array_type_test.go b/pgtype/array_type_test.go index 626df4dc..62b25dfa 100644 --- a/pgtype/array_type_test.go +++ b/pgtype/array_type_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) diff --git a/pgtype/bit_test.go b/pgtype/bit_test.go index df5fe4cb..51c12765 100644 --- a/pgtype/bit_test.go +++ b/pgtype/bit_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestBitTranscode(t *testing.T) { diff --git a/pgtype/bool_array_test.go b/pgtype/bool_array_test.go index cfb9ad79..9278c864 100644 --- a/pgtype/bool_array_test.go +++ b/pgtype/bool_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestBoolArrayTranscode(t *testing.T) { diff --git a/pgtype/bool_test.go b/pgtype/bool_test.go index a1ba9bb0..f323c5e7 100644 --- a/pgtype/bool_test.go +++ b/pgtype/bool_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestBoolTranscode(t *testing.T) { diff --git a/pgtype/box_test.go b/pgtype/box_test.go index c7e00553..d6a928c9 100644 --- a/pgtype/box_test.go +++ b/pgtype/box_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestBoxTranscode(t *testing.T) { diff --git a/pgtype/bpchar_array_test.go b/pgtype/bpchar_array_test.go index 277f6e3c..4714b261 100644 --- a/pgtype/bpchar_array_test.go +++ b/pgtype/bpchar_array_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestBPCharArrayTranscode(t *testing.T) { diff --git a/pgtype/bpchar_test.go b/pgtype/bpchar_test.go index fe7e651c..68fbfc9f 100644 --- a/pgtype/bpchar_test.go +++ b/pgtype/bpchar_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestChar3Transcode(t *testing.T) { diff --git a/pgtype/bytea_array_test.go b/pgtype/bytea_array_test.go index 1473eb9c..d081db11 100644 --- a/pgtype/bytea_array_test.go +++ b/pgtype/bytea_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestByteaArrayTranscode(t *testing.T) { diff --git a/pgtype/bytea_test.go b/pgtype/bytea_test.go index 0f47cb7f..b87b3c96 100644 --- a/pgtype/bytea_test.go +++ b/pgtype/bytea_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestByteaTranscode(t *testing.T) { diff --git a/pgtype/cid_test.go b/pgtype/cid_test.go index 041cb805..e915e534 100644 --- a/pgtype/cid_test.go +++ b/pgtype/cid_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestCIDTranscode(t *testing.T) { diff --git a/pgtype/cidr_array_test.go b/pgtype/cidr_array_test.go index 7821cf44..93d3933d 100644 --- a/pgtype/cidr_array_test.go +++ b/pgtype/cidr_array_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestCIDRArrayTranscode(t *testing.T) { diff --git a/pgtype/circle_test.go b/pgtype/circle_test.go index 416a1a41..2e5a8c86 100644 --- a/pgtype/circle_test.go +++ b/pgtype/circle_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestCircleTranscode(t *testing.T) { diff --git a/pgtype/composite_bench_test.go b/pgtype/composite_bench_test.go index a1d91f8e..92330905 100644 --- a/pgtype/composite_bench_test.go +++ b/pgtype/composite_bench_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/jackc/pgio" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" "github.com/stretchr/testify/require" ) diff --git a/pgtype/composite_fields_test.go b/pgtype/composite_fields_test.go index be0b8125..07b3954e 100644 --- a/pgtype/composite_fields_test.go +++ b/pgtype/composite_fields_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pgtype/composite_type_test.go b/pgtype/composite_type_test.go index e06927fa..80dd4a5c 100644 --- a/pgtype/composite_type_test.go +++ b/pgtype/composite_type_test.go @@ -6,9 +6,9 @@ import ( "os" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" pgx "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pgtype/custom_composite_test.go b/pgtype/custom_composite_test.go index 86203828..0cc14442 100644 --- a/pgtype/custom_composite_test.go +++ b/pgtype/custom_composite_test.go @@ -6,8 +6,8 @@ import ( "fmt" "os" - "github.com/jackc/pgtype" pgx "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" ) type MyType struct { diff --git a/pgtype/date_array_test.go b/pgtype/date_array_test.go index 421427cd..93e423a0 100644 --- a/pgtype/date_array_test.go +++ b/pgtype/date_array_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestDateArrayTranscode(t *testing.T) { diff --git a/pgtype/date_test.go b/pgtype/date_test.go index 87425540..0df84468 100644 --- a/pgtype/date_test.go +++ b/pgtype/date_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestDateTranscode(t *testing.T) { diff --git a/pgtype/daterange_test.go b/pgtype/daterange_test.go index 830942d0..d0bb8d60 100644 --- a/pgtype/daterange_test.go +++ b/pgtype/daterange_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestDaterangeTranscode(t *testing.T) { diff --git a/pgtype/enum_array_test.go b/pgtype/enum_array_test.go index 7d0ff864..7b9c4d23 100644 --- a/pgtype/enum_array_test.go +++ b/pgtype/enum_array_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestEnumArrayTranscode(t *testing.T) { diff --git a/pgtype/enum_type_test.go b/pgtype/enum_type_test.go index 4dd88f2a..965f713a 100644 --- a/pgtype/enum_type_test.go +++ b/pgtype/enum_type_test.go @@ -5,9 +5,9 @@ import ( "context" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pgtype/float4_array_test.go b/pgtype/float4_array_test.go index 9b401ac8..d28cd38c 100644 --- a/pgtype/float4_array_test.go +++ b/pgtype/float4_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestFloat4ArrayTranscode(t *testing.T) { diff --git a/pgtype/float4_test.go b/pgtype/float4_test.go index 191df65e..3ad480f5 100644 --- a/pgtype/float4_test.go +++ b/pgtype/float4_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestFloat4Transcode(t *testing.T) { diff --git a/pgtype/float8_array_test.go b/pgtype/float8_array_test.go index 52209238..6fc85993 100644 --- a/pgtype/float8_array_test.go +++ b/pgtype/float8_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestFloat8ArrayTranscode(t *testing.T) { diff --git a/pgtype/float8_test.go b/pgtype/float8_test.go index dcc45879..2bc8de0c 100644 --- a/pgtype/float8_test.go +++ b/pgtype/float8_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestFloat8Transcode(t *testing.T) { diff --git a/pgtype/go.mod b/pgtype/go.mod deleted file mode 100644 index b2f1cc10..00000000 --- a/pgtype/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/jackc/pgtype - -go 1.13 - -require ( - github.com/jackc/pgconn v1.10.1 - github.com/jackc/pgio v1.0.0 - github.com/jackc/pgx/v4 v4.14.2-0.20211129172902-cf0de913ee8f - github.com/stretchr/testify v1.7.0 -) diff --git a/pgtype/go.sum b/pgtype/go.sum deleted file mode 100644 index 2a835726..00000000 --- a/pgtype/go.sum +++ /dev/null @@ -1,180 +0,0 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.1 h1:DzdIHIjG1AxGwoEEqS+mGsURyjt4enSmqzACXvVzOT8= -github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.2.0 h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns= -github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.9.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.14.2-0.20211129172902-cf0de913ee8f h1:Y3Es3mIYatTvP4CXPXfmJtHWe8eq4E8owY6Fq61hEik= -github.com/jackc/pgx/v4 v4.14.2-0.20211129172902-cf0de913ee8f/go.mod h1:RgDuE4Z34o7XE92RpLsvFiOEfrAUT0Xt2KxvX73W06M= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/pgtype/hstore_array_test.go b/pgtype/hstore_array_test.go index 11290fb1..b164f598 100644 --- a/pgtype/hstore_array_test.go +++ b/pgtype/hstore_array_test.go @@ -5,9 +5,9 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestHstoreArrayTranscode(t *testing.T) { diff --git a/pgtype/hstore_test.go b/pgtype/hstore_test.go index 9c26a3df..6faf7496 100644 --- a/pgtype/hstore_test.go +++ b/pgtype/hstore_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestHstoreTranscode(t *testing.T) { diff --git a/pgtype/inet_array_test.go b/pgtype/inet_array_test.go index 1019c7eb..b111746d 100644 --- a/pgtype/inet_array_test.go +++ b/pgtype/inet_array_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInetArrayTranscode(t *testing.T) { diff --git a/pgtype/inet_test.go b/pgtype/inet_test.go index c2a5dc28..56705e4d 100644 --- a/pgtype/inet_test.go +++ b/pgtype/inet_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/assert" ) diff --git a/pgtype/int2_array_test.go b/pgtype/int2_array_test.go index 78dc532a..e5366edd 100644 --- a/pgtype/int2_array_test.go +++ b/pgtype/int2_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt2ArrayTranscode(t *testing.T) { diff --git a/pgtype/int2_test.go b/pgtype/int2_test.go index 6ed8fe90..26f43eec 100644 --- a/pgtype/int2_test.go +++ b/pgtype/int2_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt2Transcode(t *testing.T) { diff --git a/pgtype/int4_array_test.go b/pgtype/int4_array_test.go index a9c9acd9..bcabe8ca 100644 --- a/pgtype/int4_array_test.go +++ b/pgtype/int4_array_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt4ArrayTranscode(t *testing.T) { diff --git a/pgtype/int4_test.go b/pgtype/int4_test.go index 3085babd..cdff4b44 100644 --- a/pgtype/int4_test.go +++ b/pgtype/int4_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt4Transcode(t *testing.T) { diff --git a/pgtype/int4range_test.go b/pgtype/int4range_test.go index 8b990036..a45e4779 100644 --- a/pgtype/int4range_test.go +++ b/pgtype/int4range_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt4rangeTranscode(t *testing.T) { diff --git a/pgtype/int8_array_test.go b/pgtype/int8_array_test.go index 29eaf8cb..c4de8bb1 100644 --- a/pgtype/int8_array_test.go +++ b/pgtype/int8_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt8ArrayTranscode(t *testing.T) { diff --git a/pgtype/int8_test.go b/pgtype/int8_test.go index 8aca741d..9f96a1e3 100644 --- a/pgtype/int8_test.go +++ b/pgtype/int8_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt8Transcode(t *testing.T) { diff --git a/pgtype/int8range_test.go b/pgtype/int8range_test.go index f2e4098d..aefa2f53 100644 --- a/pgtype/int8range_test.go +++ b/pgtype/int8range_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestInt8rangeTranscode(t *testing.T) { diff --git a/pgtype/integration_benchmark_test.go b/pgtype/integration_benchmark_test.go index d3af7c31..cca6dd1e 100644 --- a/pgtype/integration_benchmark_test.go +++ b/pgtype/integration_benchmark_test.go @@ -6,9 +6,9 @@ import ( "context" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func BenchmarkQueryTextFormatDecode_PG_int4_to_Go_int16_1_rows_1_columns(b *testing.B) { diff --git a/pgtype/integration_benchmark_test.go.erb b/pgtype/integration_benchmark_test.go.erb index 037c96c3..d9bb7937 100644 --- a/pgtype/integration_benchmark_test.go.erb +++ b/pgtype/integration_benchmark_test.go.erb @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/jackc/pgx/v4" ) diff --git a/pgtype/interval_test.go b/pgtype/interval_test.go index 844f3866..6754a222 100644 --- a/pgtype/interval_test.go +++ b/pgtype/interval_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pgtype/json_test.go b/pgtype/json_test.go index c56f403f..a42b7ab4 100644 --- a/pgtype/json_test.go +++ b/pgtype/json_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestJSONTranscode(t *testing.T) { diff --git a/pgtype/jsonb_array_test.go b/pgtype/jsonb_array_test.go index 4f293e9e..172892bc 100644 --- a/pgtype/jsonb_array_test.go +++ b/pgtype/jsonb_array_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestJSONBArrayTranscode(t *testing.T) { diff --git a/pgtype/jsonb_test.go b/pgtype/jsonb_test.go index 41df18fa..242014f3 100644 --- a/pgtype/jsonb_test.go +++ b/pgtype/jsonb_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestJSONBTranscode(t *testing.T) { diff --git a/pgtype/line_test.go b/pgtype/line_test.go index c47f6512..6f38d85f 100644 --- a/pgtype/line_test.go +++ b/pgtype/line_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestLineTranscode(t *testing.T) { diff --git a/pgtype/lseg_test.go b/pgtype/lseg_test.go index af2faf3f..9122f76b 100644 --- a/pgtype/lseg_test.go +++ b/pgtype/lseg_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestLsegTranscode(t *testing.T) { diff --git a/pgtype/macaddr_array_test.go b/pgtype/macaddr_array_test.go index a4a55cb0..4941ad80 100644 --- a/pgtype/macaddr_array_test.go +++ b/pgtype/macaddr_array_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestMacaddrArrayTranscode(t *testing.T) { diff --git a/pgtype/macaddr_test.go b/pgtype/macaddr_test.go index dc475c41..9a78521b 100644 --- a/pgtype/macaddr_test.go +++ b/pgtype/macaddr_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestMacaddrTranscode(t *testing.T) { diff --git a/pgtype/name_test.go b/pgtype/name_test.go index 5f429d83..b71ea490 100644 --- a/pgtype/name_test.go +++ b/pgtype/name_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestNameTranscode(t *testing.T) { diff --git a/pgtype/numeric_array_test.go b/pgtype/numeric_array_test.go index ee36d1a7..82a4fb6c 100644 --- a/pgtype/numeric_array_test.go +++ b/pgtype/numeric_array_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestNumericArrayTranscode(t *testing.T) { diff --git a/pgtype/numeric_test.go b/pgtype/numeric_test.go index 7f0734d0..22bd22ef 100644 --- a/pgtype/numeric_test.go +++ b/pgtype/numeric_test.go @@ -9,8 +9,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) @@ -289,7 +289,7 @@ func TestNumericAssignTo(t *testing.T) { {src: &pgtype.Numeric{Int: big.NewInt(42), Valid: true}, dst: &_i8, expected: _int8(42)}, {src: &pgtype.Numeric{Int: big.NewInt(0)}, dst: &pi8, expected: ((*int8)(nil))}, {src: &pgtype.Numeric{Int: big.NewInt(0)}, dst: &_pi8, expected: ((*_int8)(nil))}, - {src: &pgtype.Numeric{Int: big.NewInt(1006), Exp: -2, Valid: true}, dst: &f64, expected: float64(10.06)}, // https://github.com/jackc/pgtype/issues/27 + {src: &pgtype.Numeric{Int: big.NewInt(1006), Exp: -2, Valid: true}, dst: &f64, expected: float64(10.06)}, // https://github.com/jackc/pgx/v4/pgtype/issues/27 {src: &pgtype.Numeric{Valid: true, NaN: true}, dst: &f64, expected: math.NaN()}, {src: &pgtype.Numeric{Valid: true, NaN: true}, dst: &f32, expected: float32(math.NaN())}, {src: &pgtype.Numeric{Valid: true, InfinityModifier: pgtype.Infinity}, dst: &f64, expected: math.Inf(1)}, diff --git a/pgtype/numrange_test.go b/pgtype/numrange_test.go index b9ea7658..3e89dc73 100644 --- a/pgtype/numrange_test.go +++ b/pgtype/numrange_test.go @@ -4,8 +4,8 @@ import ( "math/big" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestNumrangeTranscode(t *testing.T) { diff --git a/pgtype/oid_value_test.go b/pgtype/oid_value_test.go index 021f81d3..e3d2e014 100644 --- a/pgtype/oid_value_test.go +++ b/pgtype/oid_value_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestOIDValueTranscode(t *testing.T) { diff --git a/pgtype/path_test.go b/pgtype/path_test.go index 9a66996e..af410540 100644 --- a/pgtype/path_test.go +++ b/pgtype/path_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestPathTranscode(t *testing.T) { diff --git a/pgtype/pgtype_test.go b/pgtype/pgtype_test.go index 9bf1f242..6540842c 100644 --- a/pgtype/pgtype_test.go +++ b/pgtype/pgtype_test.go @@ -7,8 +7,8 @@ import ( "net" "testing" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" _ "github.com/jackc/pgx/v4/stdlib" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pgtype/pgxtype/pgxtype.go b/pgtype/pgxtype/pgxtype.go index 041f2545..db4d8926 100644 --- a/pgtype/pgxtype/pgxtype.go +++ b/pgtype/pgxtype/pgxtype.go @@ -5,8 +5,8 @@ import ( "errors" "github.com/jackc/pgconn" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" ) type Querier interface { diff --git a/pgtype/point_test.go b/pgtype/point_test.go index 82f58e17..b8681cd5 100644 --- a/pgtype/point_test.go +++ b/pgtype/point_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) diff --git a/pgtype/polygon_test.go b/pgtype/polygon_test.go index 34f8d59a..25cbd7dc 100644 --- a/pgtype/polygon_test.go +++ b/pgtype/polygon_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestPolygonTranscode(t *testing.T) { diff --git a/pgtype/qchar_test.go b/pgtype/qchar_test.go index eb54bf65..a27cb098 100644 --- a/pgtype/qchar_test.go +++ b/pgtype/qchar_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestQCharTranscode(t *testing.T) { diff --git a/pgtype/record.go b/pgtype/record.go index 20b119c6..5bb4d701 100644 --- a/pgtype/record.go +++ b/pgtype/record.go @@ -88,6 +88,28 @@ func prepareNewBinaryDecoder(ci *ConnInfo, fieldOID uint32, v *Value) (BinaryDec return binaryDecoder, nil } +func (Record) BinaryFormatSupported() bool { + return true +} + +func (Record) TextFormatSupported() bool { + return false +} + +func (Record) PreferredFormat() int16 { + return BinaryFormatCode +} + +func (dst *Record) DecodeResult(ci *ConnInfo, oid uint32, format int16, src []byte) error { + switch format { + case BinaryFormatCode: + return dst.DecodeBinary(ci, src) + case TextFormatCode: + return fmt.Errorf("text format is not supported") + } + return fmt.Errorf("unknown format code %d", format) +} + func (dst *Record) DecodeBinary(ci *ConnInfo, src []byte) error { if src == nil { *dst = Record{} diff --git a/pgtype/record_test.go b/pgtype/record_test.go index c8e7d4b7..6e052b71 100644 --- a/pgtype/record_test.go +++ b/pgtype/record_test.go @@ -6,9 +6,9 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) var recordTests = []struct { diff --git a/pgtype/testutil/testutil.go b/pgtype/testutil/testutil.go index 5dded2b9..6007d7a4 100644 --- a/pgtype/testutil/testutil.go +++ b/pgtype/testutil/testutil.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" _ "github.com/jackc/pgx/v4/stdlib" ) diff --git a/pgtype/text_array_test.go b/pgtype/text_array_test.go index 4caeb692..ce4b0d20 100644 --- a/pgtype/text_array_test.go +++ b/pgtype/text_array_test.go @@ -4,13 +4,13 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -// https://github.com/jackc/pgtype/issues/78 +// https://github.com/jackc/pgx/v4/pgtype/issues/78 func TestTextArrayDecodeTextNull(t *testing.T) { textArray := &pgtype.TextArray{} err := textArray.DecodeText(nil, []byte(`{abc,"NULL",NULL,def}`)) diff --git a/pgtype/text_test.go b/pgtype/text_test.go index 5f34f8c0..17201764 100644 --- a/pgtype/text_test.go +++ b/pgtype/text_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestTextTranscode(t *testing.T) { diff --git a/pgtype/tid_test.go b/pgtype/tid_test.go index fcf93259..133e5a35 100644 --- a/pgtype/tid_test.go +++ b/pgtype/tid_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestTIDTranscode(t *testing.T) { diff --git a/pgtype/time_test.go b/pgtype/time_test.go index 4a989375..008b1448 100644 --- a/pgtype/time_test.go +++ b/pgtype/time_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestTimeTranscode(t *testing.T) { diff --git a/pgtype/timestamp_array_test.go b/pgtype/timestamp_array_test.go index 214c8a71..c354f0cf 100644 --- a/pgtype/timestamp_array_test.go +++ b/pgtype/timestamp_array_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestTimestampArrayTranscode(t *testing.T) { diff --git a/pgtype/timestamp_test.go b/pgtype/timestamp_test.go index 88e2bca8..f906462d 100644 --- a/pgtype/timestamp_test.go +++ b/pgtype/timestamp_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) @@ -34,7 +34,7 @@ func TestTimestampTranscode(t *testing.T) { }) } -// https://github.com/jackc/pgtype/pull/128 +// https://github.com/jackc/pgx/v4/pgtype/pull/128 func TestTimestampTranscodeBigTimeBinary(t *testing.T) { conn := testutil.MustConnectPgx(t) if _, ok := conn.ConnInfo().DataTypeForName("line"); !ok { @@ -99,7 +99,7 @@ func TestTimestampNanosecondsTruncated(t *testing.T) { } } -// https://github.com/jackc/pgtype/issues/74 +// https://github.com/jackc/pgx/v4/pgtype/issues/74 func TestTimestampDecodeTextInvalid(t *testing.T) { tstz := &pgtype.Timestamp{} err := tstz.DecodeText(nil, []byte(`eeeee`)) diff --git a/pgtype/timestamptz_array_test.go b/pgtype/timestamptz_array_test.go index 22e07b59..fd40cd35 100644 --- a/pgtype/timestamptz_array_test.go +++ b/pgtype/timestamptz_array_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestTimestamptzArrayTranscode(t *testing.T) { diff --git a/pgtype/timestamptz_test.go b/pgtype/timestamptz_test.go index fa2a7e89..8815d363 100644 --- a/pgtype/timestamptz_test.go +++ b/pgtype/timestamptz_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) @@ -34,7 +34,7 @@ func TestTimestamptzTranscode(t *testing.T) { }) } -// https://github.com/jackc/pgtype/pull/128 +// https://github.com/jackc/pgx/v4/pgtype/pull/128 func TestTimestamptzTranscodeBigTimeBinary(t *testing.T) { conn := testutil.MustConnectPgx(t) if _, ok := conn.ConnInfo().DataTypeForName("line"); !ok { @@ -99,7 +99,7 @@ func TestTimestamptzNanosecondsTruncated(t *testing.T) { } } -// https://github.com/jackc/pgtype/issues/74 +// https://github.com/jackc/pgx/v4/pgtype/issues/74 func TestTimestamptzDecodeTextInvalid(t *testing.T) { tstz := &pgtype.Timestamptz{} err := tstz.DecodeText(nil, []byte(`eeeee`)) diff --git a/pgtype/tsrange_test.go b/pgtype/tsrange_test.go index daea59bb..f24f824b 100644 --- a/pgtype/tsrange_test.go +++ b/pgtype/tsrange_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestTsrangeTranscode(t *testing.T) { diff --git a/pgtype/tstzrange_test.go b/pgtype/tstzrange_test.go index 49cfc63e..bf604ed5 100644 --- a/pgtype/tstzrange_test.go +++ b/pgtype/tstzrange_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) @@ -41,7 +41,7 @@ func TestTstzrangeTranscode(t *testing.T) { }) } -// https://github.com/jackc/pgtype/issues/74 +// https://github.com/jackc/pgx/v4/pgtype/issues/74 func TestTstzRangeDecodeTextInvalid(t *testing.T) { tstzrange := &pgtype.Tstzrange{} err := tstzrange.DecodeText(nil, []byte(`[eeee,)`)) diff --git a/pgtype/uuid_array_test.go b/pgtype/uuid_array_test.go index 47afadff..b4ec2f86 100644 --- a/pgtype/uuid_array_test.go +++ b/pgtype/uuid_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestUUIDArrayTranscode(t *testing.T) { diff --git a/pgtype/uuid_test.go b/pgtype/uuid_test.go index 63797178..036c0dd8 100644 --- a/pgtype/uuid_test.go +++ b/pgtype/uuid_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" "github.com/stretchr/testify/require" ) diff --git a/pgtype/varbit_test.go b/pgtype/varbit_test.go index b81bdc0e..1ca5357b 100644 --- a/pgtype/varbit_test.go +++ b/pgtype/varbit_test.go @@ -3,8 +3,8 @@ package pgtype_test import ( "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestVarbitTranscode(t *testing.T) { diff --git a/pgtype/varchar_array_test.go b/pgtype/varchar_array_test.go index cf0efd6d..c45162a0 100644 --- a/pgtype/varchar_array_test.go +++ b/pgtype/varchar_array_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestVarcharArrayTranscode(t *testing.T) { diff --git a/pgtype/workflows/ci.yml b/pgtype/workflows/ci.yml deleted file mode 100644 index 4b5a72f2..00000000 --- a/pgtype/workflows/ci.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - test: - name: Test - runs-on: ubuntu-latest - - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: secret - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - - steps: - - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: ^1.13 - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Create hstore extension - run: psql -c 'create extension hstore' - env: - PGHOST: localhost - PGUSER: postgres - PGPASSWORD: secret - PGSSLMODE: disable - - - name: Test - run: go test -v ./... - env: - PGHOST: localhost - PGUSER: postgres - PGPASSWORD: secret - PGSSLMODE: disable diff --git a/pgtype/xid_test.go b/pgtype/xid_test.go index fab10f79..5b30753a 100644 --- a/pgtype/xid_test.go +++ b/pgtype/xid_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/jackc/pgtype" - "github.com/jackc/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype" + "github.com/jackc/pgx/v4/pgtype/testutil" ) func TestXIDTranscode(t *testing.T) { diff --git a/pgtype/zeronull/float8.go b/pgtype/zeronull/float8.go index 07d5e1a5..3d9d4d22 100644 --- a/pgtype/zeronull/float8.go +++ b/pgtype/zeronull/float8.go @@ -3,7 +3,7 @@ package zeronull import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Float8 float64 diff --git a/pgtype/zeronull/float8_test.go b/pgtype/zeronull/float8_test.go index 27fb785e..cdc51245 100644 --- a/pgtype/zeronull/float8_test.go +++ b/pgtype/zeronull/float8_test.go @@ -3,8 +3,8 @@ package zeronull_test import ( "testing" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestFloat8Transcode(t *testing.T) { diff --git a/pgtype/zeronull/int2.go b/pgtype/zeronull/int2.go index b3f9c328..011e96d5 100644 --- a/pgtype/zeronull/int2.go +++ b/pgtype/zeronull/int2.go @@ -3,7 +3,7 @@ package zeronull import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Int2 int16 diff --git a/pgtype/zeronull/int2_test.go b/pgtype/zeronull/int2_test.go index 2dcb4e79..9cbd75db 100644 --- a/pgtype/zeronull/int2_test.go +++ b/pgtype/zeronull/int2_test.go @@ -3,8 +3,8 @@ package zeronull_test import ( "testing" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestInt2Transcode(t *testing.T) { diff --git a/pgtype/zeronull/int4.go b/pgtype/zeronull/int4.go index 3efca4e6..9d34c163 100644 --- a/pgtype/zeronull/int4.go +++ b/pgtype/zeronull/int4.go @@ -3,7 +3,7 @@ package zeronull import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Int4 int32 diff --git a/pgtype/zeronull/int4_test.go b/pgtype/zeronull/int4_test.go index 309e4125..456f15d2 100644 --- a/pgtype/zeronull/int4_test.go +++ b/pgtype/zeronull/int4_test.go @@ -3,8 +3,8 @@ package zeronull_test import ( "testing" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestInt4Transcode(t *testing.T) { diff --git a/pgtype/zeronull/int8.go b/pgtype/zeronull/int8.go index 5cb063d8..185fdb8f 100644 --- a/pgtype/zeronull/int8.go +++ b/pgtype/zeronull/int8.go @@ -3,7 +3,7 @@ package zeronull import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Int8 int64 diff --git a/pgtype/zeronull/int8_test.go b/pgtype/zeronull/int8_test.go index ae80bc0a..ca261d36 100644 --- a/pgtype/zeronull/int8_test.go +++ b/pgtype/zeronull/int8_test.go @@ -3,8 +3,8 @@ package zeronull_test import ( "testing" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestInt8Transcode(t *testing.T) { diff --git a/pgtype/zeronull/text.go b/pgtype/zeronull/text.go index afcb1a42..5fc9d94b 100644 --- a/pgtype/zeronull/text.go +++ b/pgtype/zeronull/text.go @@ -3,7 +3,7 @@ package zeronull import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Text string diff --git a/pgtype/zeronull/text_test.go b/pgtype/zeronull/text_test.go index f08a0d2a..8595253c 100644 --- a/pgtype/zeronull/text_test.go +++ b/pgtype/zeronull/text_test.go @@ -3,8 +3,8 @@ package zeronull_test import ( "testing" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestTextTranscode(t *testing.T) { diff --git a/pgtype/zeronull/timestamp.go b/pgtype/zeronull/timestamp.go index 61787818..193bc959 100644 --- a/pgtype/zeronull/timestamp.go +++ b/pgtype/zeronull/timestamp.go @@ -4,7 +4,7 @@ import ( "database/sql/driver" "time" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Timestamp time.Time diff --git a/pgtype/zeronull/timestamp_test.go b/pgtype/zeronull/timestamp_test.go index ec96ff07..787c6de9 100644 --- a/pgtype/zeronull/timestamp_test.go +++ b/pgtype/zeronull/timestamp_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestTimestampTranscode(t *testing.T) { diff --git a/pgtype/zeronull/timestamptz.go b/pgtype/zeronull/timestamptz.go index 4896e9b7..5ecefe64 100644 --- a/pgtype/zeronull/timestamptz.go +++ b/pgtype/zeronull/timestamptz.go @@ -4,7 +4,7 @@ import ( "database/sql/driver" "time" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type Timestamptz time.Time diff --git a/pgtype/zeronull/timestamptz_test.go b/pgtype/zeronull/timestamptz_test.go index 3a401c49..dcbd0d58 100644 --- a/pgtype/zeronull/timestamptz_test.go +++ b/pgtype/zeronull/timestamptz_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestTimestamptzTranscode(t *testing.T) { diff --git a/pgtype/zeronull/uuid.go b/pgtype/zeronull/uuid.go index 25211122..2e54a933 100644 --- a/pgtype/zeronull/uuid.go +++ b/pgtype/zeronull/uuid.go @@ -3,7 +3,7 @@ package zeronull import ( "database/sql/driver" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) type UUID [16]byte diff --git a/pgtype/zeronull/uuid_test.go b/pgtype/zeronull/uuid_test.go index 162bdf1f..e79503c6 100644 --- a/pgtype/zeronull/uuid_test.go +++ b/pgtype/zeronull/uuid_test.go @@ -3,8 +3,8 @@ package zeronull_test import ( "testing" - "github.com/jackc/pgtype/testutil" - "github.com/jackc/pgtype/zeronull" + "github.com/jackc/pgx/v4/pgtype/testutil" + "github.com/jackc/pgx/v4/pgtype/zeronull" ) func TestUUIDTranscode(t *testing.T) { diff --git a/query_test.go b/query_test.go index 968c0ecc..7580d8b0 100644 --- a/query_test.go +++ b/query_test.go @@ -17,8 +17,8 @@ import ( "github.com/gofrs/uuid" "github.com/jackc/pgconn" "github.com/jackc/pgconn/stmtcache" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -257,7 +257,7 @@ func TestConnQueryReadRowMultipleTimes(t *testing.T) { require.Equal(t, "foo", a) require.Equal(t, "bar", b) require.Equal(t, rowCount, c) - require.Equal(t, pgtype.Null, d.Status) + require.False(t, d.Valid) require.Equal(t, rowCount, e) } } @@ -275,22 +275,22 @@ func TestConnQueryValuesWithMultipleComplexColumnsOfSameType(t *testing.T) { expected0 := &pgtype.Int8Array{ Elements: []pgtype.Int8{ - {Int: 1, Status: pgtype.Present}, - {Int: 2, Status: pgtype.Present}, - {Int: 3, Status: pgtype.Present}, + {Int: 1, Valid: true}, + {Int: 2, Valid: true}, + {Int: 3, Valid: true}, }, Dimensions: []pgtype.ArrayDimension{{Length: 3, LowerBound: 1}}, - Status: pgtype.Present, + Valid: true, } expected1 := &pgtype.Int8Array{ Elements: []pgtype.Int8{ - {Int: 4, Status: pgtype.Present}, - {Int: 5, Status: pgtype.Present}, - {Int: 6, Status: pgtype.Present}, + {Int: 4, Valid: true}, + {Int: 5, Valid: true}, + {Int: 6, Valid: true}, }, Dimensions: []pgtype.ArrayDimension{{Length: 3, LowerBound: 1}}, - Status: pgtype.Present, + Valid: true, } var rowCount int32 @@ -1792,7 +1792,7 @@ func TestConnSimpleProtocol(t *testing.T) { { if conn.PgConn().ParameterStatus("crdb_version") == "" { // CockroachDB doesn't support circle type. - expected := pgtype.Circle{P: pgtype.Vec2{1, 2}, R: 1.5, Status: pgtype.Present} + expected := pgtype.Circle{P: pgtype.Vec2{1, 2}, R: 1.5, Valid: true} actual := expected err := conn.QueryRow( context.Background(), diff --git a/rows.go b/rows.go index d57d5cbf..539ce3a5 100644 --- a/rows.go +++ b/rows.go @@ -8,7 +8,7 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgproto3/v2" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) // Rows is the result set returned from *Conn.Query. Rows must be closed before diff --git a/stdlib/sql.go b/stdlib/sql.go index fa81e73d..20892ab3 100644 --- a/stdlib/sql.go +++ b/stdlib/sql.go @@ -64,8 +64,8 @@ import ( "time" "github.com/jackc/pgconn" - "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" + "github.com/jackc/pgx/v4/pgtype" ) // Only intrinsic types should be binary format with database/sql. diff --git a/values.go b/values.go index 1a945475..2978e5a3 100644 --- a/values.go +++ b/values.go @@ -8,7 +8,7 @@ import ( "time" "github.com/jackc/pgio" - "github.com/jackc/pgtype" + "github.com/jackc/pgx/v4/pgtype" ) // PostgreSQL format codes @@ -228,15 +228,15 @@ func encodePreparedStatementArgument(ci *pgtype.ConnInfo, buf []byte, oid uint32 // determination can be made. func chooseParameterFormatCode(ci *pgtype.ConnInfo, oid uint32, arg interface{}) int16 { switch arg := arg.(type) { - case pgtype.ParamFormatPreferrer: - return arg.PreferredParamFormat() + case pgtype.FormatSupport: + return arg.PreferredFormat() case pgtype.BinaryEncoder: return BinaryFormatCode case string, *string, pgtype.TextEncoder: return TextFormatCode } - return ci.ParamFormatCodeForOID(oid) + return ci.FormatCodeForOID(oid) } func stripNamedType(val *reflect.Value) (interface{}, bool) { diff --git a/values_test.go b/values_test.go index 6ae6c8a0..47aacf89 100644 --- a/values_test.go +++ b/values_test.go @@ -942,50 +942,50 @@ func TestEncodeTypeRename(t *testing.T) { }) } -func TestRowDecodeBinary(t *testing.T) { - t.Parallel() +// func TestRowDecodeBinary(t *testing.T) { +// t.Parallel() - conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE")) - defer closeConn(t, conn) +// conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE")) +// defer closeConn(t, conn) - tests := []struct { - sql string - expected []interface{} - }{ - { - "select row(1, 'cat', '2015-01-01 08:12:42-00'::timestamptz)", - []interface{}{ - int32(1), - "cat", - time.Date(2015, 1, 1, 8, 12, 42, 0, time.UTC).Local(), - }, - }, - { - "select row(100.0::float, 1.09::float)", - []interface{}{ - float64(100), - float64(1.09), - }, - }, - } +// tests := []struct { +// sql string +// expected []interface{} +// }{ +// { +// "select row(1, 'cat', '2015-01-01 08:12:42-00'::timestamptz)", +// []interface{}{ +// int32(1), +// "cat", +// time.Date(2015, 1, 1, 8, 12, 42, 0, time.UTC).Local(), +// }, +// }, +// { +// "select row(100.0::float, 1.09::float)", +// []interface{}{ +// float64(100), +// float64(1.09), +// }, +// }, +// } - for i, tt := range tests { - var actual []interface{} +// for i, tt := range tests { +// var actual []interface{} - err := conn.QueryRow(context.Background(), tt.sql).Scan(&actual) - if err != nil { - t.Errorf("%d. Unexpected failure: %v (sql -> %v)", i, err, tt.sql) - continue - } +// err := conn.QueryRow(context.Background(), tt.sql).Scan(&actual) +// if err != nil { +// t.Errorf("%d. Unexpected failure: %v (sql -> %v)", i, err, tt.sql) +// continue +// } - for j := range tt.expected { - assert.EqualValuesf(t, tt.expected[j], actual[j], "%d. [%d]", i, j) +// for j := range tt.expected { +// assert.EqualValuesf(t, tt.expected[j], actual[j], "%d. [%d]", i, j) - } +// } - ensureConnValid(t, conn) - } -} +// ensureConnValid(t, conn) +// } +// } // https://github.com/jackc/pgx/issues/810 func TestRowsScanNilThenScanValue(t *testing.T) {