Commit Graph

1899 Commits (a0028cbd0de2eb3c332aefff381bc7a852abb62c)

Author SHA1 Message Date
Pau Sanchez 9b58ab2db8 Make ScanArgError fields public 2021-02-20 08:43:57 -06:00
Jack Christensen 927a15124e Update supported versions 2021-02-13 10:59:00 -06:00
Pau Sanchez 8ad672475a Make ScanArgError public to allow identification of offending column
fixes #931
2021-02-13 08:56:11 -06:00
Jack Christensen 922508c785 Replace Travis with Github CI 2021-01-30 17:17:42 -06:00
Fabrice Aneche 14050e286d fix data map 2021-01-27 16:36:58 -06:00
Fabrice Aneche 9b59dd0346 added a kitlog level log adapter 2021-01-27 16:36:58 -06:00
davidsbond aa8604b5c2 Add Ping method to pgxpool.Conn
Adds the Ping method to pgxpool.Conn, returning the result of calling Ping on
the underlying pgx.Conn.
2021-01-26 20:46:57 -06:00
Robert Froehlich 210a217818 Add BeforeConnect callback to pgxpool.Config.
This allows for connection settings to be updated without having to create
a new pool. The callback is passed a copy of the pgx.ConnConfig and will
not impact existing live connections.
2021-01-02 15:08:59 -08:00
Musbah Sinno b664891853 Updated CopyFromSlice example in doc.go
The example had a syntax error and didn't explain what user was to begin with. Fixed it.
2020-12-23 10:42:48 -06:00
Jack Christensen fc4d50f6c2 Release v4.10.1 2020-12-19 10:18:49 -06:00
Jack Christensen 9b0e57c4a9 Fix panic on query error with nil stmtcache
fixes #895
2020-12-19 10:17:41 -06:00
Jack Christensen e8f959e0e1 Add QueryFunc
refs #821
2020-12-12 09:39:58 -06:00
Jack Christensen 0cbbf55dde Fix typo 2020-12-12 08:28:55 -06:00
Jack Christensen e14638e125 Release v4.10.0 2020-12-03 19:50:07 -06:00
Jack Christensen 8c7667376e Update dependencies 2020-12-03 19:43:27 -06:00
Jack Christensen 82bac82213 stdlib: consider any Ping failure as fatal
refs #672
2020-12-03 19:41:03 -06:00
Jack Christensen 0a2b67c5c5 CopyFromSlice should remember error 2020-12-02 09:32:01 -06:00
Egon Elbre e23c5bec24 add pgx.CopyFromSlice
Using CopyFromRows can often be inconvenient to use, because you would
need to convert a typed array to an [][]interface{}. Similarly,
implementing a custom CopyFromSource is too verbose for one-off things.

Add CopyFromSlice that allows to more easily convert a slice to a
CopyFromSource. Example:

    copyCount, err := conn.CopyFrom(
        context.Background(),
        pgx.Identifier{"people"},
        []string{"first_name", "last_name", "age"},
        pgx.CopyFromSlice(len(rows), func(i int) ([]interface{}, error) {
            return []interface{user.FirstName, user.LastName, user.Age}, nil
        }),
    )
2020-12-02 11:16:36 +02:00
Ethan Pailes 1df45d758d fix stmtcache invalidation
This patch fixes jackc/pgx#841. The meat of the fix lives
in [a PR to the pgconn repo][1]. This change just checks
for errors after executing a prepared statement and informs
the underlying stmtcache about them so that it can properly
clean up. We don't try to get fancy with retries or anything
like that, just return the error and allow the application to handle it.

I had to make [some][1] [changes][2] to to the jackc/pgconn package as well
as this package.

Fixes #841

