Skip to content
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

Custom column type #39

Open
dclausen opened this issue Feb 21, 2023 · 3 comments
Open

Custom column type #39

dclausen opened this issue Feb 21, 2023 · 3 comments

Comments

@dclausen
Copy link

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?

@dclausen
Copy link
Author

I was able to map these columns to strings in typeMap but I'm wondering if the default should be to do this automatically?

@svenvc
Copy link
Owner

svenvc commented Feb 21, 2023

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

@svenvc
Copy link
Owner

svenvc commented Feb 24, 2023

I created a new unit test / executable example: a198238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants