Closed majimaccho closed 3 weeks ago
@majimaccho Thank you for your request!
I too agree that file naming by index is not the best way to determine file names.
The first requirement is that the filename in viewpoint must be unique along with the other table markdowns.
Secondly, I do not want to require users to enter values other than the information needed for the documentation of the schema.
The id
is information needed for tbls and has no effect on the documentation of the schema.
I want a solution that doesn't require unnecessary input from the user and that solves your problem.
@k1LoW Thank you for telling your idea.
The first requirement is that the filename in viewpoint must be unique along with the other table markdowns.
I agree with this point so I'm planning to do two things
id
value as unique one viewpoint
to file name as a prefix.Secondly, I do not want to require users to enter values other than the information needed for the documentation of the schema. The id is information needed for tbls and has no effect on the documentation of the schema.
I agree this point too.
My idea is to make id
of viewpoint optional and if it's not set the index is used for file name as it does currently.
So it would affect users who don't set id field of viewpoints.
Let me know what you think.
Would it be possible to solve your issue without entering an id
, if possible?
I prefer to have settings that are not relevant to the schema as much as possible.
In that case, how about adding option to the config to set viewpoint name as file name like this?
# .tbls.yml
viewpointNameAsFileName: true # default: false. use index as default
When this parameter is set, viewpoint name must be unique.
If your first idea, the validation to make it unique if the id is specified, runs, it does not seem to be necessary.
I want to have a better effect now with zero-configuration (even if it is not 100%).
I suppose there could be multiple options between complete zero-configuratin and no breaking change as below.
Less Configurations ↑
Less Breaking Changes ↓
As a user myself, 2. use viewpoint name as file name by default but could be modified if wanted
would make most sense since I want to have viewpoint name in Japanese but file name in English.
However, it goes richer configuration way than pure 1. use viewpoint name as file name
.
The way to modify file names could be id
or viewpointNameAsFileName
either ways.
I prefer it to be zero-config, but using name:
does not look good in Japanese.
I think we need to consider this a little more.
What if we can ignore non alpha-numeric string for file name?
Then, English users don't get affected and we can use it with zero config.
For example, when we have viewpoint nane: hogeほげ
filename could be viewpoint_hoge.md
.
The non alphanumeric part ほげ
is ignored.
Japanese-only patterns are likely to be common.
After thinking about this issue for a few days, in my perspective, the. first proposal seems the best solution for this issue.
If we cannot agree at this point I may close this issue.
Even if so, I can still use viewpoint by appending new one to existing list and sort in another PR that makes changes of each PR clear.
Hi. Big thank you as always for tbls and maintaining it.
It could be nicer if we can set custom names on each viewpoints.
This is because when I want to insert a new viewpoint above a existing viewpoint, all viewpoints under the new one renamed.
For example, when we have viewpoints like below,
then add add a new viewpoint right under viewpoint 1, all viewpoints below viewpoint 2 get renamed like below.
When viewpoint tbls.yaml would look like this.
I'm not sure
id
is the best name for this feature. If you have better naming or specs, I'm happy to listen to them. Thank you again!