Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhamppx97/minimalcli

MinimalCLI - This tool generates C# class files from database tables for Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.
https://github.com/zhamppx97/minimalcli

class cli dotnet minimal mssql mysql oracle postgresql table table2cs

Last synced: about 1 month ago
JSON representation

MinimalCLI - This tool generates C# class files from database tables for Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.

Awesome Lists containing this project

README

        

# MinimalCLI

This tool generates C# class files from database tables for Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.

## Functionality
* Connects to the specified database.
* Retrieves table schemas.
* Generates C# class files with properties for each column.
* Includes column descriptions if available.

## Usage
```bash
MinimalCLI:~$ dotnet pack

Successfully created package 'your-path\MinimalCLI\nupkg\MinimalCLI.1.0.0.nupkg'.
```

```bash
MinimalCLI:~$ dotnet tool install --global --add-source ./nupkg MinimalCLI

You can invoke the tool using the following command: table2cs
Tool 'minimalcli' (Version '1.0.0') was successfully installed.
```

```bash
MinimalCLI:~$ table2cs --help

Usage: SqlTableToClass [--output ]

Supported database types:
mssql Microsoft SQL Server
mysql MySQL
oracle Oracle
postgresql PostgreSQL

Example:
SqlTableToClass mssql "Server=yourServerAddress;Database=yourDataBase;User Id=yourUsername;Password=yourPassword;TrustServerCertificate=True" --output "C:\OutputDirectory"
```

## Example

mssql
```bash
MinimalCLI:~$ table2cs mssql "Server=yourServerAddress;Database=yourDataBase;User Id=yourUsername;Password=yourPassword;TrustServerCertificate=True" --output "C:\OutputDirectory"
```
mysql
```bash
MinimalCLI:~$ table2cs mysql "Server=myServerAddress;Database=myDataBase;User=myUsername;Password=myPassword;" --output "C:\OutputDirectory"
```
oracle
```bash
MinimalCLI:~$ table2cs oracle "Data Source=myOracleDB;User Id=myUsername;Password=myPassword;" --output "C:\OutputDirectory"
```
postgresql
```bash
MinimalCLI:~$ table2cs postgresql "Host=myServerAddress;Database=myDataBase;Username=myUsername;Password=myPassword;" --output "C:\OutputDirectory"
```