apache / apache/datafusion-sqlparser-rs
Add pretty printing to more sql constructs
- Langage dominant
- Rust
- Étoiles
- 3.5k
- Forks
- 772
- Merge moyen
- 4 j 9 h
- PR mergées (30 j)
- 17
Description
This is a followup on https://github.com/apache/datafusion-sqlparser-rs/pull/1847
Here are some constructs that are currently not handled by the pretty printer (they are displayed on a single line). I'm opening this to serve as a tracking issue to track implementation of these.
* [x] Format `INSERT INTO` with both `VALUES` and `SELECT` forms
* [x] Support `UPDATE` and `DELETE` with proper clause indentation
* [x] indent `CREATE TABLE` column definitions and constraints
* [x] Format `CREATE VIEW` and nested `SELECT` cleanly
* [ ] Handle `CREATE FUNCTION`/`PROCEDURE` blocks with inner SQL formatting
* [ ] format `json_table` and `xmltable`
* [ ] Format `BEGIN`, `COMMIT`, `ROLLBACK` blocks clearly
* [ ] Support control flow structures (`IF`, `WHILE`, `LOOP`) with block indentation
* [ ] support multiline strings (the indentation should not be reflected inside the string)
* [ ] Handle `MERGE` statements with `WHEN MATCHED` and `WHEN NOT MATCHED` branches
* [ ] format `CREATE INDEX` with minimal structure
* [ ] Handle `EXPLAIN`, `EXPLAIN ANALYZE`, and `DESCRIBE` statements
cc @alamb
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
L’issue ne mentionne aucun fichier, test ni point d’entrée. Examinez les éléments non cochés de la liste de contrôle et clarifiez leur portée ainsi que le formatage attendu avant de commencer ; terminé signifie que les constructions SQL sélectionnées sont formatées par pretty-printing avec l’indentation et la gestion des chaînes requises.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust, sql
- Domaine
- compilers
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100