graphprotocol / graphprotocol/graph-node
[Feature] Better parsing of indexing SQL statements
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Rust
- Estrellas
- 3.2k
- Forks
- 1.1k
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 1
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con fn is_same_kind_columns en index.rs y la prueba generate_ddl(), incluida la entrada comentada en mock_thing_index_list. Revisa la discusión enlazada y compara ampliar el parser actual con usar sqlparser o un parser similar. Se considera terminado cuando los nuevos tipos de índice y expresiones como BlockRangeLower se analicen y comparen sin las soluciones alternativas actuales, y la sanitización de la salida SQL se aborde según corresponda.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust, sql
- Área
- databases
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100