MySQL
To set up Jerrycurl with a MySQL database, first install the vendor package into your project.
dotnet add package Jerrycurl.Vendors.MySql
After this, you can use the UseMySql
extension to set everything up.
class BlogsDomain : IDomain
{
public void Configure(DomainOptions options)
{
options.UseMySql("SERVER=.;DATABASE=blogdb");
}
}
Tooling
Visual Studio
To create and update your model in Visual Studio, create a Database.orm
file (Add -> New Item -> Jerrycurl Database
) with the following
configuration.
{
"vendor": "mysql",
"connectionString": "SERVER=.;DATABASE=blogdb"
}
After this you will be able to keep your object model in sync with your database schema via the right-click Object Model
menu.
CLI
You can use the CLI to create a .NET object model from your current database schema.
jerry scaffold -v mysql -c "SERVER=.;DATABASE=blogdb"