-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayConverter parseInput exception #12
Comments
Looks like this syntax is documented here: https://www.postgresql.org/docs/current/arrays.html#ARRAYS-IO
The proper way would be at least to parse the dimensions and, probably, to generate PHP arrays using the same keys. I'll see what I can do. Another problem is that we always use a comma as an array delimiter, but the array representation can use a different one, as documented on the page linked above (it is |
NB: It won't be hard to also support |
Fixed in release 2.4.1 Thanks for your report! Having no bug reports for a long time makes one wonder whether the package is so bug free or just isn't used by anyone. 🤣 |
Thanks for the quick fix/improvement. Regarding the bug-freeness: I don't know how many people use this wrapper, but the code is high quality, so it's probably very close to "bug-free" :) Thanks again... |
Hi,
First of all I like to thank you for your work and your code, I like it and I use it in my projects.
The Issue:
I use PostgreSQL metadata parsing in one of my projects, and one of the queries I use contains an array field in the result set. The query is:
You can execute it on any Postgres database (it reads meta tables).
When I try to access the result set, I got an exception from the ArrayConverter:
The problem is, that the ArrayConverter parseInput expects a leading "{" in the array value (e.g.: "{5}"), but it starts with the dimensions (e.g.: "[0:0]={5}"), so the parsing will fail and exception is throwed. I just "hack" the original code, and it works, but I'm not sure this is the proper way to handle this.
Original code from ArrayConverter.php:
Modified code (no exception and works fine):
The text was updated successfully, but these errors were encountered: