It could be great if data from Project element could be added to the exportation file as initial comments or something. Extra data fields could be:
- Title
- Version
- Author
- Code repository (?)
- Tags
- Any other field that could improve model version tracking, documentation and managing.
This idea is quite interesting.
Can you elaborate on your idea and show us some expected use cases or scenarios? How can it benefit your workflow in general and the dbdiagram’s usage in particular?
Hi, for sure!
For example, for the project information:
Project my_project {
// database_type: 'PostgreSQL' // maybe useful when export command not defines db language output
title: 'The project title'
note: 'This note is not been exported indeed'
version: '1.0.0'
author: 'Rodrigo Olivares <rodrigo.olivares@basedos.cl>'
repository: 'https://rolivares_basedos@bitbucket.org/basedos/repository.git'
tags: [ tag1, tag2 ]
}
Nowadays exporting to SQL using @dbml/cli does not add any information from Project information to exported file. Here an example.
-- SQL dump generated using DBML (dbml-lang.org)
-- Database: SQL Server
-- Generated at: 2023-08-23T13:11:41.196Z
Using Project information the header sql script file could be like:
-- Project: The project title
-- Version: 1.0.0
-- Description: This note is not been exported indeed
-- Author: Rodrigo Olivares <rodrigo.olivares@basedos.cl>
-- Repository: https://rolivares_basedos@bitbucket.org/basedos/repository.git
-- Tags: #tag1 #tag2
-- SQL dump generated using DBML (dbml-lang.org)
-- Database: SQL Server
-- Generated at: 2023-08-23T13:11:41.196Z
Hi rolivares,
Thank you for the suggestion. This would be a nice addition to the exported SQL. We’ll consider supporting it in the future.
Have a good day!
1 Like