Git Product home page Git Product logo

database-automation-cli-tool's Introduction

Database Automation Tool

A tool to insert random data into tables. The kind of data can be customized in a variety of ways and order as the user sees fit.

So why use this tool?

Most often, the data across different tables is the same such as name, email, phone numbers, or money and so on. This program takes the approach treating those columns as objects with properties. What this implies is that we can fill tables in a parametize manner and quickly change those parameters for testing. Furthermore, you won't need to download massive csv files for every table.


Usage

Configure 'config.properties' file for database connection parameters. Each column is passed as a sub-command. Subcommands can have arguements or no arguements attached.

Example:

Java -table myTable -rows 100 -cols name lastname email age address -nameC -nameC -emailC -numberC -min 18 -max 100 -addressC

Required Options:

Table

-table <table name>: Table to insert in

Rows

-rows <integer>: Number of rows to add

Column Names

-cols: <col names>: Space separated list of columns names. Must match the number of args. Min is 1 and Max is 15. 

Commands

nameC

textC

-mnLen <integer > 0>: minimum length (optional)
-mxLen <integer > mnLen> : max length (optional)

default behavior: Non-numeric random string of characters is generated. Users can specify max or minimum length.  Default min is 4 and Default max is 200. 

customC:

    -src <file path>: REQUIRED. Path of input file relative to root dir. 
    -isLarge: Specifiy if largefile. Program will not parse to determine number of items. Instead the program expects the first item to be the number of items in the file. 

    -o : Select values in order. Not that number of items must match number of rows. 

    default behavior: Values are selected randomly. 

Col values are selected(can be random with option) from user directed file. If file is not found then the program quits.

Number: Using options users can specify whether they want an int or decimal. 
    -dec : SPecify if values should be decimals. 
    -curr <currency to use>: default is none. -> ex: -curr "$"
    -max <max value>: default 100
    -min <min value>: default 0

    default behavior: an integer > 0 is provided.

emailC

-domains <space separated list of acceptable domains> max accepted is 4. 
-maxLength <integer > minLength>
-minLength <integer > 0>

default behavior: outputs emails containing letters, numbers, underscores, and dots. At least one letter. From domains: gmail.com, outlook.com and yahoo.com

dateC:

-from: <start date> 
-to: <end date>
-format < dd/MM/yyyy, MM/dd/yyyy, ..., MM-dd-yyyy> make your own. Default format is 'YYYY-MM-dd hh:mm:ss'.

default behavior: Gives a random date from 1/1/1990 to current date. 
If the format option is given then the start and endDate arguements need to follow the same format. 

Make sure the format matches the one expected by the database.

If the format option is given then the start and endDate arguements need to follow the same format. Timestamp

-from: <start time> 
-to: <end time>
-format < dd/MM/yyyy, MM/dd/yyyy, ..., MM-dd-yyyy>: Input your own. Default format is 'YYYY-MM-dd hh:mm:ss'.

default behavior: Gives a random date from 1/1/1990 to current date. 

Same as Date but for sake of clarity to separate commands are made. 

Make sure the format matches the one expected by the database.

If the format option is given then the start and endDate arguements need to follow the same format.

Formatting guide:

addressC:

-lcl <string locale>: Locale default is en-US -> ex: -lcl en-GB
-street <string streetname>: Specify only street name

cityC:

-lcl <string locale>: Locale default is en-US -> ex: -lcl en-GB

zipcodeC:

-lcl <string locale>: Locale default is en-US -> ex: -lcl en-GB

stateC:

-lcl <string locale>: Locale default is en-US -> ex: -lcl en-GB

countryC:

-lcl <string locale>: Locale default is en-US -> ex: -lcl en-GB

timezoneC:

-lcl <string locale>: Locale default is en-US -> ex: -lcl en-GB

Version 1.0.0:

The project was built using Picocli.

database-automation-cli-tool's People

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.