Skip to content
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

Add dynamic options to the [ ] settings for all objects. #37

Open
pepperlk opened this issue Apr 25, 2024 · 3 comments
Open

Add dynamic options to the [ ] settings for all objects. #37

pepperlk opened this issue Apr 25, 2024 · 3 comments

Comments

@pepperlk
Copy link

I would like to add dynamic context to the Table and Columns to better define a data model for metadata.

When parsing is working can the unknown items be put in a dictionary to be accessed for other processes wishing to extend DBML.

example:
Table ACCOUNT [note: "Account", description:"account", cdm_table: "account", generator: "<randomstring>"] { }
then when parsed this is available
parsed.tables[0].settings["cdm_table"]

This would allow extension of the objects in the parser dynamically for arbitrary data that is not needed for database scripting.

@Vanderhoof
Copy link
Owner

That's actually a nice idea.

Although I'd only allow this with a special flag explicitly specified in the parser object, something like PyDBML('myfile.dbml', allow_extra=True), with allow_extra being False by default. Otherwise we could break compatibility for the future DBML syntax versions.

I'll look into it, thanks for the suggestion

@big-c-note
Copy link
Contributor

Love this.

@Vanderhoof
Copy link
Owner

Vanderhoof commented Jul 25, 2024

@pepperlk It took a while but it's out. Please see version 1.1.0

Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants