1208 Commits

Author SHA1 Message Date
Valery Krivchikov
0468c97a7e Fix undefined cancel 2018-09-15 14:27:29 +03:00
Valery Krivchikov
c844a2402b Call context.WithTimeout cancel function 2018-09-15 13:23:09 +03:00
Jack Christensen
e44f0f24c4
Merge pull request #454 from regeda/macaddr-array
macaddr array is introduced
2018-09-01 22:46:13 -04:00
Jack Christensen
5deea5b971 Convert driver.Valuer's earlier in bind path
fixes #449
2018-09-01 21:37:16 -05:00
Jack Christensen
302c74f214 Fix: do not silently ignore assign NULL to *string
AssignTo can only assign NULL to a **string. Previous code tried to
assign nil to a *string, which did nothing. Correct behavior is to
detect this as an error.
2018-09-01 18:40:42 -05:00
Anthony Regeda
b0702cf2b1
macaddr-array macaddr array is introduced 2018-09-01 16:06:20 +03:00
Jack Christensen
aa561b8f3c
Merge pull request #438 from ikitiki/text-copy
Add CopyFromReader and CopyToWriter methods
2018-08-11 09:25:36 -05:00
Murat Kabilov
4e9a696434 addressing the comments
add copy methods to the Tx struct
2018-08-07 23:44:02 +03:00
Jack Christensen
89f1e6ac72 Update changelog v3.2.0 2018-08-07 09:28:28 -05:00
Murat Kabilov
5315995dfa Add *Conn. CopyFromTextual, CopyToTextual, which use textual format for copying data 2018-07-31 08:57:53 +02:00
Jack Christensen
93ee40e691
Merge pull request #436 from ikitiki/fix-config-merge
Mind PreferSimpleProtocol parameter in the config Merge method
2018-07-24 09:53:07 -05:00
Murat Kabilov
d9f21d02a5 mind PreferSimpleProtocol parameter in the config Merge method 2018-07-24 16:03:26 +02:00
Jack Christensen
b8832c26d4 Fix go vet issue 2018-07-14 11:49:48 -05:00
Jack Christensen
20c02acd63 Fix deadlock when CopyFromSource panics
fixes #433
2018-07-14 11:26:09 -05:00
Jack Christensen
3cbe92ebb5 Merge branch 'james-lawrence-implement-opendb' 2018-07-14 09:58:35 -05:00
Jack Christensen
0a483bad9d Merge branch 'implement-opendb' of https://github.com/james-lawrence/pgx into james-lawrence-implement-opendb 2018-07-14 09:57:49 -05:00
Jack Christensen
39bbc98d99 Do not use same tls.Config for fallback in test 2018-06-08 15:19:56 -05:00
Jack Christensen
31d6f038d3 Merge branch 'dvic-improve-decode-error-msg' 2018-06-08 15:16:41 -05:00
Jack Christensen
368d06ece1 Merge branch 'improve-decode-error-msg' of https://github.com/dvic/pgx into dvic-improve-decode-error-msg 2018-06-08 15:16:09 -05:00
Jack Christensen
7b6f0ffc8c Fix race in TLS tests 2018-06-08 15:14:45 -05:00
Damir Vandic
fa045b7a4b Add the type of the value in all decode error messages 2018-06-04 21:02:20 +02:00
Jack Christensen
8707449219 Merge branch 'tarikdemirci-master' 2018-05-17 16:45:46 -05:00
Jack Christensen
a6ac63930a Merge branch 'master' of https://github.com/tarikdemirci/pgx into tarikdemirci-master 2018-05-17 16:45:32 -05:00
Jack Christensen
e04f5443d5 Fix test with formatting directive 2018-05-17 16:45:01 -05:00
Jack Christensen
6044dcbe21 Fix race in TLS test 2018-05-17 16:43:15 -05:00
Tarik Demirci
1149b0f015
Allow setting nil to pgtype.Bool 2018-05-17 12:22:48 +02:00
Jack Christensen
f42b0f65fc Commit and rollbase need not check for failure state 2018-05-12 19:59:12 -05:00
Jack Christensen
f114ec85a1 Allow recovery from failed transaction
rollback to savepoint can recover a failed transaction. Therefore we
shouldn't block any activities while the transaction is broken. Instead
we only have the Tx.Status() method return the information.

