apache / apache/datafusion-sqlparser-rs

Add pretty printing to more sql constructs

オープン
#1,850 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
3.5k
フォーク
772
平均マージ
4日 9時間
マージ済み PR(30日)
17

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

この issue にはファイル、テスト、エントリーポイントが記載されていません。開始する前に、未チェックのチェックリスト項目を確認し、その範囲と想定されるフォーマットを明確にしてください。完了とは、選択された SQL 構文が、必要なインデントと文字列処理を用いて pretty-print されていることを意味します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust, sql
領域
compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。