16 std::cout <<
"Command Line Error: Data Source Type (ds-type) missing!" << std::endl;
19 else if(connstr.empty())
21 std::cout <<
"Command Line Error: Data Source Connection String (conn-str) missing!" << std::endl;
28 std::string errorMessage;
35 std::cout << std::endl <<
"Could not get a connection with the DataSource." << std::endl;
45 te::da::DataSourceCatalogLoader* catalog = transactor->getCatalogLoader();
73 te::da::DataSourceCatalogLoader* catalog = transactor->getCatalogLoader();
76 std::vector<FKInfo> vecFkInfo;
80 for(
unsigned int i = 0; i < fkNumber; i++)
88 vecFkInfo.push_back(fkInfo);
101 te::da::DataSourceCatalogLoader* catalog = transactor->getCatalogLoader();
104 std::vector<UKInfo> vecUkInfo;
108 for(
unsigned int i = 0; i < ukNumber; i++)
116 vecUkInfo.push_back(ukInfo);
129 te::da::DataSourceCatalogLoader* catalog = transactor->getCatalogLoader();
132 std::vector<IdxInfo> vecIdxInfo;
136 for(
unsigned int i = 0; i < idxNumber; i++)
145 vecIdxInfo.push_back(idxInfo);
158 te::da::DataSourceCatalogLoader* catalog = transactor->getCatalogLoader();
161 std::vector<CCInfo> vecCcInfo;
165 for(
unsigned int i = 0; i < ccNumber; i++)
173 vecCcInfo.push_back(ccInfo);
192 ds.
name = dataSetName;
211 std::vector<std::string*> dataSetsNames;
215 te::da::DataSourceCatalogLoader* catalogLoader = transactor->getCatalogLoader();
217 catalogLoader->getDataSets(dataSetsNames);
220 delete catalogLoader;
222 return dataSetsNames;
227 std::vector<DataSetStruct> vecDataSetStruct;
229 std::map<std::string, te::da::DataSet*> dataSets;
231 std::vector<std::string*> dataSetsNames;
235 te::da::DataSourceCatalogLoader* catalogLoader = transactor->getCatalogLoader();
237 catalogLoader->getDataSets(dataSetsNames);
239 for(std::vector<std::string*>::const_iterator it = dataSetsNames.begin(); it < dataSetsNames.end(); ++it)
241 const std::string* datasetName = *it;
247 delete catalogLoader;
249 return vecDataSetStruct;
260 dsh.
name = (!connInfo[
"dbname"].empty() ? connInfo[
"dbname"] : std::string());
268 std::map<std::string, std::string> capMap;
273 return std::map<std::string, std::string>();
280 std::map<std::string, std::vector<std::string>> mapParams;
282 std::string errorMessage;
287 te::da::DataSourceFactory::dictionary_type::const_iterator it = te::da::DataSourceFactory::getDictionary().begin();
288 te::da::DataSourceFactory::dictionary_type::const_iterator itend = te::da::DataSourceFactory::getDictionary().end();
292 std::string datasourceType = it->first;
296 std::vector<std::string> datasourceParams;
298 factory->getConnectionParameters(datasourceParams);
300 mapParams[datasourceType] = datasourceParams;
315 std::vector<std::string> datasourceParams;
317 factory->getConnectionParameters(datasourceParams);
319 mapParams[dsType] = datasourceParams;
323 std::cout << std::endl <<
"Parameters Unknown!" << std::endl;
Struct that stores information about a index using the most common data types.
bool init(std::string dstype, std::string connstr)
Init the application.
std::vector< std::string > porperties
Foreign Key Properties in a string vector.
std::vector< UKInfo > vecUkInfo
Unique Key struct vector.
std::string m_connStr
The Data Source Connection String.
std::vector< std::string > porperties
Unique Key Properties in a string vector.
static std::vector< std::string > getFKPropertiesNames(te::da::ForeignKey *fk)
Getting Foreign Key Properties Names.
A class that models the description of a dataset.
std::size_t getNumberOfUniqueKeys() const
It returns the number of unique keys defined for the dataset type.
CheckConstraint * getCheckConstraint(std::size_t i) const
It returns the i-th check-constraint associated to the dataset type.
DataSetStruct getDataSetInfo(std::string dataSetName)
Get specific Data Set information.
virtual std::auto_ptr< DataSourceTransactor > getTransactor()=0
It returns an object that can execute transactions in the context of a data source.
PrimaryKey * getPrimaryKey() const
It returns the primary key associated to the dataset type.
std::vector< std::string > porperties
Primary Key Properties in a string vector.
Struct that stores information about a check constraint using the most common data types...
static bool loadModules(std::string &errorMessage)
Load Terralib modules.
std::vector< IdxInfo > getIndexesKeyInfo(std::string dataSetName)
Get indexes information.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
std::vector< std::string > porperties
Index Properties in a string vector.
std::vector< IdxInfo > vecIdxInfo
Index struct vector.
A class that describes a check constraint.
static std::vector< std::string > getIdxPropertiesNames(te::da::Index *idx)
Getting Index Properties Names.
std::string type
Index Type.
std::string name
Index Name.
std::vector< FKInfo > getForeignKeyInfo(std::string dataSetName)
Get foreign keys information.
Index * getIndex(std::size_t i) const
It returns the i-th index associated to the dataset type.
Struct that stores information about a primary key using the most common data types.
std::string name
Primary Key Name.
std::size_t getNumberOfForeignKeys() const
It returns the number of foreign keys defined for the dataset type.
const std::string & getExpression() const
It returns the check constraint expression.
std::string m_dataSourceType
The Data Source Type.
DataSourceHeader getDataSourceHeader()
Get the Data Source Header.
std::string expression
Check Constraint Expression.
virtual std::string getType() const =0
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
std::size_t getNumberOfIndexes() const
It returns the number of indexes defined for the dataset type.
virtual const DataSourceCapabilities & getCapabilities() const =0
It returns the known capabilities of the data source.
static bool getDataSource(std::string dsType, std::string connStr, te::da::DataSource *&dataSource, std::string &errorMessage)
Method to connect with a Data Source.
std::map< std::string, std::string > getCapabilities()
Get the Data Source Capabilities.
It models a foreign key constraint for a DataSetType.
std::vector< CCInfo > vecCcInfo
Check Constraint struct vector.
Struct that stores information about a data set using the most common data types. ...
std::string name
Check Constraint Name.
It describes a unique key (uk) constraint.
static std::vector< std::string > getPKPropertiesNames(te::da::PrimaryKey *pk)
Getting Primary Key Properties Names.
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
static std::vector< std::string > getUKPropertiesNames(te::da::UniqueKey *uk)
Getting Unique Key Properties Names.
static te::da::DataSet * getDataSet(te::da::DataSource *dataSource, std::string dataSetName)
Struct that stores information about a unique key using the most common data types.
A dataset is the unit of information manipulated by the data access module of TerraLib.
std::map< std::string, std::vector< std::string > > getDataSourceParameters(std::string dataSourceType)
Get Data Source Types connection parameters.
std::string name
Foreign Key Name.
std::vector< CCInfo > getCheckConstraintInfo(std::string dataSetName)
Get check constraint information.
ForeignKey * getForeignKey(std::size_t i) const
It returns the i-th foreign key associated to the dataset type.
std::vector< std::string * > getDataSetNameList()
Get all Data Sets names.
std::size_t getNumberOfCheckConstraints() const
It returns the number of check-constraints defined over the dataset type.
PKInfo getPrimaryKeyInfo(std::string dataSetName)
Get primary key information.
It describes a primary key (pk) constraint.
te::da::DataSource * m_dataSource
The Data Source.
std::vector< FKInfo > vecFkInfo
Foreign Key struct vector.
static std::string getIdxTypeName(int id)
DSInfo()
Class Constructor.
std::vector< DataSetStruct > getDataSetsInfo()
Get all Data Sets informations.
virtual const std::string & getName() const
It returns the constraint name.
Struct that stores information about a foreign key using the most common data types.
bool hasPk
If has Primary key.
IndexType getIndexType() const
It gets the index type.
std::string name
Unique Key Name.
It describes an index associated to a DataSetType.
Data Source Informations tool.
virtual const std::map< std::string, std::string > & getConnectionInfo() const =0
It returns the set of parameters used to set up the access channel to the underlying repository...
UniqueKey * getUniqueKey(std::size_t i) const
It returns the i-th unique key.
std::vector< UKInfo > getUniqueKeyInfo(std::string dataSetName)
Get unique keys information.
A factory for data sources.
std::string name
Data Set Name.
PKInfo pkInfo
Primary Key struct.
const std::string & getName() const
It returns the index name.