Skip to content

feat: APP-852 add unified_data_events view#66

Merged
blushi merged 2 commits intodevfrom
feat-APP-852-data-events-view
Jan 27, 2026
Merged

feat: APP-852 add unified_data_events view#66
blushi merged 2 commits intodevfrom
feat-APP-852-data-events-view

Conversation

@blushi
Copy link
Member

@blushi blushi commented Jan 20, 2026

@gemini-code-assist
Copy link

Summary of Changes

Hello @blushi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a new unified_data_events PostgreSQL view, designed to streamline access to data event information, particularly for data anchors and attestations. By consolidating relevant details from multiple tables and optimizing queries with a new partial index, this change enhances data accessibility and prepares the data for easier consumption by GraphQL services.

Highlights

  • New unified_data_events View: Introduces a new PostgreSQL view named unified_data_events to consolidate data event information, specifically for EventAnchor and EventAttest types.
  • Optimized Data Retrieval: A new partial index, idx_msg_event_attr_iri_data_v_partial, is created on the msg_event_attr table to improve performance for IRI lookups within the new view.
  • Comprehensive Event Details: The unified_data_events view includes key fields such as chain_num, block_height, tx_idx, msg_idx, event_type, iri, attestor, tx_hash, and timestamp, facilitating a unified data access pattern. It uses a LEFT JOIN to ensure anchors without attestors are still included.
  • PostGraphile Integration: Smart comments are added to the unified_data_events view, enabling PostGraphile to correctly identify its primary key (chain_num,block_height,tx_idx,msg_idx) and assign it the name unifiedDataEvent for GraphQL exposure.
  • Public Accessibility: Read (SELECT) permissions are granted to public on the new unified_data_events view, making the data accessible for querying.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new unified_data_events view through a SQL migration, which is a valuable addition for querying data events. The migration script is well-structured. My review includes suggestions to enhance performance, ensure data type correctness, and address a critical issue regarding potential data duplication within the new view. I've also pointed out a potential problem with the PostGraphile primary key configuration that could lead to issues in the GraphQL API.

Copy link

@alexander-astrand alexander-astrand left a comment

Choose a reason for hiding this comment

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

LGTM!

@blushi blushi merged commit 3e7cabb into dev Jan 27, 2026
1 check passed
@blushi blushi deleted the feat-APP-852-data-events-view branch January 27, 2026 09:33
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.

2 participants