luckyframework / luckyframework/avram
Allow `Avram::Credentials` to build unix sockets
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
If you need to build a unix socket, but want to use the Avram::Credentials object, it's a bit messy. I think we can make this easier to work with.
Here's an example of how to connect with a unix socket
# this ENV must be set otherwise it defaults to the current user's name on the system
# export PGDATABASE=my_db_development
Avram::Credentials.parse("postgresql:///my_db_development?host=/var/lib/postgresql/.s.PGSQL.5432&dbname=my_db_development")
I think you can also set a username and password using
Avram::Credentials.parse("postgresql://user:pass@/my_db_development?host=/var/lib/postgresql/.s.PGSQL.5432&dbname=my_db_development")
We would just need to make sure these methods account for the change
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/avram/migrator/runner.cr lines 49-59 and inspect how Avram::Credentials.parse handles the PostgreSQL examples in the issue. Trace the methods used to build the connection and update the relevant behavior so credentials work with unix socket URLs. Done means the shown socket connection forms are supported, including optional username and password.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal, postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100