Skip to content

Query pre-cached objects in SelectObjects - #83

Draft
joshlit wants to merge 1 commit into
OpenDAoC:masterfrom
daoc-blackthorn:codex/precache-select-queries
Draft

joshlit wants to merge 1 commit into
OpenDAoC:masterfrom
daoc-blackthorn:codex/precache-select-queries

Conversation

@joshlit

@joshlit joshlit commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What changed

  • route SelectObjects and MultipleSelectObjects queries to the in-memory pre-cache for tables with PreCache = true
  • evaluate structured WhereClause expressions against cached objects, including comparisons, AND/OR, IN, LIKE, null checks, ordering, and limits
  • cache column-to-binding lookups and reuse LIKE matchers to keep cached filtering efficient
  • add focused tests proving query results are correct and incur zero database connections

Why

Previously, UsesPreCaching only affected key lookups and select-all calls. Filtered SelectObjects calls still queried the database even though the complete table was already held in memory. This makes filtered and batched selects consistently honor the pre-cache and avoids unnecessary database round trips.

Validation

  • dotnet build Tests/Tests.csproj -c Release -p:RunPostBuildEvent=Never
  • dotnet test Tests/Tests.csproj -c Release --no-build --filter FullyQualifiedName~UT_PreCacheSelect (2 passed)

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.

1 participant