Skip to content

Conversation

@cfhowes
Copy link
Contributor

@cfhowes cfhowes commented Jan 11, 2024

I was having some problems with how FOREIGN KEYs were being handled for both keys listed after the COLUMN statements (rather then inline in the statement) and for those with compound keys.

If thinks look reasonable, I'll update the changelog as well.

)
if ddl:
tables = DDLParser(ddl).run(group_by_type=True)
tables = DDLParser(ddl, normalize_names=True).run(group_by_type=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels like a good change to me - i think i would want my output code to have normalized names. I was having problems with my foreign keys until i put this setting in, but i'll figure out where that went wrong if you don't like this change.

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
simple-ddl-parser = "^0.28"
simple-ddl-parser = "^1.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i hope this is OK. All the changes i submitted to simple-ddl-parser were to make this work for my DDL. ;)

__tablename__ = 'users_WorkSchedule'
id = db.Column(ARRAY((1,1)), primary_key=True)
id = db.Column(db.Integer(), primary_key=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the code above, I think this was actually a bug in the test/parsing from before. with the updated simple-ddl-parser version the parsing bug has been fixed and so the test updated. please let me know if i interpreted that incorrectly.

@xnuinside
Copy link
Owner

@cfhowes thanks for opening the PR, I will check little bit later

@xnuinside xnuinside merged commit 6523ae7 into xnuinside:main Jan 12, 2024
@xnuinside
Copy link
Owner

xnuinside commented Jan 12, 2024

@cfhowes released in version 0.15.1, thank you one more time!

@cfhowes cfhowes deleted the fk_processing_updates branch January 13, 2024 17:10
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

Successfully merging this pull request may close these issues.

2 participants