postgresql-for-doctrine
postgresql-for-doctrine copied to clipboard
fix: parse text[] as array<string>
Hey,
The way MartinGeorgiev\Doctrine\DBAL\Types\TextArray converts database values to php floats/int broke my expectations.
When I save ['a', '1', '0.1'] to my database, I expect to get back the same ['a', '1', '0.1'], NOT ['a', 1, 0.1]. Especially when the column name is "text".
I also checked postgres itself, and there is no magic casting:
database=# select pg_typeof(('{0.4}'::text[])[1]);
pg_typeof
-----------
text
(1 row)