-
Notifications
You must be signed in to change notification settings - Fork 9
More changes regarding hasura config #5
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
|
Regarding this code: // ConnectionInfo -
type ConnectionInfo struct {
UsePreparedStatements bool `json:"use_prepared_statements"`
IsolationLevel string `json:"isolation_level"`
DatabaseUrl DatabaseUrl `json:"database_url,omitempty"`
}
// DatabaseUrl -
type DatabaseUrl string
// DatabaseUrlFromEnv -
type DatabaseUrlFromEnv struct {
FromEnv string `json:"from_env"`
}
// UnmarshalJSON -
func (d *DatabaseUrl) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err == nil {
*d = DatabaseUrl(s)
return nil
}
var fromEnv DatabaseUrlFromEnv
if err := json.Unmarshal(data, &fromEnv); err != nil {
return err
}
*d = DatabaseUrl(fromEnv.FromEnv)
return nil
}I think that's broken? From env is not a connection string, it's just an environment variable name? Maybe I'm wrong, but when you serialise that, you'll get which will break your hasura config. I think I'll just revert that to |
|
I also removed the |
|
I don't think that removing anything is a good idea. I has already fixed database_url in previous commit |
Heya, I'm not sure that's good way to handle this. Imagine this case:
The point of my PR is to not touch, modify or overwrite other services hasura config, as far as that's possible. Imo it should either be a union of string, FromEnv and ConnectionParams or simply |
I'm sorry to be late with the reply. I think that's not problem because different services has to use different environment variables. You should manipulate your connection string by env variables according to hasura docs. But in my opinion we should implement marshaling of |
Yes, but your change breaks this.
Ok, works for me. |
|
Regardless of your FromEnv change being somewhat broken, I'd appreciate if you merged this and the accompanying metadata PR, simply so I don't need to keep them up to date with other changes to master. Thanks. |
|
LGTM |
No description provided.