pengdows.poco.mint.cli
2.0.1
dotnet tool install --global pengdows.poco.mint.cli --version 2.0.1
dotnet new tool-manifest
dotnet tool install --local pengdows.poco.mint.cli --version 2.0.1
#tool dotnet:?package=pengdows.poco.mint.cli&version=2.0.1
nuke :add-package pengdows.poco.mint.cli --version 2.0.1
pengdows.poco.mint
A .NET global tool that generates strongly-typed C# POCO classes from database schemas for use with the pengdows.crud framework. Point it at any supported database and receive ready-to-use entity classes with audit tracking, concurrency tokens, and all pengdows.crud attributes already applied.
Installation
dotnet tool install --global pengdows.poco.mint.cli
Quick Start
pengdows.poco.mint \
-c "Host=localhost;Database=mydb;Username=postgres;Password=secret" \
-p PostgreSql \
-o ./Entities \
-n MyApp.Data.Entities
Supported Databases
| Provider | -p value |
Example connection string |
|---|---|---|
| SQL Server | SqlServer |
Server=localhost;Database=MyDb;Trusted_Connection=True;TrustServerCertificate=True |
| PostgreSQL | PostgreSql |
Host=localhost;Database=mydb;Username=postgres;Password=secret |
| MySQL | MySql |
Server=localhost;Database=mydb;Uid=root;Pwd=secret; |
| MariaDB | MariaDb |
Server=localhost;Database=mydb;Uid=root;Pwd=secret; |
| Oracle | Oracle |
Data Source=localhost:1521/XEPDB1;User Id=myuser;Password=secret; |
| SQLite | Sqlite |
Data Source=./mydb.sqlite |
| Firebird | Firebird |
DataSource=localhost;Database=mydb.fdb;User=SYSDBA;Password=masterkey |
| CockroachDB | CockroachDb |
Host=localhost;Port=26257;Database=mydb;Username=root;SslMode=Disable |
| DuckDB | DuckDB |
Data Source=./mydb.duckdb |
| Snowflake | Snowflake |
account=myaccount;user=myuser;password=secret;db=MYDB;schema=PUBLIC |
Options
Required
| Option | Short | Description |
|---|---|---|
--connection-string |
-c |
Database connection string |
--provider |
-p |
Database provider (see table above) |
Optional
| Option | Short | Description | Default |
|---|---|---|---|
--output |
-o |
Output directory for generated files | ./Generated |
--namespace |
-n |
Namespace for generated classes | Generated.Entities |
--schemas |
-s |
Filter to specific schemas (repeatable) | all schemas |
--tables |
-t |
Filter to specific tables (repeatable) | all tables |
--include-views |
Include database views | false |
|
--config |
-f |
JSON configuration file path | none |
--yes |
-y |
Skip confirmation prompts for warnings | false |
Examples
SQL Server
pengdows.poco.mint \
-c "Server=localhost;Database=MyDatabase;Trusted_Connection=True;TrustServerCertificate=True" \
-p SqlServer \
-o ./Entities \
-n MyApp.Data.Entities
PostgreSQL
pengdows.poco.mint \
-c "Host=localhost;Database=mydb;Username=postgres;Password=secret" \
-p PostgreSql \
-o ./Entities \
-n MyApp.Data.Entities
MySQL / MariaDB
pengdows.poco.mint \
-c "Server=localhost;Database=mydb;Uid=root;Pwd=secret;" \
-p MySql \
-o ./Entities \
-n MyApp.Data.Entities
Oracle
pengdows.poco.mint \
-c "Data Source=localhost:1521/XEPDB1;User Id=myuser;Password=secret;" \
-p Oracle \
-o ./Entities \
-n MyApp.Data.Entities
SQLite
pengdows.poco.mint \
-c "Data Source=./mydb.sqlite" \
-p Sqlite \
-o ./Entities \
-n MyApp.Data.Entities
DuckDB
pengdows.poco.mint \
-c "Data Source=./mydb.duckdb" \
-p DuckDB \
-o ./Entities \
-n MyApp.Data.Entities
Firebird
pengdows.poco.mint \
-c "DataSource=localhost;Database=mydb.fdb;User=SYSDBA;Password=masterkey" \
-p Firebird \
-o ./Entities \
-n MyApp.Data.Entities
CockroachDB
pengdows.poco.mint \
-c "Host=localhost;Port=26257;Database=mydb;Username=root;SslMode=Disable" \
-p CockroachDb \
-o ./Entities \
-n MyApp.Data.Entities
Filter to Specific Schemas and Tables
pengdows.poco.mint \
-c "Server=localhost;Database=MyDatabase;Trusted_Connection=True;TrustServerCertificate=True" \
-p SqlServer \
-s dbo sales \
-t customers orders order_items \
-o ./Entities
Include Views
pengdows.poco.mint \
-c "Server=localhost;Database=MyDatabase;Trusted_Connection=True;TrustServerCertificate=True" \
-p SqlServer \
--include-views \
-o ./Entities
Using a Config File
pengdows.poco.mint -f myconfig.json
Config file format:
{
"connectionString": "Server=localhost;Database=MyDatabase;Trusted_Connection=True;TrustServerCertificate=True",
"provider": "SqlServer",
"output": "./Entities",
"namespace": "MyApp.Data.Entities",
"schemas": ["dbo"],
"tables": ["customers", "orders"],
"includeViews": false
}
Generated Output
The tool generates one .generated.cs file per table or view. Each class is decorated with pengdows.crud attributes derived from the database schema:
using System;
using System.Data;
using System.Text.Json;
using pengdows.crud.attributes;
namespace MyApp.Data.Entities;
[Table("orders", "dbo")]
public class Order
{
[Column("order_id", DbType.Int32, 1)]
[Id(writable: false)]
[NonInsertable]
public int OrderID { get; set; }
[Column("customer_id", DbType.Int32, 2)]
public int CustomerID { get; set; }
[Column("order_date", DbType.DateTime, 3)]
public DateTime OrderDate { get; set; }
[Column("total", DbType.Decimal, 4)]
public decimal Total { get; set; }
[Column("created_on", DbType.DateTime, 5)]
[CreatedOn]
public DateTime CreatedOn { get; set; }
[Column("row_version", DbType.Binary, 6)]
[Version]
public byte[] RowVersion { get; set; }
}
Regeneration overwrites *.generated.cs. Add customizations in a separate partial class file alongside the generated file.
Automatic Attribute Detection
| Attribute | Applied When |
|---|---|
[Table(name, schema)] |
Always — maps class to database table |
[Column(name, DbType, ordinal)] |
Always — maps property to column |
[Id(writable: false)] |
Column is an identity / auto-increment column |
[PrimaryKey] |
Column is part of the primary key (non-identity) |
[NonInsertable] |
Column is computed or identity |
[NonUpdateable] |
Column is computed |
[Version] |
Column is rowversion / timestamp type, or named version, row_version, xmin, etc. |
[CreatedBy] |
Column name contains "created" and "by" or "user" |
[CreatedOn] |
Column name contains "created" and "on", "date", or "time" |
[LastUpdatedBy] |
Column name contains "updated" or "modified" and "by" or "user" |
[LastUpdatedOn] |
Column name contains "updated" or "modified" and "on", "date", or "time" |
[EnumColumn] |
Column name ends with status, type, state, or kind |
[Json] |
Column type is JSON or column name contains "json" |
Design Constraints
- The database schema is the source of truth; the generator never mutates the schema.
- Generated POCOs are mapping contracts for deterministic SQL generation.
- Surrogate
[Id]takes precedence. A unique constraint becomes[PrimaryKey]only when the table already has a surrogate[Id]. [Version]represents an optimistic concurrency token, not a "last updated" timestamp.- Identifier normalization may produce collisions. Collisions are resolved with numeric suffixes (e.g.,
Name,Name1,Name2) and a warning is issued. The CLI prompts for confirmation unless-yis passed. - Composite key sequences must be contiguous and start at 1; invalid sequences stop generation.
- If a table has no surrogate
[Id], the generator emits[PrimaryKey]only. Some pengdows.crud helpers expect a surrogate[Id], so consider adding one if you need full helper support.
Web UI
A browser-based UI and REST API are available as a Docker image for interactive schema exploration and POCO generation. See README.docker.md for details.
Requirements
- .NET 8.0 or later
pengdows.crudv2.0+ (pulled automatically as a dependency)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.1 | 156 | 3/23/2026 |