question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some map<X>Array not working

See original GitHub issue

I try to use arrays, and get stuck with using numeric arrays and string arrays. Double arrays work as specified in the test, but numeric, or strings fails with the following error: org.postgresql.util.PSQLException: ERROR: wrong element type

Column definition is a simple:

create table my_table (
    my_strings varchar[],
    my_numeric numeric[]
);

Rings a bell and am I overseeing something, or is this a missing feature? 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
momaniacommented, May 26, 2018

👍

1reaction
momaniacommented, May 25, 2018

Have a look at my commit mentioned above here. or click here

I think this is a setup that can work. Just need to add more unit tests so more array types get some coverage.

If you’re happy with it I can make a pull request for it.

I also found some weird behaviour with inserting numeric arrays on my side, but haven’t looked into that yet. But it looked like all inserted BigDecimals were wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Array map function doesn't change elements - Stack Overflow
The map() method creates a new array with the results of calling a provided function on every element in this array.
Read more >
How To Fix object.map is not a function Error in JavaScript
The cause of your error is actually quite simple: the .map() method is only applicable when working with arrays. More specifically, the method ......
Read more >
Array.prototype.map() - JavaScript - MDN Web Docs
The map() method creates a new array populated with the results of calling a provided function on every element in the calling array....
Read more >
Are you using Array.map correctly? - RedBit Development
Using 'Array.map' for anything other than mapping creates a few problems. First and foremost, it makes the code less clear.
Read more >
JavaScript Array map() Method - W3Schools
map () creates a new array from calling a function for every array element. map() calls a function once for each element in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found