Skip to content

Add search by contract functionality#16

Merged
ivpusic merged 2 commits into
mainfrom
search_by_contract
Mar 6, 2026
Merged

Add search by contract functionality#16
ivpusic merged 2 commits into
mainfrom
search_by_contract

Conversation

@ivpusic

@ivpusic ivpusic commented Mar 6, 2026

Copy link
Copy Markdown
Member

Added

dune dataset search-by-contract --contract-address 0x...

@cursor

cursor Bot commented Mar 6, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Introduces a new CLI surface area backed by a new API call and bumps duneapi-client-go, which could affect dataset search behavior if the upstream API or models changed. Changes are otherwise mostly help/flag text updates with low functional impact.

Overview
Adds contract-address dataset discovery. Introduces dune dataset search-by-contract to list decoded tables for a given contract address, with optional blockchain filtering, pagination, and --include-schema, outputting either JSON or a table.

Improves CLI ergonomics and messaging. Expands Long help and examples across query, execution results, docs search, usage, and dataset search, and updates several flag descriptions to consistently reference DuneSQL.

Dependency update. Bumps github.com/duneanalytics/duneapi-client-go from v0.4.2 to v0.4.3 (and updates go.sum) to support the new dataset search-by-contract request/response models.

Written by Cursor Bugbot for commit da1b9bc. Configure here.

@coderabbitai

coderabbitai Bot commented Mar 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 189e97d8-f329-4f80-90a0-727384fa03d9

📥 Commits

Reviewing files that changed from the base of the PR and between 8808475 and 716bba1.

📒 Files selected for processing (11)
  • cli/root.go
  • cmd/dataset/search.go
  • cmd/docs/search.go
  • cmd/execution/execution.go
  • cmd/execution/results.go
  • cmd/query/create.go
  • cmd/query/query.go
  • cmd/query/run.go
  • cmd/query/run_sql.go
  • cmd/query/update.go
  • cmd/usage/usage.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • cmd/query/create.go
  • cmd/query/query.go
  • cli/root.go
  • cmd/usage/usage.go
  • cmd/query/run.go

📝 Walkthrough

Walkthrough

Adds a new dataset search-by-contract CLI command, expands help/Long text across multiple CLI commands, and bumps the duneapi-client-go dependency from v0.4.2 to v0.4.3. No exported/public API signatures were changed.

Changes

Cohort / File(s) Summary
Help Text & Flags
cli/root.go, cmd/dataset/dataset.go, cmd/dataset/search.go, cmd/docs/search.go, cmd/execution/results.go, cmd/execution/execution.go, cmd/query/query.go, cmd/query/create.go, cmd/query/run.go, cmd/query/run_sql.go, cmd/query/update.go, cmd/usage/usage.go
Extended and clarified Long descriptions, added examples, refined flag help text (polling cadence, pagination, param types, etc.). No control-flow or public-signature changes.
New Dataset Command
cmd/dataset/search_by_contract.go
Introduces search-by-contract command: parses --contract-address (required), --blockchains, --include-schema, --limit, --offset, and output format; builds SearchDatasetsByContractAddressRequest, calls client API, and prints JSON or a formatted table (FULL_NAME, CATEGORY, DATASET_TYPE, BLOCKCHAINS) with totals.
Dataset Command Registration
cmd/dataset/dataset.go
Registers the new search-by-contract subcommand and updates dataset command descriptions.
Dependency Update
go.mod
Bumps duneapi-client-go from v0.4.2 to v0.4.3.

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as "search-by-contract\nCommand"
    participant Parser as "Flag\nParser"
    participant Client as "API\nClient"
    participant Server as "Backend\nService"
    participant Output as "Output\nFormatter"

    User->>CLI: invoke command with flags
    CLI->>Parser: parse flags (contract-address, blockchains, include-schema, limit, offset)
    Parser-->>CLI: parsed values
    CLI->>Client: build SearchDatasetsByContractAddressRequest
    Client->>Server: SearchDatasetsByContractAddress(request)
    Server-->>Client: SearchDatasetsResponse
    Client-->>CLI: return response
    CLI->>Output: format response (json or table)
    Output-->>User: display results ("X of Y results")
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • va3093
  • norbertdurcansk
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author; the description field is empty. Add a description explaining the purpose of the search-by-contract feature, how it works, and any usage examples or context for reviewers.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add search by contract functionality' directly matches the main change—a new search-by-contract CLI command with supporting documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Comment @cursor review or bugbot run to trigger another review on this PR

Comment thread cmd/dataset/search_by_contract.go
@ivpusic ivpusic force-pushed the search_by_contract branch from da1b9bc to 3dee67a Compare March 6, 2026 09:17
Merge the detailed flag descriptions from PR #15 (max lengths, type format
hints, behavioral details, category explanations) with the examples and
Long descriptions from the search_by_contract work. Every Short, Long,
and flag help string is now maximally descriptive so AI agents can
select the right commands and flags without ambiguity.
@ivpusic ivpusic force-pushed the search_by_contract branch from 8808475 to 716bba1 Compare March 6, 2026 09:30
@ivpusic ivpusic requested a review from va3093 March 6, 2026 09:42
@ivpusic ivpusic merged commit 60112ac into main Mar 6, 2026
3 checks passed
@ivpusic ivpusic deleted the search_by_contract branch March 6, 2026 11:43
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