rename ConnStr -> ConnString
This commit is contained in:
+4
-4
@@ -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()}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user