Jack Christensen
e5685a34fc
Simplify encoding extended query arguments
2022-03-05 20:16:57 -06:00
Jack Christensen
1cef9075d9
Simply typed nil and driver.Valuer handling
...
* Convert typed nils to untyped nils at beginning of encoding process.
* Restore v4 json/jsonb null behavior
* Add anynil internal package
2022-03-05 19:53:59 -06:00
Jack Christensen
2885b039d5
Rename Uint32 field to include bit size
...
i.e. Uint renamed to Uint32. This matches the pattern set by the
database/sql types.
2022-03-05 09:23:25 -06:00
Jack Christensen
84a3d91322
pgtype Float4 and Float8 fields include bit size
...
e.g. Instead of Float it is Float64. This matches the pattern set by the
database/sql types.
2022-03-05 09:20:03 -06:00
Jack Christensen
d723a4ab6f
pgtype Int2, Int4, and Int8 fields include bit size
...
e.g. Instead of Int it is Int64. This matches the pattern set by the
database/sql types.
2022-03-05 09:17:31 -06:00
Jack Christensen
872a7a9315
Fix pgtype/int.go.erb
2022-03-05 09:08:14 -06:00
Jack Christensen
e7f90ba6e4
Remove unused pgtype.Map field
2022-03-05 09:00:49 -06:00
Jack Christensen
ec8f7c4204
Add comment for FormatCodeForOID
2022-03-05 08:56:41 -06:00
Jack Christensen
45a8b00271
Do not recursively call public PlanScan that caches
...
Otherwise, wrapper types get cached. Wrapper types are expected to fail
most of the time. These failures should not be cached. In addition,
wrappers wrap multiple different types so it doesn't make sense to cache
results of a wrapper.
2022-03-04 11:04:46 -06:00
Jack Christensen
a8f6674a07
TextCodec specifically supports scanning to BytesScanner
...
This lets it support DriverBytes and PreallocatedBytes.
2022-02-26 20:28:15 -06:00
Jack Christensen
ffc5a692cb
Detect unsafe pgtype.DriverBytes usage
...
Add test for unsafe usage and test for correct usage that ensures driver
memory is actually used.
2022-02-26 20:23:35 -06:00
Jack Christensen
d13f651810
Finish importing pgio as internal package
2022-02-21 14:35:20 -06:00
Jack Christensen
43083cb0e3
Memoize pgtype.Map.PlanScan
2022-02-21 10:10:16 -06:00
Jack Christensen
9c538cd4a9
Remove actualTarget argument
2022-02-21 09:30:01 -06:00
Jack Christensen
f3defbc150
Rename pgtype.None to pgtype.Finite
2022-02-21 09:25:30 -06:00
Jack Christensen
1f2f239d09
Renamed pgtype.ConnInfo to pgtype.Map
2022-02-21 09:13:09 -06:00
Jack Christensen
bda10b2ec9
Rename pgtype.DataType to pgtype.Type
2022-02-21 09:01:48 -06:00
Jack Christensen
a3c351d11a
RegisterDataType now accepts *DataType
2022-02-21 08:49:04 -06:00
Jack Christensen
f861d83a17
Fix range types not clearing unbounded or empty
2022-02-08 16:48:17 -06:00
Jack Christensen
0306ce3a19
Fix scanning negative ints into Int64Scanner
2022-02-08 14:13:06 -06:00
Jack Christensen
1334d45d71
Parse array header to empty slices instead of nils
2022-02-08 11:35:40 -06:00
Jack Christensen
bcc0af3f56
Fix scan empty array into multi-dimension slice
2022-02-08 11:12:05 -06:00
Jack Christensen
7193e48923
Restore multi-dimensional slices
...
Move ArrayCode to use pgtype wrapper pattern as well
2022-02-08 10:07:40 -06:00
Jack Christensen
02372f1c3c
Add DecodeValue to composites
2022-02-05 15:12:09 -06:00
Jack Christensen
3a94113118
Add composite to arbitrary struct encoding and decoding
2022-02-05 14:24:34 -06:00
Jack Christensen
727fc19cb7
Another error message improvement
2022-02-05 13:10:58 -06:00
Jack Christensen
28ea2cd190
Better error messages
2022-02-05 13:05:23 -06:00
Jack Christensen
6ebf54b62b
Fix EnumCodec caching and add tests
2022-02-05 09:57:40 -06:00
Jack Christensen
288080c58c
Add test documenting typed nil json encoding
...
Encoded into json null not SQL NULL.
2022-02-05 09:34:39 -06:00
Jack Christensen
0355d2ffea
Add Float8range
...
PostgreSQL doesn't define float8range out of the box though it can
easily be created by the user. However, it is still convenient to treat
a numrange as a float8range.
2022-02-05 08:54:38 -06:00
Jack Christensen
a74ebc9e51
pgtype.Numeric implements Float64Valuer
2022-02-05 08:39:53 -06:00
Jack Christensen
a280f4db8a
Float4 and Float8 implement Int64 Scanner and Valuer
2022-02-03 20:19:52 -06:00
Jack Christensen
ba4583cf4c
Add range array types
2022-02-02 08:47:56 -06:00
Jack Christensen
cebe44ee85
Restore range support
2022-02-02 08:40:42 -06:00
Jack Christensen
11223497b3
Restore record support
2022-01-31 20:42:12 -06:00
Jack Christensen
ef7114a8ce
Add DecodeValue and DecodeDatabaseSQLValue for ArrayCodec
2022-01-31 20:39:50 -06:00
Jack Christensen
558748ef9c
ArrayCodec contains element DataType
2022-01-29 16:41:07 -06:00
Jack Christensen
b5bf9d7bb9
Move LoadDataType to pgx.Conn
2022-01-29 16:32:05 -06:00
Jack Christensen
f5c3eeb813
Initial rebuilt composite support
2022-01-29 15:43:18 -06:00
Jack Christensen
dc77e7c2da
Add QueryRow warning to DriverBytes
2022-01-29 08:17:50 -06:00
Jack Christensen
47345e0d1e
ArrayHeader.EncodeBinary doesn't need ci parameter
2022-01-25 20:21:28 -06:00
Jack Christensen
551d26ca41
Change ArrayHeader.ElementOID to uint32
2022-01-25 20:19:02 -06:00
Jack Christensen
0ddf9e3b4b
Try wrapping scan target before sql.Scanner
...
This allows wrappers to directly avoid the slow sql.Scanner interface.
2022-01-22 18:40:46 -06:00
Jack Christensen
5ed95dcd1c
Expose wrap functions on ConnInfo
...
- Remove rarely used ScanPlan.Scan arguments
- Plus other refactorings and fixes that fell out of this change.
- Plus rows Scan now handles checking for changed type.
2022-01-22 17:50:19 -06:00
Jack Christensen
322bfedc60
Remove old SQL scanner integration
2022-01-22 16:20:37 -06:00
Jack Christensen
aedf7d63e5
Expose try wrap functions in ConnInfo
2022-01-22 16:19:32 -06:00
Jack Christensen
2b395f3730
pgtype.DataType.Codec can never be nil
2022-01-22 12:21:16 -06:00
Jack Christensen
db95cee40c
Remove pgtype.Value interface
2022-01-22 12:18:40 -06:00
Jack Christensen
4cf6dc9447
Remove BinaryEncoder and TextEncoder
2022-01-22 12:16:02 -06:00
Jack Christensen
3a90c6c879
Removed TextEncoder and BinaryEncoder
...
Restructured / fixed a lot of tests along the way.
2022-01-22 12:07:35 -06:00