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
Suggestions : defining Headers constants as public and add split Config.PrestoURI into user & url #4
Comments
after reviewing golang url code, i take back second suggestion as URL schema has UserInfo. |
@losipiuk While I was working with query callback, I was wondering WDUT about this idea of changing header constants to public? Other headers that needs to be fixed are as following:
|
Ideally all the headers-related logic should be handled within the client library. |
Am not that experienced engineer so it may say seem to be silly questions, btw is defining constants considered part of rows, err := db.Query("SELECT current_user", sql.Named(PrestoUserHeader, string("TestUser"))) |
I think this is fine to pass extra configuration parameters via |
@losipiuk @nineinchnick Hi, I tagged you guys because I wanted to ask final question before closing this issue, opening headers as public constants like other client does, for convenience sake. |
I think the JDBC is the reference implementation. Python is not a good comparison, since you can't hide anything in Python anyway. I don't mind keeping this issue open so that we could wait for others to report actual use cases where they need to pass headers. I had one use case recently to set |
Awesome use-case! |
Mentioned in slack
I was wondering why header constant is not public. People would need to use such headers but they would have to define their constants so that it matches presto-go-client const (which is bothersome)
presto-cli defines as public variable.
It is sort of confusing because PrestoURI is made up of
default user
andserver addr
I think it would be better if we can split those two because URL consists of URL + user.
https://github.com/prestosql/presto-go-client/blob/master/presto/presto.go#L124
The text was updated successfully, but these errors were encountered: