psakusei 0.0.49
dotnet add package psakusei --version 0.0.49
NuGet\Install-Package psakusei -Version 0.0.49
<PackageReference Include="psakusei" Version="0.0.49" />
paket add psakusei --version 0.0.49
#r "nuget: psakusei, 0.0.49"
// Install psakusei as a Cake Addin #addin nuget:?package=psakusei&version=0.0.49 // Install psakusei as a Cake Tool #tool nuget:?package=psakusei&version=0.0.49
psakusei - sakusei (sok-say) is Japanese for create (and yes it's a play on psake the PowerShell build tool). psakusei helps you quickly generate boiler plate or starter code using a database first design approach. Having tables within a database, code is then generated for every layer of the application using approrpriate templates.
Getting Started
Installation
PM/> Install-Package psakusei
During installation psakusei will create a Templates
folder at the solution root and copy all available templates from psakusei.
Usage
PM\> Invoke-psakusei -ConnectionString "Data Source=.; Database=DBNAME; <creds>" -Template "Database*" -Table "Member" [-Force] [-Project "MyProject"] [-Provider "System.Data.SqlClient"]
-ConnectionString
: Required - The connection string to the desired database that contains the table-Provider
: Optional - Defaults to System.Data.SqlClient-Template
: Required - The filename of the template in the templates folder (not including the extension .erb, wildcards*
allowed to run multiple templates)-Table
: Required - The name of the table to generate code with (case senstive by the way)-Project
: Optional - Defaults to current the Project, or specify the name of the project to attach the final code file to-Force
: Optional - Defaults to false, whether or not to forcibly overwrite an existing file during template generation
Helper
To simplify entering connection strings over and over, check out the gencode sample script. This file can be copied to the solution root folder, modified to your liking, and called from the Package Manager Console as follows: .\gencode.ps1 -Project -Template -Table
. The sample provided uses a SQL Server LocalDB to demonstrate path setups (in case SQLite was preferred).
Templates
psakusei uses DatabaseSchemaReader to read various database engine schemas into a consistant object model and EPS as the underlying template engine. The table schema is accessed through the template variable $table
. For specific details for SQL engines supported, refer to the DB Schema Wiki. Alternatively, for EPS template details refer to the EPS readme. For all available templates, check out psakusei's Templates Folder.
Built-In Template Filters
Plural
: Using English based grammar rules converts a word to its plural form as converted from Ruby Inflection rulesSingular
: Using English based grammar rules converts a word to its singular form as converted from Ruby Inflection rulesCapitalize
: ConvertsmyFUNNYName
toMyFUNNYName
Upper
: ConvertsmyFUNNYName
toMYFUNNYNAME
Lower
: ConvertsmyFUNNYName
tomyfunnyname
Snake
: ConvertsmyFUNNYName
tomy_funny_name
Spine
: ConvertsmyFUNNYName
tomy-funny-name
Constant
: ConvertsmyFUNNYName
toMY_FUNNY_NAME
Pascal
: ConvertsmyFUNNYName
toMyFunnyName
Label
: ConvertsmyFUNNYName
toMy Funny Name
Camel
: ConvertsmyFUNNYName
tomyFunnyName
Last
: ConvertsmyFUNNYName
toName
Learn more about Target Frameworks and .NET Standard.
-
- DatabaseSchemaReader (>= 2.5.1 && < 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.49 | 1,013 | 5/18/2018 |