Page 1 of 1

Uuid data type as a string data type

Posted: Tue 09 Jul 2019 05:21
by tommyiraone
Hi, we are migrating an existing application from Corelab.Postgresql to dotconnect for Postgresql but constrained by the many Uuid data types that are treated as a string data type.

can dotconnect treat Uuid data type as a string as in Corelab. Postgresql?

string _oid = par_ds.Tables ("os"). Rows (i). Item ("oid");

CoreLab.PostgreSql => OK
DotConnect PostgreSql => ERROR

we cannot use the search and replace feature, I'm afraid.., it's too many cases.

Re: Uuid data type as a string data type

Posted: Tue 09 Jul 2019 13:31
by Pinturiccio
The UUID type is mapped to System.Guid. It is the designed behaviour. And we recommend you to use Guid values instead of string ones and replace code that casts them to strings in your program. If it is not possible or will take a lot of time, we can create a static class with a static property, which will force returning string values from UUID columns. Please post here whether such solution suits you.

Re: Uuid data type as a string data type

Posted: Tue 09 Jul 2019 18:53
by tommyiraone
i know, but when using CoreLab.PostgreSql, we did not cast to anything, it just works, but when we migrate to the latest version of dotconnect.. all uuid columns stop working, invalid data type.

we use old CoreLab.PostgreSql (PostgreSQLDirect .NET)

we are migrating from Net Framework 2.0 to 4.7 (VS 2008 to VS 2017)

can you give me an example on how to "create a static class with a static property, which will force returning string values from UUID columns" please?

Re: Uuid data type as a string data type

Posted: Tue 16 Jul 2019 00:53
by tommyiraone

Re: Uuid data type as a string data type

Posted: Tue 16 Jul 2019 17:04
by Shalex
Sorry for the delay.
tommyiraone wrote: Tue 09 Jul 2019 18:53can you give me an example on how to "create a static class with a static property, which will force returning string values from UUID columns" please?
We will implement this option (static property) and provide the internal build to you.

Re: Uuid data type as a string data type

Posted: Fri 19 Jul 2019 09:15
by Shalex
The build is provided by email.

Re: Uuid data type as a string data type

Posted: Sat 20 Jul 2019 23:40
by tommyiraone
it works like a charm, thank you.