2
0

rename ConnStr -> ConnString

This commit is contained in:
georgysavva
2020-05-16 19:24:57 +03:00
parent 7c73e608ff
commit 33cbec368f
4 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -69,7 +69,7 @@ func (cr *connResource) getPoolRows(c *Conn, r pgx.Rows) *poolRows {
type Pool struct {
p *puddle.Pool
connStr string
connString string
afterConnect func(context.Context, *pgx.Conn) error
beforeAcquire func(context.Context, *pgx.Conn) bool
afterRelease func(*pgx.Conn) bool
@@ -142,7 +142,7 @@ func ConnectConfig(ctx context.Context, config *Config) (*Pool, error) {
}
p := &Pool{
connStr: config.ConnConfig.ConnStr,
connString: config.ConnConfig.ConnString,
afterConnect: config.AfterConnect,
beforeAcquire: config.BeforeAcquire,
afterRelease: config.AfterRelease,
@@ -371,8 +371,8 @@ func (p *Pool) AcquireAllIdle(ctx context.Context) []*Conn {
return conns
}
// ConnStr returns the connection string that was used to initialize this pool.
func (p *Pool) ConnStr() string { return p.connStr }
// ConnString returns the connection string that was used to initialize this pool.
func (p *Pool) ConnString() string { return p.connString }
func (p *Pool) Stat() *Stat {
return &Stat{s: p.p.Stat()}
+1 -1
View File
@@ -17,7 +17,7 @@ func TestConnect(t *testing.T) {
connStr := os.Getenv("PGX_TEST_DATABASE")
pool, err := pgxpool.Connect(context.Background(), connStr)
require.NoError(t, err)
assert.Equal(t, connStr, pool.ConnStr())
assert.Equal(t, connStr, pool.ConnString())
pool.Close()
}