Giter Site home page Giter Site logo

mikarsoft / blackhole-core-cli Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 303 KB

The Command Line Interface for BlackHole Core ORM. Adds capability of Database First architecture to the BlackHole

Home Page: https://mikarsoft.com

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%
dapper dotnet-core ef-core fastest orm cli command-line-interface command-line-tool dotnet-tool dotnet-tools

blackhole-core-cli's Introduction

BlackHole-Core-Cli

A dotnet tool that is the Command Line Interface for BlackHole-Core-ORM. Find BlackHole-Core-ORM on Nuget

You can install this as a dotnet global tool and then run it from the command line of your solution folder, or from the package manager console in visual studio. You need to have the BlackHole Core ORM included in your project in order for this cli to work.

To run this Cli you need to type 'bhl' and then the command that you wish.

It supports 3 basic commands and 2 arguments on each one of them:

First Command:

  • update => Example: 'bhl update'

    Update command reads the 'BlackHoleEntities' in your project and the connection string and it generates or updates the database based on these.

    Important: Create the Entities and configure BlackHole before running this command.

    If you accidently delete a property from your 'BlackHoleEntities' the cli will not delete the column in the database. It will set it to Nullable. If you wish to delete unused columns from the database, then delete the corresponding properties from the BlackHoleEntities and then run 'bhl update -f' or 'bhl update --force' to force a strict update on the database. If BlackHole is in developer mode then the --force argument is used by default from the Cli.

    Also in case you need to keep a history of the database updates, BlackHole Cli can store the changes in Sql files to the selected default Datapath, by using the argument '-s' or '--save' after the command. Example : 'bhl update -s'

    You can use both '--force' and '--save' arguments in the same command. Example 'bhl update -f -s'

Second Command:

  • drop => Example: 'bhl drop'

    Drop command reads the connection string from the BlackHole's settings and ONLY if BlackHole is in developer mode, it drops the database.

    If you are not using developer mode in BlackHole Settings but you still want to drop the database, you need to use the '-f' or '--force' argument after the command. Example: 'bhl drop -f'

    If you also want to delete the existing Sql files that were written in a previous 'bhl update -s' command, you can use again the '-s' or '--save' argument with the drop command, to delete them. Example: 'bhl drop -s'

    You can use both '--force' and '--save' arguments in the same command. Example 'bhl drop -f -s'

Third Command:

  • parse => Example: 'bhl parse'

    Parse command reads the connection string from the BlackHole's settings and searches for an existing database in that location. If the database can be found then the Cli will read the tables, the columns and the constraints of that database and it will create a namespace in your project with the name 'BHEntities' where it will generate all the corresponding BlackHoleEntities based on the existing database.

    This command gives the 'Database First' ability to the BlackHole Core ORM.

    If the database is compatible with BlackHole's restrictions it will parse it directly without any errors.

    If there are incompatibilities then the Cli will stop the process and will generate a Parse report at the selected default Datapath folder, that will describe all the changes that are required to the database, in order to parse it. There are 3 levels of incompatibilities, 'Minor', 'Medium', 'Serious'. You can overcome the first two levels easily.

    If you want to parse the database even if it is incompatible, you can use the '--force' or '-f' argument after the parse command. With this argument, the Cli will parse all the Entities that have 'Minor' or 'Medium' level incompatibilities and it will also, generate a report of the parsing.

    VERY IMPORTANT!!! => BlackHole updates the database automatically on the Startup of the application, if your database is incompatible DO NOT start your application after parsing with the '--force' argument. Mikarsoft and BlackHole Core ORM have no responsibility for any dataloss or damage in your database

BlackHole Example:

-Find an Example Project here => BlackHole Example

BlackHole Documentation:

-Find Online Documentation here => BlackHole Documentation

blackhole-core-cli's People

Contributors

mikarsoft avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.