45 std::cout <<
"The informed data source is NULL or is closed!" << std::endl;
50 std::unique_ptr<te::da::DataSourceTransactor> t(ds->
getTransactor());
56 std::cout <<
"Printing information about datasets...\n\nNumber of datasets: " << datasets.size() << std::endl;
58 for(std::size_t i = 0; i < datasets.size(); ++i)
65 std::cout <<
"\n=============================================================================" << std::endl;
66 std::cout <<
"DataSet: " <<
dt->getName() << std::endl;
67 std::cout <<
">>>>>Number of attributes: " <<
dt->size() << std::endl;
70 std::cout <<
">>>>>Primary Key Information" << std::endl;
75 const std::vector<te::dt::Property*>& pkCols = pk->
getProperties();
77 std::vector<std::string> pNames(pkCols.size());
78 for(std::size_t i = 0; i < pkCols.size(); ++i)
80 pNames[i]= pkCols[i]->getName();
81 std::cout <<
"\t" <<
"Column " << i <<
": " << pNames[i] << std::endl;
85 std::cout <<
"\t" <<
"The data set has no primary key!" << std::endl;
88 std::cout <<
">>>>>Unique Key Information" << std::endl;
91 std::size_t numUniqueKeys =
dt->getNumberOfUniqueKeys();
93 if(numUniqueKeys == 0)
94 std::cout <<
"\t" <<
"The data set has no unique keys!" << std::endl;
96 for(std::size_t i = 0; i < numUniqueKeys; ++i)
99 const std::vector<te::dt::Property*>& ukCols = uk->
getProperties();
101 std::vector<std::string> pNames(ukCols.size());
102 for(std::size_t i = 0; i < ukCols.size(); ++i)
104 pNames[i]= ukCols[i]->getName();
105 std::cout <<
"\t" <<
"Column " << i <<
": " << pNames[i] << std::endl;
110 std::cout <<
">>>>>Index(es) Information" << std::endl;
113 std::size_t numIndexes =
dt->getNumberOfIndexes();
116 std::cout <<
"\t" <<
"The data set has no index(es)!" << std::endl;
118 std::cout <<
"- Number of Indexes: " << numIndexes << std::endl;
120 for(std::size_t i = 0; i < numIndexes; ++i)
124 std::cout <<
"- Index Name: " << inx->
getName() << std::endl;
126 const std::vector<te::dt::Property*>& inxCols = inx->
getProperties();
128 std::vector<std::string> pNames(inxCols.size());
129 for(std::size_t i = 0; i < inxCols.size(); ++i)
131 pNames[i]= inxCols[i]->getName();
132 std::cout <<
" Column " << i <<
": " << pNames[i] << std::endl;
136 std::size_t numCC =
dt->getNumberOfCheckConstraints();
138 std::cout <<
">>>>>Check Contraint(s) Information" << std::endl;
140 std::cout <<
" Number of Check-Constraints: " << numCC << std::endl;
142 for(std::size_t i = 0; i < numCC; ++i)
145 std::cout <<
" Check Constraint Name: " << cc->
getName();
146 std::cout <<
", Expression = " << cc->
getExpression() << std::endl;
149 std::cout << std::endl;
virtual std::unique_ptr< DataSourceTransactor > getTransactor()=0
It returns the set of parameters used to set up the access channel to the underlying repository...
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
virtual bool isOpened() const =0
It returns true if the data source is opened, otherwise it returns false.
Examples that show how to access/manipulate an ADO data source.
static te::dt::Date ds(2010, 01, 01)
A class that describes a check constraint.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
const std::vector< te::dt::Property * > & getProperties() const
It returns the properties that take part of the primary key.
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
const std::string & getExpression() const
It returns the check constraint expression.
static te::dt::TimeDuration dt(20, 30, 50, 11)
virtual std::vector< std::string > getDataSetNames()
It gets the dataset names available in the data source.
It describes a unique key (uk) constraint.
virtual std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)
It gets information about the given dataset.
const std::vector< te::dt::Property * > & getProperties() const
It returns the properties that form the unique key.
const std::vector< te::dt::Property * > & getProperties() const
It returns the properties that take part of the index.
It describes a primary key (pk) constraint.
This file contains include headers for the TerraLib Common Runtime module.
void PrintCatalog(te::da::DataSource *ds)
This example will print to the standard output all the information about the datasets stored in a dat...
A dataset is the unit of information manipulated by the data access module of TerraLib.
virtual const std::string & getName() const
It returns the constraint name.
It describes an index associated to a DataSetType.
const std::string & getName() const
It returns the index name.