Skip to content

Generate DB entity classes for PetaPoco - a migrated tool from the old T4 template.

License

Notifications You must be signed in to change notification settings

iadaz/PetaPoco.DBEntityGenerator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PetaPoco.DBEntityGenerator

PetaPoco has stopped T4 template support since Version 6. But there are still lots of people loves generating DB entity classes from database. This is a tool that can help. It is ported from the PetaPoco T4 template.

How to use

It can be installed via nuget by installing the package PetaPoco.DBEntityGenerator.

It supports both net45 and netcoreapp2.2.

By using it on netcore, you can run dotnet ~/.nuget/packages/petapoco.dbentitygenerator/0.1.0/tools/netcoreapp2.2/PetaPoco.DBEntityGenerator.dll.

By using it on net45, you can run packages/petapoco.dbentitygenerator/0.1.0/tools/net45/PetaPoco.DBEntityGenerator.exe.

Here are the parameters it supports:

--config                  Config file path

-p, --providerName        Database provider name, supported arguments are Npgsql, SqlServer, MySql and Oracle

-c, --connectionString    Connection string to the database

--namespace               (Default: Entities) Namespace of generated classes

--explicitColumns         (Default: true) Explicit columns

--trackModifiedColumns    (Default: true) Track modified columns

-o, --output              (Default: console) Output, valid options are console, file

--outputFile              (Default: Database.cs) Output file name

--help                    Display this help screen.

--version                 Display version information.

You can either provide a config file or just leave it empty and set all other parameters, but with table customizations feature absent.

You can do table customization(e.g. table ignore, entity name change, columns customization) with a config file. Sample config file can be found in source code sample_config.json.

About

Generate DB entity classes for PetaPoco - a migrated tool from the old T4 template.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%