Postgres enum types with an empty string as a valid value will break all parsing
まだ誰も着手していません。
- #304 @wyf027 による — マージされずにクローズ
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
調査の方向性
The issue describes a panic when queries return a PostgreSQL enum containing an empty string, but it does not identify a documentation file or specify where the limitation should be recorded. Read the existing documentation and decide whether this belongs in a FAQ or a known limitations section; done means documenting the behavior and a practical workaround clearly.
索引モデルが issue の本文から書いたものです。
説明
Migrated from halcyonnouveau/clorinde#92, originally reported by @KenAKAFrosty on 2025-04-16.
Not sure if this should even be considered a bug.
Possibly something to just mention in the docs or a FAQ.
If you have an enum type like CREATE TYPE badge AS ENUM ('staff', 'maintenance', 'guest', '') , where you have an empty string value as a valid part of the enum, expect to see this error when running the CLI if your queries return that column:
thread 'main' panicked at ...
Ident is not allowed to be empty; use Option<Ident>
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Makes sense when you consider that the created Rust enum can't (and shouldn't) support an empty value inherently
One could argue that the type shouldn't contain the empty value, but instead allow for nullable columns where that type is used. I'm inclined to agree, but I'm short on a time machine to convince my old self of that 😅
Not a huge deal as I can work around this now that I know the issue. But if someone was dipping their toes into clorinde, and hit this kind of error, it may put them off. Would be a shame since they wouldn't get to see how awesome clorinde is!
Happy to hear thoughts on this. And I'm open to help with getting it somewhere in the docs if that's something we want!
Original discussion
@beanpuppy (2025-04-17):
Thanks for bringing this up. Having an empty string value in an enum doesn't seem like a very good idea, so I wouldn't really want to add support for this even if we could.
I'm not sure if we need to document it anywhere as I doubt many people would do something like this. But since it is technically valid postgres to do this, and we aim to have complete postgres support for every possible thing it could do, I can see how we might want it documented somewhere just for completeness and posterity.
We don't have a FAQ, but I'm not opposed to the idea of it, I don't know what else could be added to it though.
We could also have a "known limitations" document for things like this. Although the only other thing I can think of right now to add to it is halcyonnouveau/clorinde#86, but there's probably more if I dug deeper and loosened my criteria for "limitation".
If it were just left to me, I'd probably leave it here and refer to this issue if anyone else comes and asks for it. But if you're really wanting to write some docs, you're free to open a PR with whatever you think is best.
- 主要言語
- Rust
- スター
- 1.2k
- フォーク
- 77
- 平均マージ
- 5日 12時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cornucopia-rs/cornucopia のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
cornucopia-rs/cornucopia#334 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
cornucopia-rs/cornucopia#333 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
cornucopia-rs/cornucopia#330 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
cornucopia-rs/cornucopia#309 · コメント 2 件 ·
-
configuration feature
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
cornucopia-rs/cornucopia#292 ·
cornucopia-rs/cornucopia の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
bytecodealliance/rustix#1736 ·
メンテナーはふだん 1 日以内に返信
-
area:models enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
servo/rust-smallvec#864 ·
-
bug frontend ui
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信