bbsimonbb/query-first

PostgreSQL data type compatibility and error messages

Opened this issue · 2 comments

When using QueryFirst with PostgreSQL via Npgsql queries against PostgreSQL types such as Enums, fail silently with no regeneration of code and no error messages.

There are easy workarounds in the query for some types, Eg for Enums cast to text, abuse enumrange or create a function to return an ordinal. So the the missing datatypes are not necessarily a dealbreaker.

However, it would be great if at least an error message was generated.

I would like to do a better job of this, but it looks like a big subject. Would you have the time to put a simple console app on github that demonstrates the issues? How should this work? Do you maintain the mappings to CLR types? In which case I would need to know about them somehow. Or should I be able to interrogate Postgres and generate the code for the mappings, as I currently do for regular result sets? Sounds like a challenge.

As you say, error messages at least should be possible.

I'll try to find some time to create an example app to highlight this, and some of the other npgsql issues I'm seeing. (eg The "..." operator for query construction isn't populating)