Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jefersonsv/table2enum
Create enum from any SQL Server table
https://github.com/jefersonsv/table2enum
Last synced: 3 days ago
JSON representation
Create enum from any SQL Server table
- Host: GitHub
- URL: https://github.com/jefersonsv/table2enum
- Owner: jefersonsv
- License: mit
- Created: 2017-12-15T12:24:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T12:59:13.000Z (almost 7 years ago)
- Last Synced: 2024-04-04T14:33:39.120Z (9 months ago)
- Language: C#
- Size: 14.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Parameters
You must provide the below parameters.```
Usage: dotnet table2num [options]Options:
-? | -h | --help Show help information
-cs | --connection-string Connection string to connect SQL Server database.
-cscf | --connection-string-config-file Connection string configuration file.
-t | --table Table name.
-id | --identification-column ID column name.
-d | --description-column Description column name.
-csf | --csharp-file C# export filename.
-tsf | --typescript-file Typescript export filename.
-c | --class-name Class name of object.
-ns | --name-space Namespace of object.
-i | --imports Namespaces to import.
-bw | --black-words Exclude black words.
```- One of parameters __-csf__ -and __tsf__ must be provided to generate output file.
- The parameter __-c__ must be provied when the __-csf__ was specified.
- The parameters __-csf__, __tsf__ and __cscf__ accepts relative paths.# How to run
```bash
dotnet table2enum.dll ^
--table=CustomerType ^
-id CustomerTypeID ^
-d CustomerTypeDesc ^
-cs="Server=127.0.0.1;Database=master;Trusted_Connection=True;" ^
-csf ".\EnumCustomerType.cs" ^
-tsf ".\EnumCustomerType.ts" ^
-c EnumCustomerType ^
-ns Domain.Enum ^
-i System.ComponentModel
```## External packages
* Dapper (https://github.com/StackExchange/Dapper)
* Ensure.That (https://github.com/danielwertheim/Ensure.That)
* Humanizer (https://github.com/Humanizr/Humanizer)
* Microsoft.Extensions.CommandLineUtils (https://www.nuget.org/packages/Microsoft.Extensions.CommandLineUtils/)