Skip to content

feat(database): governor-limit visibility, SOSL table, redesigned tab (#162)#861

Merged
lcottercertinia merged 3 commits into
certinia:mainfrom
lukecotter:feat-162-database-limit-visibility
Jul 22, 2026
Merged

feat(database): governor-limit visibility, SOSL table, redesigned tab (#162)#861
lcottercertinia merged 3 commits into
certinia:mainfrom
lukecotter:feat-162-database-limit-visibility

Conversation

@lukecotter

@lukecotter lukecotter commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

📝 PR Overview

Reworks the Database tab to answer the core question in #162which SOQL/DML actually consume governor limits — and adds first-class SOSL support with a redesigned, coherent layout.

Not every SOQL query counts (custom metadata is free unless it selects a long text area field or runs in a Flow; cached custom settings issue no query). The log records the statements and cumulative totals but never per-statement attribution, so the tab surfaces the honest signal: the queried Object per row plus a per-section tracked vs consumed reconciliation, backed by a governor-limit overview.

🛠️ Changes made

  • Governor overview strip — SOQL, SOSL, DML and query/DML rows as used / limit, coloured as they approach the limit.
  • Tracked vs consumed per section — statements seen in the log vs the governor-counted total (CUMULATIVE_LIMIT_USAGE), flagging queries that didn't count.
  • Object column + group-by (Object / Namespace / Caller Namespace / statement) on SOQL & DML; parser gains structured DMLBeginLine.sObjectType.
  • SOSL table — new, searchable, with column views, grouping and CSV export; rows metered per query against the 2,000-rows-per-query cap; cross-table find spans SOQL/DML/SOSL.
  • Redesigned tab — DML → SOQL → SOSL sections, each an accent-headed collapsible panel (empty types auto-collapse) with inline metric stats on a shared inset; limit n/a when cumulative limits aren't logged.
  • database/limits.ts documents the governor numbers + doc URL for future reference.

🧩 Type of change (check all applicable)

  • ✨ New feature – adds new functionality
  • 📝 Documentation - README or documentation site changes

📷 Screenshots / gifs / video [optional]

db-design

🔗 Related Issues

closes #162

✅ Tests added?

  • 👍 yes

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site

Anything else we need to know? [optional]

  • Known limit (log constraint): custom-metadata (__mdt) SOQL is marked Uncertain — whether it counts depends on selecting a long text area field or running in a Flow, which the debug log doesn't expose. Verified in an org (same object: Limits.getQueries() delta 0 without the long-text field, 1 with it). Raised a Salesforce Idea for per-statement limit attribution: https://ideas.salesforce.com/s/idea/a0BHp000017Jly5MAC
  • Pre-existing parser limitation (not addressed here): addGovernorLimits sums used across namespaces but reports a single namespace's limit, so multi-namespace logs can render e.g. 119 / 100. Per-namespace limits aren't additive — flagged for a follow-up.

…certinia#162)

Surface which SOQL/DML consume governor limits and add first-class SOSL support.

SOQL/DML:
- Derive and show the queried SObject (Object column, default) so custom
metadata (__mdt) is visible — those queries may be free (they don't count
toward the SOQL limit unless they select a long text area field or run in a
Flow, which the log can't confirm).
- Per-section reconciliation: Found (in log) vs Counted (CUMULATIVE_LIMIT_USAGE)
with a delta, since per-query certainty isn't possible from the log alone.
- Group by Object / Namespace / Caller Namespace on both tables.
- Parser: structured DMLBeginLine.sObjectType (from the Type: field).

SOSL (new):
- getSOSLLines, searchable SOSLView, SOSL_VIEWS + database.sosl setting, and
cross-table find routing (SOQL/DML/SOSL). Rows metered per query vs the
2,000-row cap; the section meters total vs the derived 20 x 2,000 ceiling.

Redesigned Database tab:
- Governor overview strip (DML/SOQL/SOSL + query/DML rows) with used/limit gauges.
- Ordered DML -> SOQL -> SOSL sections, each an accent-headed collapsible panel
(empty types auto-collapse) with inline tracked-vs-consumed metric stats on a
shared left inset; 'limit n/a' when cumulative limits aren't logged.
- limits.ts documents the governor numbers + doc URL for future reference.
…elog (certinia#162)

- README: Database Analysis covers the governor overview strip, tracked-vs-consumed
  reconciliation, the searchable SOSL table, and the Object column / group-by.
  Screenshot flagged for re-capture.
- docs site: database page gains a Governor limits section and refreshed Column
  Views + Group sections.
- CHANGELOG: merge the overlapping certinia#162/certinia#298 entries into one; order the
  Unreleased section by impact (Changed now leads with the vscode-elements
  migration, cosmetic styling last).
…ertinia#162)

The SOSL Rows card invented a 40,000 ceiling (soslQueries.limit || 20 × 2,000) and rendered a live bar even
when the log had no CUMULATIVE_LIMIT_USAGE.

- extract `soslRowsMetric` into limits.ts: derives the ceiling from the SOSL-query limit and returns `used:
null` / no ceiling when no snapshot, so the card shows "limit n/a" like every sibling metric
- DatabaseView routes the SOSL Rows metric through the helper and `_hasLimits`, replacing the `|| 20`
fallback that masked a real limit of 0
- reword the "limit n/a" tooltip; cover the helper with unit tests
@lcottercertinia
lcottercertinia merged commit 6ee7ddf into certinia:main Jul 22, 2026
7 checks passed
@lukecotter
lukecotter deleted the feat-162-database-limit-visibility branch July 23, 2026 08:44
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.

feat: database - enhance SOQL + DML limit visibility

2 participants