linqpad-postgresql-driver
linqpad-postgresql-driver copied to clipboard
uuid is not support
unsupported uuid
I just hit this problem. Is there any workarounds?
The easiest way to replicate this is to create a new dotnet core console application and follow the guide from postgresql:
http://www.npgsql.org/efcore/
In the models provided for Blog and Post replace the following:
public int BlogId { get; set; } => public Guid BlogId { get; set; }
After this, create a migration (dotnet ef migrations add Initial) and create the database (dotnet ef database update).
Lastly, use Linqpad with this driver and try and add a new Blog:
Blog blog = new Blog();
blog.Name = "MyBlog";
blog.Url = "example.com";
var blogId = this.InsertWithIdentity(blog);
Console.WriteLine("Added blog:"+blogId);
Ok the workaround I found was to enable the "Use experimental data types" in the driver connection dialog:
However, the drawback is that we can't use InsertWithIdentity() anymore. Instead, do it the old fashion way:
Blog blog = new Blog();
blog.Name = "MyBlog";
blog.Url = "example.com";
blog.BlogId = Guid.NewGuid(); // Generate the Guid here
this.Insert(blog); // Do a normal insert
This will work as expected but I didn't make extensive testing to see if something else breaks.