-
Notifications
You must be signed in to change notification settings - Fork 24
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
Changing the Env Prefix separator to be configurable #122
Comments
Single underscore might work in isolated and controlled environment, but it does not work at large scale with more complex names. Let me show you. For example, let's say we have database With env_prefix it is the same. For example, let's say we have databases Another problem is parsing of identifiers. Double undrescore can be used to split complex identifier into multiple parts and parse these identifiers reliably. With only single underscore parsing is not possible. Now the question is ... can we use some other characters? In theory, we could use
As far as I know, any other delimiter would force users to use double-quotes around identifiers, which ruins usability. I've tested various approaches to this problem, including configurable delimiter, but it simply did not work well enough. At this moment I am not aware of any other truly reliable options for multi-part identifiers. But I am happy to dicuss it and adapt if community finds a better option eventually. |
I definitely understand the parsing of identifiers argument, that wasn't something that I had taken into consideration. I can see how in a larger environment that there could be name clashes where you have similar names for different parts of the identifier, especially in the case of a mono-repo. In the use case i'm envisioning for my team, we would be using the tool to manage databases independently of each other instead of having a mono-repo with everything in it, so the name overlaps don't seem like that large of an issue for us, additionally we currently try to avoid using the names of developers when we create things, preferring ID's instead of names. We have been looking for a DCM tool for our snowflake environment, and this tool seems to be one of the better options out there. Our biggest challenge is that we have a lot of existing pieces that we have to consider and the double underscore identifier requirement is really the only limiting factor for us adopting this tool. |
Could you tell a little bit more about specific use case? Is it like this:
Or is it closer to this:
Maybe there is no need for env_prefix, and natural database names can be used instead. The process which applies config can collect folders from individual develoeprs or other stake holders, merge everything together and apply in one go. It might be a better option due to:
Env prefix is mainly for debugging and short-lived disposable dev environments. It is primarily intended to prevent name clashing. |
Apologies for the delay in response. So what we want is to have the same database name across environments, but prefixed with the environment name. We use names like this in our environment:
Almost all of our databases follow this naming scheme where we have an environment prefix in the front. |
@brendanodwyer , I'll try to add this option in the next major update. Current protections around |
@brendanodwyer , please check version I've added CLI option
Alternatively, ENV variable I suspect there is some risk in using single underscore, but SnowDDL ownership checks should protect from most obvious problems. Please give it a try and let me know if it suits your needs. |
Ok, I'll give it a shot and let you know. |
Is your feature request related to a problem? Please describe.
It's not related to a problem but more of a design decision. Currently the tool enforces double underscores for separating environment prefixes and roles names.
This enforces the database names and roles to follow a specific naming standard to be able to use the tool, which is awesome by the way, but a lot of environments don't follow this standard.
Describe the solution you'd like
I would like to have an optional command line flag, something like
--identifier-separator
or--env-separator
that we could supply that would use a different default separator.Our environment and previous environments I have worked in that use snowflake have almost always used a single underscore for separation, so it would be awesome to have support for this.
Describe alternatives you've considered
Forking the codebase entirely and adding in the changes, but this seems like overkill. This seems like a configuration detail that could be opted into by development teams that would make the tool more flexible and get more adoption.
The text was updated successfully, but these errors were encountered: