Vanderhoof / PyDBML

DBML parser and builder for Python
MIT License
101 stars 12 forks source link

Fix missing headercolor setting in Table dbml generation #32

Closed tristangrebot closed 7 months ago

tristangrebot commented 7 months ago

During my experimentations with this module, I noticed the dbml property for the Table class was missing the headercolor setting when set.

This PR contains my proposed fix and the associated unit test.

With the following code

t = Table('products')
t.header_color = '#C84432'
c1 = Column('id', 'integer')
c2 = Column('name', 'varchar2')
t.add_column(c1)
t.add_column(c2)
s = Database()
s.add(t)

Without this fix, t.dbml returns:

Table "products" {
    "id" integer
    "name" varchar2
}

With this fix, t.dbmlreturns:

Table "products" [headercolor: #C84432] {
    "id" integer
    "name" varchar2
}

Cheers

Vanderhoof commented 7 months ago

Awesome, thanks a lot for the fix!