Table of Contents
Tools → Data Source Information
This application allows users to query a data source for metadata. There is a command line interface (CLI) that can be used to show data source information like:
- data source capabilities
- the name of datasets stored in the data source
- details about each dataset:
- number of itens
- properties information
- primary key
- indexes
- relationship
- data source connection parameters
Design
This tools is organized in two modules:
- core: this module controls all application functions.
- console: the CLI application that can be used to quickly find out what is stored in a data source.
Command Line Parameters
- Required Parameters:
- –ds-type “name”: the type of data source to connect. May be: POSTGIS, SQLITE, GRIB, MYSQL, GDAL, OGR.
- –conn-str “conn-info”: an string with the information needed to connect to the data source (not required only for –show-ds-params).
- Optional Parameters:
- –show-ds-params display Data Sources type connection parameters.
- –dataset “name”: query a specific data set.
- –datasets “d1” “d2” “d3” … : query information about a list of data sets.
- –show-all: show all information about datasets.
- –pk-details: display details about primary key on the dataset.
- –fk-details: display details about foreign keys on the dataset.
- –uk-details: display details about unique keys on the dataset.
- –idx-details: display details about indexes on the dataset.
- –cc-details: if displays Check Contraint details.
- –list-datasets: list only datasets name.
- –help: display help information.
Class Diagram
DSInfo
The DSInfo class has the responsibility to access the Terralib informations, store in structures containing the most common data types and passed to the called.
PrintManager
The PrintManager class has the responsibility to receive all information to be displayed and print on screen.
From Theory to Practice
te_dsinfo <options>
- To display the help:
--help
- To find out a Data Set list of Data Source:
--ds-type POSTGIS --conn-str "host=127.0.0.1&port=5432&dbname=mydatabase&user=postgres&password=postgres&connect_timeout=4"
- To find out all informations about a Data Source, including details:
--ds-type POSTGIS --conn-str "host=127.0.0.1&port=5432&dbname=mydatabase&user=postgres&password=postgres&connect_timeout=4" --show-all --pkDetails --fkDetails --ukDetails --idxDetails --ccDetails
- To find out the list of datasets in a Data Source:
--ds-type POSTGIS --conn-str "host=127.0.0.1&port=5432&dbname=mydatabase&user=postgres&password=postgres&connect_timeout=4" --list-datasets
- To find out the informations about a specific Data Set of a Data Source:
--ds-type POSTGIS --conn-str "host=127.0.0.1&port=5432&dbname=mydatabase&user=postgres&password=postgres&connect_timeout=4" --dataset "public.mydataset"
- To find out the informations about more than one Data Set of a Data Source:
--ds-type POSTGIS --conn-str "host=127.0.0.1&port=5432&dbname=mydatabase&user=postgres&password=postgres&connect_timeout=4" --datasets "public.mydataset" "public.mydataset2"
- To show specific data source type connection parameters:
--ds-type POSTGIS --show-ds-params
- To show all data source type available connection parameters:
--show-ds-params
Module Summary
----------------------------------------------------- Language files blank comment code ----------------------------------------------------- C++ 5 144 3 524 C/C++ Header 4 131 237 86 ----------------------------------------------------- SUM: 9 275 240 610 -----------------------------------------------------
Final Remarks
- COLOCAR UMA LISTA DE TODAS AS PENDENCIAS E MELHORIAS FUTURAS PREVISTAS E DESEJADAS
References
For each data source you have a list of connection information needed by it. You can consult this list in each data source specific section:
- … colocar os outros todos com link para a seção certa