Skip to content

Add get table by id function#2182

Merged
bigfluffycookie merged 2 commits intomainfrom
lb/gettableid
Apr 1, 2026
Merged

Add get table by id function#2182
bigfluffycookie merged 2 commits intomainfrom
lb/gettableid

Conversation

@bigfluffycookie
Copy link
Copy Markdown
Contributor

Part of OPS-4007

@linear
Copy link
Copy Markdown

linear Bot commented Mar 31, 2026

@bigfluffycookie bigfluffycookie marked this pull request as ready for review March 31, 2026 17:02
Copilot AI review requested due to automatic review settings March 31, 2026 17:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new getTableById helper to the OpenOps Tables client so callers can fetch a table object when they already have a numeric table id (OPS-4007).

Changes:

  • Added getTableById(tableId, tablesServerContext) to openops-tables/tables.ts.
  • Added Jest coverage for getTableById returning a match or undefined when not found.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/openops/src/lib/openops-tables/tables.ts Introduces getTableById that fetches tables for the configured database and finds the matching id.
packages/openops/test/openops-tables/tables.test.ts Adds tests validating the new API behavior and request/header usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/openops/src/lib/openops-tables/tables.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

return getDistinctTableNames(tables);
}

async function fetchAllTables(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored so this can reuse this in getTablesById

@bigfluffycookie bigfluffycookie merged commit 9f554c8 into main Apr 1, 2026
21 checks passed
@bigfluffycookie bigfluffycookie deleted the lb/gettableid branch April 1, 2026 07:42
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.

3 participants