Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Cache] AddPdoTagAwareAdapter
#58296
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
PdoAdapter
tag awareThanks for looking into this topic.
|
The problem as far as I could see (feel free to double-check and correct) is that the only alternative for this use case would be the general
Hmm, I guess we could. It would make the PR a bit more bloated because I guess we'd also follow the Redis schema and extract common logic into a |
@nicolas-grekas like this? Not sure how to best fix the remaining Psalm issue. It's the same in all other cache adapters as far as I could see but the baseline protects those. But yes, in theory |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
{ | ||
$conn = $this->getConnection(); | ||
$stmt = $conn->prepare("DELETE FROM $this->tagsTable WHERE $this->idCol NOT IN (SELECT $this->idCol FROM $this->table)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should this adapter use a foreign key withON DELETE CASCADE
instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I decided against this on purpose. It's simpler like that 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
why is it simpler to require handling orphaned tags explicitly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sure, if you think that is better, please provide the necessary changes. I have no clue howoci
andsqlsrv
work and no motivation to learn about them 😄 We can also just do it for the others and throw an exception for those ones and ask the community to finish the implementation. Whoever needs it. But the current query likely works on all platforms.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
bendavies commentedNov 25, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
was looking for this exact feature. thanks@Toflar. |
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
cc64fd2
to49d24d1
CompareWell I have incorporated the requested changes and then never heard back regarding the Psalm issue. I have rebased onto 7.3 now which is about all I can do I guess 😊 Failed 8.4 tests are unrelated. |
Uh oh!
There was an error while loading.Please reload this page.
I noticed that unfortunately, the
PdoAdapter
in the cache component does not natively support cache tagging. This forces you to use it in combination with the generalTagAwareAdapter
which has a few downsides when it comes to performance. So I figured, why not try to add native support.