Meta data extraction from various databases
- Download
git clone https://github.com/project-spinoza/xmetadata.git - Change Dir
cd xmetadata - Build
mvn clean install
- RUN
sh launch.sh --mode cmd
NOTE--modecan take two valuescmdORrest
when started with--mode cmdthe application starts as a commandline tool
when started with--mode restthe application starts as a REST service.
By default the service will be accessible on port8181e.g.http://localhost:8181/<one_of_the_following_end_points>
POSTAuthorization end point/authGETList available routes/xmeta/api/v1/GETShow databases/xmeta/api/v1/list/dbGETShow tables/xmeta/api/v1/list/table/:databaseGETShow columns/xmeta/api/v1/list/column/:database/:tableGETShow columns with types/xmeta/api/v1/list/columnWithType/:database/:tableGETGet column type/xmeta/api/v1/get/columnType/:database/:table/:columnGETGet column length/xmeta/api/v1/get/columnLength/:database/:table/:columnGETGet column at pos/xmeta/api/v1/get/columnAtPos/:database/:table/:columnIndexGETGet primary key/xmeta/api/v1/get/primaryKey/:database/:tableGETGet foreign key/xmeta/api/v1/get/foreignKey/:database/:tableGETGet foreign key reference tables**/xmeta/api/v1/get/foreignKeysRefTable/:database/:tableGETGet indexes/xmeta/api/v1/get/indexes/:database/:tableGETGet all indexes and ref tables/xmeta/api/v1/get/allIdxRefTable/:database/:tableGETDatabase exists/xmeta/api/v1/exists/db/:dbGETTable exists/xmeta/api/v1/exists/table/:database/:tableGETColumn exists/xmeta/api/v1/exists/column/:database/:table/:columnGETSupported features/xmeta/api/v1/get/supports/:featureGETGet database info/xmeta/api/v1/info/db/GETGet database driver info/xmeta/api/v1/info/dbdriver/
- After running the application in
--mode restdo the following: - Send Post request to
/auth, with your database credentials in the following json format:
{"db_host":"<db_host>","db_port":<db_port> ,"db_user":"<db_user>","db_pass":"<db_pass>","db_type":"mysql"} - If your credentials are correct the service will generate and return a
tokenin json response. Thistokenwill be used in the header for other subsequent requests otherwise the service will returnunauthorizedin response. You have to send thistokenin the request header in this formatAuthorization: bearer <your_token>
NOTE:
Optionally in the above json you can specify the name of the host database usingdb_nameand token expire time usingtoken_expires_minkey e.g.{...,"db_name":"Employee","token_expires_min":60,...}
NOTE: A question Mark(?) before option represents optional parameter
-
xmeta --help
shows all available commands with their usage -
xmeta <commandName> --help
shows help regarding this command -
xmeta connect -host <db_host> -port <db_port> -user <db_user> -pass <db_pwd> -type <db_type>
connects to database-typerepresents type of db to connect to e.g. mysql | postgresql -
xmeta showDatabases
shows available databases -
xmeta showTables -db <db_name>
shows available tables in the database -
xmeta showColumns -db <db_name> -tbl <table_name>
shows all columns in the table -
xmeta showColsWithType -db <db_name> -tbl <table_name>
shows all columns along with their data type in the table -
xmeta getColType -db <db_name> -tbl <table_name> -col <col_name>
shows data type of the single column -
xmeta getColLength -db <db_name> -tbl <table_name> -col <col_name>
shows length of the column -
xmeta getColAtPos -db <db_name> -tbl <table_name> -pos <col_pos>
shows column at position-pos -
xmeta getPK -db <db_name> -tbl <table_name>
prints primary key of the table -
xmeta getFK -db <db_name> -tbl <table_name>
prints foreign key of the table -
xmeta getFKRefTables -db <db_name> -tbl <table_name>
prints foreign keys and their reference tables -
xmeta getIndexes -db <db_name> -tbl <table_name>
prints indexes in the table -
xmeta getAllIdxRefTable -db <db_name> -tbl <table_name>
prints all indexes and their reference tables -
xmeta existsDatabase -db <db_name>
printstrueif database existsfalseother wise -
xmeta existsTable -db <db_name> -tbl <table_name>
printstrueif table existsfalseother wise -
xmeta existsColumn -db <db_name> -tbl <table_name> -col <col_name>
printstrueif column existsfalseother wise -
xmeta isSupport -f <feature_name>
printstrueif the feature-fsupported by the database driver
- A wraper for the underlying DB driver
- connect to db
- extract meta data
- A wraper for the CORE CLASSES
- use core features through command line
- Use Vertx micro services
- User authentication
- A wraper for the CORE CLASSES
- define specific end points for each core feature
- generate Json as a response