Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query for all chains if no chain parameter present #48

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

0237h
Copy link
Collaborator

@0237h 0237h commented Nov 3, 2023

Previously when not passing any chain parameter with the query, the result would be the first row in the DB matching the expression. This change now runs the query as a UNION between all the available chains in the DB when no chain parameter is passed.

Example

SELECT *FROM blocks
WHERE (CHAIN == 'testnet') ORDER BY block_number DESC LIMIT 2 
UNION ALL 
SELECT * FROM blocks 
WHERE (chain == 'polygon') ORDER BY block_number DESC LIMIT 2 
UNION ALL 
SELECT * FROM blocks 
WHERE (chain == 'mainnet') ORDER BY block_number DESC LIMIT 2

@github-actions github-actions bot added the feature New feature or request label Nov 3, 2023
Previously when not passing any `chain` parameter with the query, the
result would be the first row in the DB matching the expression. This
change now runs the query as a `UNION` between all the available chains
in the DB when no `chain` parameter is passed.
@github-actions github-actions bot added the ops Related to repo maintenance label Nov 3, 2023
@0237h 0237h merged commit ffbffbe into main Nov 3, 2023
1 of 2 checks passed
@0237h 0237h deleted the feature/all-chains-query branch November 3, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request ops Related to repo maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant