fschulze / sqlalchemy_schemadisplay

Other
143 stars 37 forks source link

Standard crows foot notation #9

Open psychemedia opened 6 years ago

psychemedia commented 6 years ago

It would be useful if the display used the standard crows foot notation, eg as per https://www.codeproject.com/Articles/878359/Data-modelling-using-ERD-with-Crow-Foot-Notation .

 def graphviz_crow_arrowheads( cardinality):
        if cardinality=='*': # *: {0..N}
            head='crowodot'
        elif cardinality=='?': # ?: {0,1}
            head='teeodot'
        elif cardinality=='+': # +: {1,N}
            head='crowtee'
        elif cardinality=='1': # 1: {1}
            head='teetee'
        return head
webley-eli commented 1 year ago

It's odd since the example here https://github.com/sqlalchemy/sqlalchemy/wiki/SchemaDisplay shows crows feet Calling graph = create_schema_graph( metadata=metadata_obj, rankdir='LR', relation_options={'arrowType': 'crow', 'arrowhead': 'crow', 'arrowtail': 'crow'}, show_column_keys=True, ) also results in TypeError: pydot.Edge() got multiple values for keyword argument 'arrowhead' and TypeError: pydot.Edge() got multiple values for keyword argument 'arrowtail' 'arrowType': 'crow' also doesn't update the arrows

Maybe the logic here https://github.com/fschulze/sqlalchemy_schemadisplay/blob/master/sqlalchemy_schemadisplay.py#L262 needs additional consideration?

Zlopez commented 9 months ago

Is this still issue with 2.0 released?