C
C#3mo ago
hutoanhill

Trying to scaffold a MySQL database with Rider

I am trying to scaffold a MySQL database. I am using Rider. I found this article on the MySQL website: https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-example.html but the commands it uses seems to require Visual Studio which i am not using. then i found this article from Jetbrains themselves: https://blog.jetbrains.com/dotnet/2022/01/31/entity-framework-core-inside-rider-ui-way/#alternatives
The JetBrains Blog
Entity Framework Core Inside Rider: UI Way | The .NET Tools Blog
Do you work with Entity Framework Core? Would you like to manage entities right inside your IDE? Then you're in luck! JetBrains Rider helps you effectively manage everything you need in EF Core with e
29 Replies
hutoanhill
hutoanhill3mo ago
but when i open the menu i see this:
No description
hutoanhill
hutoanhill3mo ago
instead of this:
hutoanhill
hutoanhill3mo ago
What am i missing? This documentation looks like its for an older version of Rider, where can i find the current version? found another article
hutoanhill
hutoanhill3mo ago
The JetBrains Blog
Running Entity Framework (Core) commands in Rider | The .NET Tools ...
A while back, we received a very interesting question: how can we run Entity Framework commands like adding migrations or updating the database, in Rider?@JetBrainsRider how do I run EF commands i
hutoanhill
hutoanhill3mo ago
this one had me run a version of this command in the terminal:
dotnet ef dbcontext scaffold "connection string" MySql.EntityFrameworkCore -c filename
dotnet ef dbcontext scaffold "connection string" MySql.EntityFrameworkCore -c filename
this thrw this error: No project was found. Change the current working directory or use the --project option. i messed around with it for a bit and eventualy found the right directory though trial and error now i get this error:
System.PlatformNotSupportedException: The option 'IntegratedSecurity' is not currently supported.
System.PlatformNotSupportedException: The option 'IntegratedSecurity' is not currently supported.
followed my a massive stack trace starting with MySql.Data.MySqlClient.MySqlConnectionStringBuilder.<>c.<.cctor>b__0_18(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, Object value) i have no idea what this IntegratedSecurity is or where i enabled it ok, ive done some more looking https://downloads.mysql.com/docs/connector-net-en.pdf (page 32) found this reference to IntegratedSecurity. looks like it enables windows authentication for connecting to the server. not sure if this is a featue of the database or a feature of my connection yet. this bit (page 29) implies to me that this is somthing to do with the MySQLConnecter package on the .NET side. which means i need to figure out how to modify the command to disable this idenfityer
## Options for Classic MySQL Protocol Only

Options related to systems using a connection pool appear together at the end of the list of general options
(see Connection-Pooling Options). Connector/NET 8.0 exposes the options in this section as properties in
the MySql.Data.MySqlClient.MySqlConnectionStringBuilder class.

**General Options.** The Connector/NET options that follow are for general use with connection strings
and the options apply to all MySQL server configurations:
## Options for Classic MySQL Protocol Only

Options related to systems using a connection pool appear together at the end of the list of general options
(see Connection-Pooling Options). Connector/NET 8.0 exposes the options in this section as properties in
the MySql.Data.MySqlClient.MySqlConnectionStringBuilder class.

**General Options.** The Connector/NET options that follow are for general use with connection strings
and the options apply to all MySQL server configurations:
hutoanhill
hutoanhill3mo ago
EF Core tools reference (.NET CLI) - EF Core
Reference guide for the Entity Framework Core .NET Core CLI tools
hutoanhill
hutoanhill3mo ago
cant find anything that would let me disable IntegratedSecurity but i did find a bunch of other useful stuff well. I cant find anything else Ah, i am an idiot, its in the connectiron string ok, new issue. its built and it looks like ive got a conflict:
hutoanhill
hutoanhill3mo ago
No description
hutoanhill
hutoanhill3mo ago
which of these do i use? for the moment i am using Microsoft.EntityFrameworkCore. but i dont actualy know which is best here
Anton
Anton3mo ago
The other one won't work
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
jcotton42
jcotton423mo ago
there's another provider that's much better iirc
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
hutoanhill
hutoanhill3mo ago
MsSQL being Microsoft SQL Server? but also i am locked into MySQL unfortunately
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
hutoanhill
hutoanhill3mo ago
Meaning not MySql.EntityFrameworkCore?
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
hutoanhill
hutoanhill3mo ago
i am not complaning to much. MySQL is where i got my start and its still what ive worked with most will look into that
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
hutoanhill
hutoanhill3mo ago
Pomelo.EntityFrameworkCore.MySql 8.0.2
Pomelo's MySQL database provider for Entity Framework Core.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
jcotton42
jcotton423mo ago
I think the table’s just out of date.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
hutoanhill
hutoanhill3mo ago
changed ok. at some point i am going to have to hand this codebase off to someone. anyway to get around the whole needing to add Microsoft.EntityFrameworkCore. to every Index decorator after i scaffold the database? it would be great if i could just say in the docs "hey run this command when you update the database"
Angius
Angius3mo ago
Ideally, you'd be doing code-first instead of db-first, thus avoiding incorrectly generated code and not needing to bother remembering to re-scaffold any time the db structure changes
hutoanhill
hutoanhill3mo ago
I might do this, but the database is massive and i know MySQL and not Entity Framework Core. need more experience in the mean time it would be breath if i didn't have to specify where Index is coming from
Pobiega
Pobiega3mo ago
its because you have both namespaces imported, and they both have something called IndexAttribute you can solve this by aliasing, or removing the ComponentModel using
hutoanhill
hutoanhill2mo ago
ok. well i am using data annotations as part of the scaffolding so that gets added automatically. I guess i am stuck edititng every file.
Want results from more Discord servers?
Add your server