Tools → Data Source Copy

This application allows users to copy data from one data source to another one. There is a command line (CLI) tool that can be used in a shell…

Design

This tools is organized in two modules:

  • the core ….
  • the console module is a command line application that can be used to quickly find out what is stored in a data source.

Main class diagram….

Command Line Parameters

  • Required Parameters:
    • -o or –ds-type-origin “name”: the type of the origin data source to connect. May be: POSTGIS, SQLITE, GRIB, MYSQL, GDAL, OGR.
    • -s or –conn-str-origin “conn-info”: an string with the information needed to connect to the origin data source.
    • -d or –ds-type-destination “name”: the type of the destination data source to connect. May be: POSTGIS, SQLITE, GRIB, MYSQL, GDAL, OGR.
    • -t or –conn-str-destination “conn-info”: an string with the information needed to connect to the destination data source.
    • –dataset “name”: query a specific data set to copy.
    • –datasets “d1” “d2” “d3” … : query information about a list of data sets to copy.
  • Optional Parameters:
    • –help: display help information.

From Theory to Practice

te_dscopy <options>

  • To display the help:
--help
  • To copy a Data Set
-o POSTGIS -s "host=127.0.0.1&port=5432&dbname=originDB&user=postgres&password=postgres&connect_timeout=4" -d POSTGIS -t "host=127.0.0.1&port=5432&dbname=destinationDB&user=postgres&password=postgres&connect_timeout=4" --dataset MyDataSet
  • To copy all Data Source:
-o POSTGIS -s "host=127.0.0.1&port=5432&dbname=originDB&user=postgres&password=postgres&connect_timeout=4" -d POSTGIS -t "host=127.0.0.1&port=5432&dbname=destinationDB&user=postgres&password=postgres&connect_timeout=4"
  • To copy a list of Data Sets:
-o POSTGIS -s "host=127.0.0.1&port=5432&dbname=originDB&user=postgres&password=postgres&connect_timeout=4" -d POSTGIS -t "host=127.0.0.1&port=5432&dbname=destinationDB&user=postgres&password=postgres&connect_timeout=4" --datasets dataset1 dataset2

Module Summary



Besides the C++ code there is also…

Final Remarks

References

TO BE DONE


QR Code
QR Code wiki:designimplementation:tools:dscopy (generated for current page)