370 Commits

Author SHA1 Message Date
Jack Christensen
5cb98120c1 Add tests for big time and port fix to Timestamp.DecodeBinary
https://github.com/jackc/pgtype/pull/128
2021-10-23 09:57:10 -05:00
Jim Tsao
e28459e9d1 Fix int64 overflow error 2021-10-08 14:46:26 +02:00
Jan Dubsky
e53b7aebab Add support for fmt.Stringer and driver.Valuer in String fields encoding 2021-09-25 09:31:55 -05:00
Jack Christensen
0b5b7c0d1e Fix BPChar.AssignTo **rune
https://github.com/jackc/pgtype/issues/123
2021-09-25 09:25:01 -05:00
Jack Christensen
693c7c7f7d Fix NULL being lost when scanning unknown OID into sql.Scanner
https://github.com/jackc/pgx/issues/1078
2021-09-11 10:59:26 -05:00
Jack Christensen
90af821478 Remove old Travis CI code 2021-08-26 21:09:46 -05:00
Jack Christensen
30d7638296 Fix zeronull.Float8 2021-08-26 15:42:47 -05:00
Jack Christensen
39aa071b15 Add zeronull float8 2021-08-26 13:21:02 -05:00
Carl Dunham
94f8441f4e Fix #119: add support for bare IP address as input for Inet 2021-08-12 17:50:31 -05:00
Eli Treuherz
db84905b7f Add NullDecimal to shopspring-numeric
The shopspring/decimal package provides a NullDecimal struct intended
for use with nullable SQL NUMERICs and numbers. It has Scanner and
Valuer implementations already, but adding it to this package allows
it to be used with the binary encoding as well.

