Does not support `citext[]` in postgres
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
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[].
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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[]
- Lingua principale
- Ruby
- Stelle
- 220
- Fork
- 97
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rom-rb/rom-sql
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
bug help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
bug help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
bug help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di rom-rb/rom-sql
Issue simili
-
dependencies Difficulty: Easy Good First Issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
rubyforgood/casa#7325 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
davidteren/mutineer#364 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno