Does not support `citext[]` in postgres
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
調査の方向性
Reproduce the issue with PostgreSQL tables containing both text[] and citext[] columns, using an inferred ROM schema. Start by reading rom-sql-3.0.1/lib/rom/sql/extensions/postgres/types/array.rb and compare the inferred attributes shown for each type. Done means citext[] values are read as Ruby string arrays consistently with text[].
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
In postgres, citext arrays (citext[]) are not supported consistantly with text arrays (text[]). Both types should be usable.
Currently, text[] is supported as expected; when values are retreived, they are exposed to ruby as string arrays: ["one", "two", "three four"].
citext[] does not perform this same translation; instead results are returned in a native format:
'{"one", "two", "three four"}'
Examining the inferred schema gives no indication of why they behave differently:
text[]:
=> #<ROM::SQL::Attribute[NilClass | Array] name=:tags db_type="text[]" database="postgres" type="text" read=#<Dry::Types[Sum<Constrained<Nominal<NilClass> rule=[type?(NilClass)]> | Constructor<Array fn=/home/flip/.gem/ruby/2.6.4/gems/rom-sql-3.0.1/lib/rom/sql/extensions/postgres/types/array.rb:13>>]> source=ROM::Relation::Name(products) index=true qualified=true sql_expr=#<Sequel::SQL::QualifiedIdentifier @table=>:products, @column=>:tags> alias=nil>
citext[]:
#<ROM::SQL::Attribute[NilClass | Array] name=:tags db_type="citext[]" database="postgres" type="citext" read=#<Dry::Types[Sum<Constrained<Nominal<NilClass> rule=[type?(NilClass)]> | Constructor<Array fn=/home/flip/.gem/ruby/2.6.4/gems/rom-sql-3.0.1/lib/rom/sql/extensions/postgres/types/array.rb:13>>]> source=ROM::Relation::Name(products) index=true qualified=true sql_expr=#<Sequel::SQL::QualifiedIdentifier @table=>:products, @column=>:tags> alias=nil>
To Reproduce
- generate a postgres table with citext extension enabled.
- create a table with
text[]andcitext[]columns - use an relation with inferred schema
- add an array to both colums; note the difference in read results
Expected behavior
citext[] should behave the same as text[]
- 主要言語
- Ruby
- スター
- 220
- フォーク
- 97
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rom-rb/rom-sql のほかの issue
-
bug help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
bug help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
bug help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
account: profile
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信