Require conn and pool configs to be created by ParseConfig
This simplifies handling default values. Now there is no ambiguity between a zero value and a default value. All default values are set by ParseConfig and the user can modify them after the initial creation. fixes #567
This commit is contained in:
@@ -39,6 +39,14 @@ func TestConnectCancel(t *testing.T) {
|
||||
assert.Equal(t, context.Canceled, err)
|
||||
}
|
||||
|
||||
func TestConnectConfigRequiresConnConfigFromParseConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
config := &pgxpool.Config{}
|
||||
|
||||
require.PanicsWithValue(t, "config must be created by ParseConfig", func() { pgxpool.ConnectConfig(context.Background(), config) })
|
||||
}
|
||||
|
||||
func TestPoolAcquireAndConnRelease(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user