P3
P3 copied to clipboard
Custom column type
I have the following custom column type: CREATE TYPE public.money_with_currency AS (currency_code char(3), amount numeric(20,8))
When running: select * from table with that column, I'm getting: P3Error Cannot convert type with OID 23409
Do you have any suggestions on how I could pass that type to P3?
I was able to map these columns to strings in typeMap but I'm wondering if the default should be to do this automatically?
Hi,
First, thanks for the feedback, this is always important.
If you define your own types, they are not mapped, so something must happen.
Maybe you can find some inspiration in #loadEnums ?
It has been a while since I worked on P3, I will think a bit more about it.
It would certainly be interesting to see (in code) what you actually did. Maybe it can become a unit test / executable example ?
Sven
I created a new unit test / executable example: https://github.com/svenvc/P3/commit/a1982389e992e4bb5f8033b0fee1d6bc12929bcc