DbLinq "char" special character

101 views Asked by At

I used the DbMetal tool to generate a class for my database. It worked, but then I added some "char" types to the database. Now when I try to generate the class I get the error

DbMetal : Don't know how to convert the SQL type '"char"' into a managed type. Parameter name : dataType

Has anyone encountered this? Is there a workaround or an alternative?

Thanks in advance!

1

There are 1 answers

0
Chris Travers On

Do you really mean "char" which is a special Postgres type for the storage of a single byte of information? Or did you mean char(n) or varchar(n)?

In general, outside of some rare cases, varchar() and text are far preferred. Unless you quote "char" it assumes you mean the standard SQL char type. This is not one of the more self-documenting decisions in PostgreSQL....

It would not surprise me if "char" is poorly supported. If you really need to use it (or even if not) it would be worth filing a bug report with nogsql if this is still happening. As a workaround use a standard type mile char(1).