Skip to content
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

[feature] cascade delete of plugins_configurations. fix #107 #198

Merged
merged 2 commits into from
May 6, 2015

Conversation

thibaultcha
Copy link
Member

This proposes a way to delete all plugins_configurations related to Consumers or APIs when deleting one of the two later.

:delete() is simply overridden to iterate over all related plugins_configuration and delete them one by one.

Caveats:

  • I am very unhappy with how painful it is to use one DAO inside another
    DAO. To avoid what would appear to be a cycling reference I rather opted
    for instanciating a new DAO inside of the delete method.
  • It is painful to perform a paginated query through the base_dao.
  • It is even more painful to perform a find_by_keys query as a paginated
    query.

@thibaultcha thibaultcha changed the title feat: cascade delete of plugins_configurations. fix #107 [feature] cascade delete of plugins_configurations. fix #107 May 4, 2015
@thibaultcha
Copy link
Member Author

This PR raises some concerns about the base_dao, since our way of using it evolved a lot recently (also since the pagination was implemented in the driver). Or will evolve as described in #103. I will try to improve it and simplify this PR before merging it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.41%) to 66.11% when pulling 8bdaa09 on feat/cascade-delete into 617503f on master.

This proposes a way to delete all `plugins_configurations` related to
`Consumers` or `APIs` when deleting one of the two later.

`:delete()` is simply overridden to iterate over all related
`plugins_configuration` and delete them one by one.

Caveats:
- I am very unhappy with how painful it is to use one DAO inside another
DAO. To avoid what would appear to be a cycling reference I rather opted
for instanciating a new DAO inside of the `delete` method.
- It is painful to perform a paginated query through the base_dao.
- It is even more painful to perform a find_by_keys query as a paginated
  query.
@thibaultcha thibaultcha force-pushed the feat/cascade-delete branch from 8bdaa09 to 925705c Compare May 6, 2015 10:38
@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 66.22% when pulling 925705c on feat/cascade-delete into 3d314fd on master.

thibaultcha added a commit that referenced this pull request May 6, 2015
[feature] cascade delete of plugins_configurations. fix #107
@thibaultcha thibaultcha merged commit 7affb50 into master May 6, 2015
@thibaultcha thibaultcha deleted the feat/cascade-delete branch May 6, 2015 12:03
ctranxuan pushed a commit to streamdataio/kong that referenced this pull request Aug 25, 2015
[feature] cascade delete of plugins_configurations. fix Kong#107
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