iankressin / eql

Query language to interact with EVM chains
https://eql.sh
MIT License
67 stars 7 forks source link

Add symbol to fetch all fields #17

Closed DistributedDoge closed 1 month ago

DistributedDoge commented 3 months ago

To save typing, language could include SQL-like * wildcard to get all fields we cannot be bothered to enumerate.

GET * FROM block 1 ON eth

I think new grammar could new like this:

fields    = { "*" | account_field_list | block_field_list | tx_field_list }

// For each field type:
account_field_list = _{ account_field ~ (", " ~ account_field)* }

I feel I should be able to handle Rust part of implementing that, which would be to modify frontend/parser and create expand_wildcard(entity: &str) helper function. Does it make sense?

iankressin commented 3 months ago

I think new grammar could new like this:

That's it.

Does it make sense?

Yes sir. We can either pass all the fields to interpret's backend or create a new enum variant called All here.

Let me know if you need any help with it.

Thanks for handling this!