[1]: https://github.com/jackc/pgconn/pull/56
[2]: https://github.com/jackc/pgconn/pull/55
2020-11-12 08:15:13 -05:00
Jack Christensen 93c6b60429 Explicityly state pgxpool's concurrency-safety
refs #866
2020-11-09 17:01:51 -06:00
Jack Christensen eeaa26abee Release v4.9.2 2020-11-03 19:24:54 -06:00
Jack Christensen d660c48ffc Upgrade pgconn to 1.7.2 to fix slice capacity issue
fixes #859
2020-11-03 19:23:01 -06:00
Jack Christensen 9898beaa2d Release v4.9.1 2020-10-31 17:36:36 -05:00
Jack Christensen 59a40dbf84 Upgrade pgconn and pgtype 2020-10-31 17:30:27 -05:00
Jack Christensen 7c47415150 Fix SendBatch of all prepared statements with statement cache disabled
fixes #856
2020-10-29 20:28:57 -05:00
Oleg Kovalov 5f8d853b34 remove unused definitions on conn.go 2020-10-12 08:13:52 -05:00
drpytho 0c145a3faa Add/Copy docstring from puddle 2020-10-06 09:04:33 -05:00
Oleg Kovalov 5ebf34e484 remove unused definitions on messages.go 2020-10-05 19:31:25 -05:00
Oleg Kovalov 557018a24e use simpler strings funcs 2020-10-05 19:26:33 -05:00
Jack Christensen 2a8ae6f269 Release v4.9.0 2020-09-26 11:58:01 -05:00
Jack Christensen f23bd4824d Upgrade pgtype to v1.5.0 2020-09-26 11:56:52 -05:00
Jack Christensen 3e9614fdb4 Upgrade pgconn to v1.7.0 2020-09-26 11:56:52 -05:00
Jack Christensen f9204b4c10 Upgrade puddle to v1.1.2 2020-09-26 11:56:52 -05:00
Harmen 040df1ccef fix link to 'pgtype' repo 2020-09-10 09:30:26 -05:00
Jack Christensen a8abb80082 Update CI Go versions 2020-09-05 13:26:19 -05:00
Jack Christensen d4a300bd58 Fix: FieldDescriptions are available on Rows before calling Next 2020-09-05 13:24:57 -05:00
Jack Christensen 2ec377350b Update Rows.Scan documentation to reflect reality.
Previously, the Scan documentation stated that scanning into a []byte
will skip the decoding process and directly copy the raw bytes received
from PostgreSQL.

This has not been true for at least 2 months. It is also undesirable
behavior in some cases such as a binary formatted jsonb. In that case
the '1' prefix needs to be stripped to have valid JSON. If the raw
bytes are desired this can easily be accomplished by scanning into
pgtype.GenericBinary or using Rows.RawValues.

In light of the fact that the new behavior is superior, and that it has
been in place for a significant amount of time, I have decided to
document the new behavior rather than change back to the old behavior.
2020-09-05 11:26:19 -05:00
Jinzhu 5b06f03d0a Fix SimpleProtocol with prepared statement 2020-08-31 17:06:36 -05:00
Jack Christensen 43ce317556 Plan scans even if destination is nil
fixes #810
2020-08-21 18:34:52 -05:00
Jack Christensen 997a16dbc5 Update pgconn for renamed CleanupChan 2020-08-20 22:09:50 -05:00
Jack Christensen 39b096d01e pgxpool waits for connection cleanup to finish before making room in pool
refs #679
2020-08-20 22:04:56 -05:00
Jack Christensen e9579e6249 Release v4.8.1 2020-07-29 22:19:49 -05:00
Jack Christensen cce1d671f4 Update pgconn to v1.6.4 2020-07-29 22:18:05 -05:00
Jack Christensen b8c5857880 Release v4.8.0 2020-07-22 06:49:50 -05:00
Jack Christensen 4ebf1d2e0b Passthrough all parameters directly to pgx 2020-07-18 08:44:57 -05:00
Jack Christensen 42cbd0fa46 Release v4.7.2 2020-07-14 12:07:51 -05:00
Jack Christensen 47cc8bb43e Update pgconn and pgtype dependencies 2020-07-14 12:03:00 -05:00
Jack Christensen 9b480f4785 Terminate connection when Commit fails and leaves tx open
refs #787
2020-07-13 22:49:35 -05:00
Jack Christensen c8a9da960c Revert "stdlib: close connection on Tx commit or rollback that doesn't end Tx"
This reverts commit 2583134306.

This fix should actually be on the main Tx implementation.
2020-07-13 22:48:28 -05:00
Jack Christensen 2583134306 stdlib: close connection on Tx commit or rollback that doesn't end Tx
refs #787
2020-07-13 22:40:42 -05:00