-
Notifications
You must be signed in to change notification settings - Fork 8
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
Saving table positions to .vscode directory #63
Comments
@kiryasolod There are 2 possible solutions:
Do you have any ideas? |
I think the 2 way is still more preferred. I can see several options to save the association between position config file and the dbml
|
if you'll allow me to contribute: saving in .vscode is the most correct option, since the one that will handle the positioning is a VSCODE extension. So if someone else uses another IDE, nothing will be affected On the other hand, many companies/repositories do not version the .vscode because it is something personal, which will force the versioning of personal preferences to the repository Since DBML is not something extensible, it might be a good idea to use stick notes https://dbml.dbdiagram.io/docs/#sticky-notes. This will not interfere with other IDEs. It will not force the versioning of personal preferences, and it might open the way for other extensions and plugins to parse it One thing to think, is that any minimal change on position will change the file. What can cause alot conflicts. So may with separated file can be the way, because you can just discard changes and get new one from repository. About the name, i think its need to be fixed, like |
Hi @scorninpc It's perfectly fine if you would like to work on this issue. My initiate version is using comment feature from DBML to store position information directly in the file which I can also use it in the gitlab pipeline to publish another version to gitlab pages so that Business Users can view it without installing VSCode. |
Good to know this. I think this is the best world: My only problem is versioning. If a small move is made, the file will change. If someone else also makes a small move, it will change the same place in the file, which will cause conflicts. But I think this kind of problem should be resolved between the repository participants. Do you already have any code about this? |
There is one more problem in case if we add positioning information to dbml itself. For example, I don't make any modifications in dbml. I write migrations, then execute them in the DB, then I make SQL dump of the database structure, and then I convert SQL to dbml using sql2dbml utility. Of course in that case the dbml will be regenerated and all information about positioning will be gone. So that's why storing the coordinares in sepearate file would be preferred. Actually, I'm not sure that many people use dbml as the origin. I think, many people generate it just to get a graphical representation of the existing DB |
About the usage of DBML, I'm in the opposite side. In our project, we define schema in DBML and use it as single source of truth. In the pipeline, we migrate all tables if there schema changed. And I think Holistic - DBML maintainers also would like to use DBML as a single source of truth then build everything else around it. In addition, not only just positioning but other features like TableGroup, Note, Comments don't also work if you just export from SQL to DBML. But your concern is valid too. There're no perfect solutions if we just handle it within this extension. That's why even though I implemented it in our internal project (a customized version of this extension) but I don't apply it here. |
I am also using DBML with databasediagram.com. It stores position information in the DBML file as a comment and adds a "//POSITION..." line to the end of the DBML file. I am also generating DBML files with code, but it is easy to take the last line of the file edited with databasediagram.com and add it to a new file. From a versio control point of view, it is essential for me to link position information with the model. |
Is your feature request related to a problem? Please describe.
After I set the positions of all tables I cannot share them to my colleagues
Describe the solution you'd like
Instead of saving current table positions to LocalStorage of VSCode, I suggest to save them to .vscode/some_config_file to be able to add it to git repository. It would be great to associate a set of table positions with a specific dbml file path in case of several dbml files in the repository
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: