-
Notifications
You must be signed in to change notification settings - Fork 220
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
Is table join supported? #450
Comments
What if you use on Country Model can you confirm |
@geniqtech the key question is how you are making changes to the table. If you make the changes via Eloquent queries, the cache should be invalidated. If you make changes to the table data directly, the cache has no way of knowing you made updates. |
@mikebronner We are making changes via Eloquent queries. Referring to the example in my use case above, if we make changes to countries table via Eloquent queries, the cached item is not invalidated. |
@KimpShreyan AFAIK "$touches" only updates the "updated_at" column and is meant for a different purpose. |
@geniqtech Could you provide the query you are using to make changes? |
Here's the code snippet:
Logs Output |
Hello guys! This is how I'm populating the database:
How i'm querying:
This query doesn't show any updated results. But, if I change to this:
it works, but before I updating my laravel-model-caching the first query was working properly if I'm not wrong. |
Describe the bug
We are using left join as we need to allow sorting of each individual columns returned.
AFAIK this can't be supported using eager loading unless the sorting is done outside of SQL (Which is not very efficient).
The issue here is that results of the query are cached correctly in Redis but if we make changes to countries table, the cached item is not invalidated.
Can I confirm whether this is supported?
Here's a simplified schema for illustration:
Table: countries
Table: products
Model: Country
Model: Product
Eloquent Query
Observations
Cached item is only tagged to "appmodelsproduct:entries" and not "appmodelscountry:entries".
Therefore when changes are made to countries table, the cached item is not invalidated.
Environment
The text was updated successfully, but these errors were encountered: