-
Notifications
You must be signed in to change notification settings - Fork 77
Add support for catalog roles #144
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
|
@Flgado would you like to get back to this? |
|
@nineinchnick Sure! I’m a bit busy these days, but I can pick this up in the next few days. 👍🏻 |
|
@nineinchnick, do we want to support the X-Trino-Role header when it's provided as a named argument? For example: db.Query("SELECT * FROM foobar WHERE id = ?", 1, sql.Named("X-Trino-Role", ...)) If so, that should overwrite the roles on the connection string ? |
|
We can allow it, and it's not a security concern. The same program that creates the db connection executes the queries. It would be a good workaround for the unsupported |
79b3a4c to
5eef69f
Compare
|
@nineinchnick can you take a look ? |
719068d to
e89b499
Compare
b36a42d to
b7bde9b
Compare
This PR adds support for specifying catalog roles in the Trino Go client via both the DSN string and the
Configstruct. Roles are passed as either:map[string]stringmapping catalogs to roles (e.g.{"hive": "analyst", "system": "admin"})The roles are URL-encoded and appended to the DSN as a colon-separated list of
catalog=ROLE{role}entries.Example
using directly the dns connection