Skip to content

cache: false should still override alwaysEnabled: true #9023

@penngrove

Description

@penngrove

Issue Description

I would like to cache all the time, except a few specific queries. I setup alwaysEnabled: true in the DataSourceOptions and it correctly caches everything, now I want to turn off caching for a specific query and cache: false does not work (it will caches the result)

Expected Behavior

I expected all queries (find or querybuilder) to cache except for the queries I mark with cache: false

Actual Behavior

cache: false is ignored and the query is cache anyway

// include the output in code tags like these!

Steps to Reproduce

// insert code here

My Environment

Dependency Version
Operating System
Node.js version x.y.zzz
Typescript version x.y.zzz
TypeORM version x.y.zzz

Additional Context

Relevant Database Driver(s)

DB Type Reproducible
aurora-mysql no
aurora-postgres no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres no
react-native no
sap no
spanner no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✅ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions