Skip to content

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Sep 19, 2025

This PR picks up the work done in PR #5382. Its main purpose is to help evaluate how such an interface would work. There's no expectation that this will ever make it into a graph-node release at this point.

Documentation can be found in docs/implementation/sql-interface.md in this PR

This is a continuation of PR #5799 but had to be a new PR because of commit signing

Copy link
Member

@isum isum left a comment

Choose a reason for hiding this comment

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

This looks very nice! Blocking because I have found one security issue that needs to be fixed

@lutter
Copy link
Collaborator Author

lutter commented Oct 27, 2025

Addressed all review comments

lutter and others added 20 commits October 29, 2025 17:23
1. Do not use CTE's to inject a view of a table at a certain block. Instead
   rewrite the 'from' clause
2. Do not turn bytea columns into string columns since that is hugely
   wasteful
That setup makes it much easier to add more tests that check that we scrub
dangerous constructs from SQL
The wrapping with to_jsonb is closely tied to how we run the query
This is to keep Postgres from complaining about reserved words as column
names, e.g., the column `to` needs to appear as `"to"` in a query
@lutter lutter merged commit 405370c into master Oct 31, 2025
6 checks passed
@lutter lutter deleted the lutter/sql branch October 31, 2025 14:39
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.

4 participants