EDM .net GUID

EDM .net GUID

Postby pleb » Mon 23 Jun 2008 07:54

Hi All,

Is there anyway to get the EDM MySQL driver to support GUID? I currently use CHAR(36) in the MySQL schema.

Regards,

Pleb
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby pleb » Mon 23 Jun 2008 10:53

I see that there isn't much chance of GUID (UUID) working in your current driver. I wondering if you've ever been asked to add a connection string parameter that would toggle the conversion of CHAR(36) my favourite, CHAR(48), or BINARY(16) to a GUID type. This way you could opt in for the behaviour.

Thanks Pleb
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby Alexey.mdr » Mon 23 Jun 2008 12:38

Hello,

As MySQL server doesn't support GUID type, MyDirect .NET will not provide a design-time support for it.
In the coming build you will be able to set the GUID type,
manually editing the edmx XML file.
Code: Select all




Regards,
Alexey.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby pleb » Mon 23 Jun 2008 12:46

thanks for the reply.

:cry: I guess manual support it better than no support.

Pleb
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby AndreyR » Wed 09 Jul 2008 06:24

Hello, Pleb.

The manual support of GUID is implemented in the new build.

Regards, Andrey.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby pleb » Wed 09 Jul 2008 06:35

Good to hear, and thank you. :wink:
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby pleb » Mon 28 Jul 2008 03:20

First thanks for the support of Guids, as this will make switching between the corelabs MySQL entity driver and any other entity driver which supports Guids easier.

I'd just like to raise the topic of "Is there a better way"

What are you thoughts of a global configuration form where you could set conditions that would apply to type selection when reverse engineering the database - table structure.

For example

"MySQL Type char, length 36, .net type Guid"

or

"MySQL Type tiny int, length 1, .net type Bool"

or

"MySQL Type enum, .net type String"

or

"MySQL Type set, .net type String"

This way the responsibility would be handed off to the developer for mapping non straight forwards types.

Pleb
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby AndreyR » Tue 29 Jul 2008 14:39

Thank you for an interesting suggestion.
But the implementation of such a feature is rather sophisticated.
We will investigate the proposition.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby pleb » Wed 30 Jul 2008 00:06

Hi Andrey,

I agree that this is rather sophisticated, though I had a little chuckle when when I thought about the implementation of an ado data provider and it's sophistication. Isn't that what you deal with everyday? :P

Here's me thinking out loudly,

The configuration form would reside in VS, and the mappings would store locally on the developers machine.

How do you get these mappings to work with the mysql ado.net driver and entity driver?

A custom configuration section in the app.config or web.config file? The configuration form could write out this section for the developer. A developer could write out there own configuration.

Maybe an interface or abstract class could be used. The configuration form writes out the necessary classes or a developer creates them manually. The objects are loaded into the driver, and when the driver is working out the type, you could use these objects as call backs which would give the implementation to handle the type and conversion to and from?

Ok now I see why it's sophisticated :D

Hmmm

What are you guys thinking?

Pleb
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby AndreyR » Thu 31 Jul 2008 11:20

Our investigation is in progress. We will notify you about the results, but it will take several days.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Thu 07 Aug 2008 11:23

First, sorry for delay.
The configuration form will be implemented in one of the future versions.
It will contain rules enforcible by users (for example, map tinyint(1) to System.Boolean)
But the full freedom in mapping cannot be gained to users at the moment, because in the most cases it will cause problems in runtime.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby pleb » Thu 07 Aug 2008 11:46

WOW it's sounds great. Thanks for even considering it, and more importantly thanks for accepting it. :wink:
pleb
 
Posts: 37
Joined: Mon 23 Jun 2008 06:21
Location: Melbourne, Australia

Postby nilssonm » Mon 25 Aug 2008 15:16

Hi All,

It is great that a manual support for GUID's is implemented, but it seems that it is a problem using the GetObjectByKey and TryGetObjectByKey methods with the provider. I am always getting a System.NotSupportedException with "DbType Guid is not supported" in return.

Is there a solution for this problem?

Mats
nilssonm
 
Posts: 23
Joined: Mon 25 Aug 2008 15:08

Postby Shalex » Tue 26 Aug 2008 15:57

We can't reproduce the error.
Please provide us the script that creates tables and fills them with data, .edmx file content, and a piece of your code where the exception occurs.
We will investigate the problem and notify you about results.
Shalex
Devart Team
 
Posts: 7194
Joined: Thu 14 Aug 2008 12:44

Postby nilssonm » Fri 29 Aug 2008 14:38

Hi Shalex,

I hope you have seen my mailing of the complete project I was testing with.

Mats
nilssonm
 
Posts: 23
Joined: Mon 25 Aug 2008 15:08

Next

Return to dotConnect for MySQL