PyDBML icon indicating copy to clipboard operation
PyDBML copied to clipboard

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

Open pepperlk opened this issue 1 year ago • 3 comments

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.

pepperlk avatar Apr 25 '24 19:04 pepperlk

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

Vanderhoof avatar May 07 '24 18:05 Vanderhoof

Love this.

big-c-note avatar Jun 25 '24 11:06 big-c-note

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

Docs

Vanderhoof avatar Jul 25 '24 20:07 Vanderhoof