graphprotocol / graphprotocol/graph-node
[Feature] Better parsing of indexing SQL statements
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 3.2k
- Forks
- 1.1k
- Ø Merge
- 4 T. 1 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Description
Currently we parse indexing SQL statements with our own homegrown parser. It needs to be updated in order to support the new kinds of indexes. Discussion here shows some of deficiencies. In particular the fn is_same_kind_columns in index.rs has to jump through some hoops in order to compare if the two expressions are "kind of same". For instance BlockRangeLower and Unknown("lower(block_range) int4_minmax_multi_ops)"). Also the test generate_ddl() has a commented out line in the mock_thing_index_list for the same reason.
Related to this is generator of SQL statements that is not perfectly sanitising it's output, somewhat addressed in this.
One approach would be to extend the current parser to handle those cases. Other would be to use sqlparser or similar.
Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.
No response
Some information to help us out
- Tick this box if you plan on implementing this feature yourself.
- I have searched the issue tracker to make sure this issue is not a duplicate.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit fn is_same_kind_columns in index.rs und dem generate_ddl()-Test, einschließlich des auskommentierten Eintrags in mock_thing_index_list. Sieh dir die verlinkte Diskussion an und vergleiche die Erweiterung des aktuellen Parsers mit der Verwendung von sqlparser oder eines ähnlichen Parsers. Als abgeschlossen gilt die Aufgabe, wenn neue Indexarten und Ausdrücke wie BlockRangeLower ohne die bisherigen Workarounds geparst und verglichen werden und die Bereinigung der SQL-Ausgabe angemessen berücksichtigt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, sql
- Bereich
- databases
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100