-
Notifications
You must be signed in to change notification settings - Fork 2
feat: initial commit #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| */ | ||
| public function getQuery(): ?string | ||
| { | ||
| return $this->query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some more complex use cases we might want to add something like getParam to get a specific value from the query string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great idea!
I've implemented the getParam function. Should it also accept a default value that can be returned if the key does not exist? If yes should we assume this type of the default value to be a string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a string default makes a lot of sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
This library should definitely stay focused on the DSN protocol and not have any specific references. Actually, I think the DNS format is powerful enough and don't really see the need in specific methods for specific use cases. I think our specific Utopia lIbraries should avoid using this library as a direct dependency. Our servers that need to have different connections can use this library to connect env vars to different utopia adapters that are using some kind of a connection. |
Adds support for a new DSN class that allows us to easily parse and manage Data Source Names.
Open questions
getDatabase(),getRegion(),getBucket()etc. What would be an ideal place to add these ? Within this library or in the consuming client ?