[feature request] PostgreSQL: FOR NO KEY UPDATE / FOR KEY SHARE, PREPARE TRANSACTION family and DO blocks have no AST production
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- postgresql, rust
調査の方向性
Start with src/ast/mod.rs and the PostgreSQL parser under src/parser/**; compare the existing FOR UPDATE / FOR SHARE locking clause and PREPARE statement productions. Add AST support and parsing for the missing locking strengths, prepared transaction statements, and DO blocks, then verify they produce matchable AST nodes with PostgreSqlDialect.
索引モデルが issue の本文から書いたものです。
説明
Summary
sqlparser-rs 0.64.0 parses SELECT ... FOR UPDATE / FOR SHARE, but has no production for the other two PostgreSQL row-lock strengths, and no production for any PostgreSQL two-phase-commit statement or the anonymous DO block. These are the four surfaces PostgreSQL's own regression/isolation suites exercise and they cannot be reached through the AST at all.
Environment
sqlparser0.64.0 (crate source,src/ast/mod.rs,src/parser/**)- PostgreSQL dialect (
PostgreSqlDialect) - Consumer: a PostgreSQL-wire-compatible engine driving
REL_16_4pg_regress+ isolation suites againstsqlparser's AST
What is missing
| PostgreSQL statement | Expected | Actual (0.64.0) |
|---|---|---|
SELECT ... FOR NO KEY UPDATE |
a locking-clause AST node | no production; FOR UPDATE and FOR SHARE only |
SELECT ... FOR KEY SHARE |
a locking-clause AST node | no production |
PREPARE TRANSACTION 'gid' |
a statement node | no production |
COMMIT PREPARED 'gid' / ROLLBACK PREPARED 'gid' |
statement nodes | no production |
DO $$ ... $$ (anonymous code block) |
a statement node | no Statement::Do variant |
Evidence (0.64.0 crate source)
for no key update/for key share: 0 matches anywhere undersrc/(case-insensitive, whitespace-tolerant).PREPARE TRANSACTION: 0 matches anywhere undersrc/.pub enum Statementhas 151 variants; the only matches for the interesting prefixes arePrepare(the SQLPREPARE name AS ...statement),Lock,LockTables(MySQL) — there is noDoand no prepared-transaction variant.
Expected behaviour
Parsing the statements above with PostgreSqlDialect yields a statement/locking-clause node the consumer can match on, the same way SELECT ... FOR UPDATE already does.
Actual behaviour
The parser rejects them, so a downstream engine cannot represent the feature through the AST and is forced either to pre-scan the SQL text (which is what we want to avoid) or to leave the feature unimplemented.
Why it matters here
pg_regress's lock, select and transactions files and the isolation suite's prepared-transactions*, lock-committed-*, nowait-*, skip-locked-* specs all start with these statements. Without an AST face, the consumer cannot answer them at all.
- 主要言語
- Rust
- スター
- 3.5k
- フォーク
- 805
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 116
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion-sqlparser-rs のほかの issue
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/datafusion-sqlparser-rs#2862 ·
メンテナーはふだん 1 日以内に返信
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/datafusion-sqlparser-rs#2861 ·
メンテナーはふだん 1 日以内に返信
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
apache/datafusion-sqlparser-rs#2858 ·
メンテナーはふだん 1 日以内に返信
-
PostgreSQL
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/datafusion-sqlparser-rs#2857 ·
メンテナーはふだん 1 日以内に返信
-
DuckDB Prolific Author
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
apache/datafusion-sqlparser-rs#2807 ·
メンテナーはふだん 1 日以内に返信
apache/datafusion-sqlparser-rs の issue をすべて見る
似ている issue
-
area:schema documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ElectronicWave/Elemental#252 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dekobon/big-code-analysis#1887 ·
メンテナーはふだん 1 日以内に返信
-
Shell中文符号输入异常オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信