Skip to content

Commit

Permalink
Only url.QueryEscape() username and password (#1537)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Only call `url.QueryEscape` on `username` and `password`. At present
we format out the `=` and other characters in the string so the
connection doesn't work.

## Test plan
*How are these changes tested?*

- [ ] Built and ran locally

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
  • Loading branch information
beggers authored Dec 15, 2023
1 parent c120b5a commit 0214259
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/coordinator/internal/metastore/db/dbcore/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type DBConfig struct {
}

func Connect(cfg DBConfig) (*gorm.DB, error) {
dsn := url.QueryEscape(fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d",
cfg.Address, cfg.Username, cfg.Password, cfg.DBName, cfg.Port))
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d",
cfg.Address, url.QueryEscape(cfg.Username), url.QueryEscape(cfg.Password), cfg.DBName, cfg.Port)

ormLogger := logger.Default
ormLogger.LogMode(logger.Info)
Expand Down

0 comments on commit 0214259

Please sign in to comment.