The implementation is very straightforward, but the tests have been made
slightly more complicated. The previous version wasn't testing the
decimal.Decimal cases, and this change adds those as well as new
NullDecimal cases. I've added some logic to the test harness to catch
these as you need to use the Equals method to properly compare Decimals.
2021-08-07 08:23:02 -05:00
Jack Christensen
6bda09691d Fix hstore binary null decoding
Bug was advancing the read pointer by the length of the value even if it
was a NULL value. Since NULL is indicated by a -1 length it actually
decremented the read pointer.
2021-07-31 11:06:03 -05:00
Jack Christensen
e26c6b4e3d Release v1.8.1 2021-07-24 10:50:22 -05:00
Jack Christensen
377eed5d2f Cleaning go.sum 2021-07-24 10:48:07 -05:00
Jack Christensen
c16a4f7d6a Revert "Temporarily delete tests and pgxtype to break recursive dependency with pgx"
This reverts commit 32e20a603178b49fb189d1be971d0fb6960cabb2.
2021-07-24 10:40:30 -05:00
Jack Christensen
32e20a6031 Temporarily delete tests and pgxtype to break recursive dependency with pgx 2021-07-24 10:16:00 -05:00
Jack Christensen
7d0a620dda Upgrade pgx version used for tests 2021-07-24 09:20:54 -05:00
Jack Christensen
dcdc3eaec7 Release v1.8.0 2021-07-10 09:58:12 -05:00
Cameron Daniel
3eceab0f38 Maintain host bits for inet types 2021-07-06 19:59:41 -05:00
Jack Christensen
2ca304d461 pgtype.Inet preserves masked address portion
fixes #111
2021-06-26 10:49:56 -05:00
Sivabalan Thirunavukkarasu
2c22da0155 Bumping versions for other dependencies 2021-06-19 10:06:24 -05:00
Sivabalan Thirunavukkarasu
821e0521e4 Updating dependency versions 2021-06-19 10:06:24 -05:00
Ivan Daunis
5bca076182 Refactor to interface convert 2021-05-22 11:33:42 -05:00
Ivan Daunis
0977e29341 Support pointers of wrapping structs 2021-05-22 11:33:42 -05:00
Rueian
cae98b5e45
Register JSONBArray at NewConnInfo() 2021-05-03 22:20:58 +08:00
Jack Christensen
4380e23ae1 CompositeTextScanner handles backslash escapes
fixes https://github.com/jackc/pgx/issues/874
2021-04-24 08:08:34 -05:00
Jack Christensen
4a3a424dff Release v1.7.0 2021-03-25 09:16:43 -04:00
Jack Christensen
63e2dbefaf Update copyright date 2021-03-25 09:08:27 -04:00
Jack Christensen
dd160540c4 Use Go 1.13 errors instead of xerrors 2021-03-25 09:08:27 -04:00
drewdogg
aa89720576 go 1.13 2021-03-13 07:23:29 -06:00
Jack Christensen
0f1bda20b0 Fix numeric NaN support
fixes #93
2021-03-11 19:49:03 -06:00
Jack Christensen
abeb337246 Accept nil *time.Time in Time.Set 2021-02-20 09:28:14 -06:00
Stephane Martin
6830cc0984 Fix: also consider \r, \f, \t as whitespace (jackc/pgtype#86) 2021-01-14 18:10:48 -06:00
Stephane Martin
59b79a2e49 Fix: escaped strings when they start or end with a newline char (jackc/pgtype#86) 2021-01-14 18:10:48 -06:00
Vasilii Novikov
1e141d8c32 Add tsrange array type. 2021-01-09 09:40:43 -06:00
Jack Christensen
b23d41c399 Add CI badge 2020-12-28 13:11:36 -06:00
Jack Christensen
6e11216708 Yet another CI tweak 2020-12-28 13:02:34 -06:00
Jack Christensen
be67555d02 Another CI tweak 2020-12-28 12:56:41 -06:00
Jack Christensen
e2115310b7 More CI 2020-12-28 12:50:42 -06:00
Jack Christensen
ea92194719 Add PostgreSQL service to CI 2020-12-28 12:35:01 -06:00
Jack Christensen
97f8f6a25a
Begin CI with Github Actions 2020-12-28 12:22:56 -06:00
Jack Christensen
b77cee2a28 Fix scanning int into **sql.Scanner implementor
See https://github.com/jackc/pgx/issues/897.
2020-12-23 11:17:02 -06:00
Jack Christensen
880863b70a Release v1.6.2 2020-12-03 19:20:11 -06:00
Jack Christensen
7a47d60bbd Update missing changelog entries for v1.6.0 and v1.6.1 2020-12-03 19:18:40 -06:00
Jack Christensen
00d516f5c4 Fix panic on assigning empty array to non-slice or array
See https://github.com/jackc/pgx/issues/881
2020-11-27 11:56:21 -06:00
Jack Christensen
740b3a5115 Fix: Text array parsing disambiguates NULL and "NULL".
This solution is a little awkward, but it avoids breaking backwards
compatibility.

fixes #78
2020-11-07 07:41:49 -06:00
Jack Christensen
36a8da55cc Fix Timestamptz.DecodeText with too short text
fixes #74
2020-11-03 08:31:05 -06:00
Jack Christensen
af0ca3a39b Fix simple protocol empty array and original recursive empty array issue
Original issue https://github.com/jackc/pgtype/issues/68

This crash occurred in the recursive assignment system used to support
multidimensional arrays.

This was fixed in 9639a69d451f55456f598c1aa8b93053f8df3088. However,
that fix incorrectly used nil instead of an empty slice.

In hindsight, it appears the fundamental error is that an assignment to
a slice of a type that is not specified is handled with the recursive /
reflection path. Or another way of looking at it is as an unexpected
feature where []T can now be scanned if individual elements are
assignable to T even if []T is not specifically handled.

But this new reflection / recursive path did not handle empty arrays.

This fix handles the reflection path for an empty slice by allocating an
empty slice.
2020-10-31 17:12:16 -05:00
Jack Christensen
9d7fc8e63a AssignTo pointer to pointer to slice and named types
fixes #69
2020-10-24 09:21:42 -05:00
Simo Haasanen
9639a69d45 Adds checks for zero length arrays.
Assigning values from nil or zero length elements or dimensions now return immediately as there are no values to assign.
2020-10-20 19:52:05 +01:00
Tomas Volf
e92478ec70
Fix Inet.Set to handle nil net.IP correctly
When nil IP is returned from net.ParseIP, it is accepted into Inet type,
but not properly marked as being Null. That introduces issues later on
when calling for example EncodeBinary, since it does not assume this can
happen.

This commit resolves that by properly detecting zero-length net.IP and
setting status to Null if that is the case.
2020-10-13 15:26:09 +02:00