Skip to content

Implement delete_cascade Relationship functions and code (and ttk buttons and quick_editor fix) #180

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

Merged
merged 4 commits into from
Mar 19, 2023

Conversation

ssweber
Copy link
Collaborator

@ssweber ssweber commented Mar 19, 2023

As discussed, this adds delete_cascade grabbing to Sqlite, Mysql and Postgres.

For the Form init, a user can toggle off update_cascade / delete_cascade by setting them False.

If a user has an update_cascade for a field they don't want to use for requerying, they can use the new update_fk_relationship to set update_cascade or delete_cascade to False.

eg frm.update_fk_relationship('bike_repair','bike_id',update_cascade=False)

I think that covers all our bases. If a user uses Foreign Key constraints, they can just turn delete_cascade to False and let the database do the work.

As discussed, this adds delete_cascade grabbing to Sqlite, Mysql and Postgres.

For the Form init, a user can toggle off update_cascade / delete_cascade by setting them False.

If a user has an update_cascade for a field they don't want to use for requerying, they can use the new `update_fk_relationship` to set update_cascade or delete_cascade to False.
ssweber added 2 commits March 19, 2023 00:44
Quick editor was breaking tcl after closing. Adding a unique key fixed it.
(closing quick_editor, and then clicking the sg.Table selector of the same quick-editor)

Also added modal = True to block main screen while quick editor open.
@ssweber ssweber changed the title Implement delete_cascade Relationship functions and code Implement delete_cascade Relationship functions and code (and ttk buttons and quick_editor fix) Mar 19, 2023
@ssweber
Copy link
Collaborator Author

ssweber commented Mar 19, 2023

After this lands, I’ll probably rename update_fk_relationship to set_fk_cascade to be more clear?

@ssweber
Copy link
Collaborator Author

ssweber commented Mar 19, 2023

update_fk_cascade_rule? Idk, I’m open to suggestions.

@PySimpleSQL PySimpleSQL merged commit 0734a17 into PySimpleSQL:development Mar 19, 2023
@PySimpleSQL
Copy link
Owner

Whatever you think on naming - at least there is a mechanism there for those that need it

@ssweber ssweber deleted the delete_cascade branch March 19, 2023 17:49
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