-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
When I try to add a grant read on url
I'm settings:
- privilege_name = "READ"
- database_name = "URL(\"https://mydomain\\.com/x/y/.*\")"
- grantee_role_name = "myetl"
It will generate:
GRANT READ ON URL("https://mydomain\\.com/x/y/.*\").* TO myetl;
there is no way to avoid settings a table in that case.
The issue is here":
| } else { |
One possible solution is to avoid settings an table if the db starts with db like
// Target database/table
{
tokens = append(tokens, "ON")
if q.database != nil {
if q.table != nil {
tokens = append(tokens, fmt.Sprintf("%s.%s", backtick(*q.database), backtick(*q.table)))
} else {
tokens = append(tokens, fmt.Sprintf("%s.*", backtick(*q.database)))
}
} else if !strings.HasPrefix(*q.database, "URL(") {
tokens = append(tokens, "*.*")
}
}
Eventually, it's probably possible to do it in an hacky way like
- privilege_name = "READ"
- database_name = "URL(\"https://mydomain\\.com/x/y/"
- table_name = "*\")"
- grantee_role_name = "myetl"
Reactions are currently unavailable