Skip to content

Commit 7aec464

Browse files
author
Chris Hundt
committed
Address review comments
1 parent 43d9c3f commit 7aec464

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎pgutils/pgutils.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// Given a postgres connection string, generate a new one with the search path
1515
// (https://www.postgresql.org/docs/17/ddl-schemas.html#DDL-SCHEMAS-PATH)
1616
// set to just the given schema name.
17-
func GetConnectionStringWithSearchPath(connStr, schemaName string) (string, error) {
17+
func getConnectionStringWithSearchPath(connStr, schemaName string) (string, error) {
1818
kvconn := connStr
1919
if strings.HasPrefix(connStr, "postgres://") || strings.HasPrefix(connStr, "postgresql://") {
2020
var err error
@@ -41,7 +41,7 @@ func GetConnectionStringWithSearchPath(connStr, schemaName string) (string, erro
4141
// (https://www.postgresql.org/docs/17/ddl-schemas.html#DDL-SCHEMAS-PATH)
4242
// set to just the given schema name.
4343
func ConnectWithSchema(dbConnectionString, schemaName string) (*sqlx.DB, error) {
44-
connStringWithSearchPath, err := GetConnectionStringWithSearchPath(dbConnectionString, schemaName)
44+
connStringWithSearchPath, err := getConnectionStringWithSearchPath(dbConnectionString, schemaName)
4545
if err != nil {
4646
return nil, fmt.Errorf("Error getting updated connection string: %w", err)
4747
}
@@ -77,11 +77,11 @@ func getSchemaName(testName string) string {
7777
// (https://www.postgresql.org/docs/17/ddl-schemas.html#DDL-SCHEMAS-PATH)
7878
// It also registers a cleanup function (https://pkg.go.dev/testing#T.Cleanup)
7979
// that will drop the schema after the test completes.
80-
func ReconnectWithSchemaForTest(dbConnectionString string, t *testing.T) *sqlx.DB {
80+
func ConnectWithSchemaForTest(dbConnectionString string, t *testing.T) *sqlx.DB {
8181
// Create test schema and set search path
8282
schemaName := getSchemaName(t.Name())
8383

84-
connStringWithSearchPath, err := GetConnectionStringWithSearchPath(dbConnectionString, schemaName)
84+
connStringWithSearchPath, err := getConnectionStringWithSearchPath(dbConnectionString, schemaName)
8585
if err != nil {
8686
t.Fatalf("Error getting connection string: %s", err)
8787
}

0 commit comments

Comments
 (0)