refs #421
2018-05-12 19:53:53 -05:00
Jack Christensen
e096a14b3e Return proper error in Tx.CopyFrom when tx has failed 2018-05-12 10:33:42 -05:00
Jack Christensen
7181a0b52c Use Tx.Status() internally catch failed transactions 2018-05-12 10:32:12 -05:00
Jack Christensen
6f1c5cc3e6 Tx.Status handles in transaction error
refs #421
2018-05-12 10:26:25 -05:00
Jack Christensen
26f6ae2c86
Merge pull request #415 from regeda/numeric_with_uint64
numeric array `AssignTo` supports both types int64 and uint64
2018-04-27 07:54:52 -04:00
Anthony Regeda
88c559bbcd
numeric_with_uint64 numeric array supports both types int64 and uint64 2018-04-24 16:31:31 +03:00
Jack Christensen
1fbd6977e1 Use json instead of jsonb for PG 9.3 compat. 2018-04-14 10:02:08 -05:00
Jack Christensen
8e9b095ce0
Merge pull request #410 from jbowens/acquireconn
stdlib: allow nested database/sql/driver.Drivers
2018-04-14 10:33:26 -04:00
Jack Christensen
5297846239 pgtype.JSON(B).Value now returns []byte
Allows scanning jsonb column into *json.RawMessage.

fixes #409
2018-04-14 09:17:56 -05:00
Jackson Owens
14f1f2aa01 stdlib: allow nested database/sql/driver.Drivers
database/sql/driver.Driver implementations can be nested, with each
layer adding additional functionality. If pgx/stdlib.Driver is wrapped
in another driver.Driver implementation, AcquireConn will error,
detecting that the *sql.DB's driver is not (directly) pgx.Driver.

It looks like it should be possible to support the current functionality
without requiring that the top-level Driver be pgx/stdlib.Driver, but
it requires using a global map of fakeTxConns instead of a per-Driver
map of fakeTxConns.

Is this reasonable?
2018-04-11 19:31:33 -07:00
James Lawrence
19a9154d23 implement driver.Connector 2018-04-08 11:12:15 -04:00
Jack Christensen
6556ef67cb Fix data race in domain handling 2018-04-07 14:26:26 -05:00
Jack Christensen
db7df79e10 Add domain support
fixes #407
2018-04-07 14:04:16 -05:00
Jack Christensen
b72ebe050f Fix fastpath / largeobjects query counting
fastpath.Call was not incrementing pendingReadyForQueryCount when it
sent a function call. But it was being decremented when the function
call was finished and the server sent the ready for query message. This
caused pendingReadyForQueryCount to go negative. This meant that any
subsequent activity that depended on ensureConnectionReadyForQuery would
not operate correctly because the connection would be considered ready
before it had read all previous data off the wire.

fixes #403
2018-03-31 11:11:48 -05:00
Jack Christensen
8ce528626e
Merge pull request #400 from cheapRoc/f-zerolog
Add zerolog logging adapter
2018-03-24 10:18:36 -05:00
Justin Reagor
5819bc8fb1 Small typo 2018-03-21 00:25:14 -04:00
Justin Reagor
6429fb5bf7 Add github.com/rs/zerolog to Travis 2018-03-20 15:48:19 -04:00
Justin Reagor
cb72072f8d Add zerolog logging adapter 2018-03-19 22:40:13 -04:00
Jack Christensen
b6bdf5f89b Update changelog 2018-03-17 10:28:34 -05:00
Jack Christensen
cb4431028c Fix precision loss for test format geometric types
fixes #399
2018-03-17 10:26:03 -05:00
Jack Christensen
a07b87eb8b Skip line test of PG 9.3 2018-03-08 08:05:54 -05:00
Jack Christensen
b0c9bbbf71 Update shopspring decimal integration test
New version of shopspring/decimal improves precision. This broke a test.
2018-03-08 07:40:25 -05:00
Jack Christensen
b931b56bf6 Document edge case with renamed types
fixes #393
2018-03-03 14:09:49 -06:00