DataSource.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/dataaccess/datasource/DataSource.h
22 
23  \brief An abstract class for data providers like a DBMS, Web Services or a regular file.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_DATASOURCE_INTERNAL_DATASOURCE_H
27 #define __TERRALIB_DATAACCESS_DATASOURCE_INTERNAL_DATASOURCE_H
28 
29 // TerraLib
30 #include "../../common/Enums.h"
31 #include "../../geometry/Enums.h"
32 #include "../dataset/CheckConstraint.h"
33 #include "../dataset/DataSet.h"
34 #include "../dataset/DataSetType.h"
35 #include "../dataset/ForeignKey.h"
36 #include "../dataset/Index.h"
37 #include "../dataset/PrimaryKey.h"
38 #include "../dataset/Sequence.h"
39 #include "../dataset/UniqueKey.h"
40 #include "../Config.h"
41 
42 // STL
43 #include <map>
44 #include <memory>
45 #include <string>
46 #include <vector>
47 #include <set>
48 
49 // Boost
50 #include <boost/ptr_container/ptr_vector.hpp>
51 #include <boost/cstdint.hpp>
52 #include <boost/noncopyable.hpp>
53 #include <boost/shared_ptr.hpp>
54 
55 namespace te
56 {
57  namespace dt
58  {
59  class Property;
60  }
61 
62  namespace gm
63  {
64  class Envelope;
65  class Geometry;
66  }
67 
68  namespace da
69  {
70  class DataSetTypeCapabilities;
71  class DataSourceCapabilities;
72  class DataSourceTransactor;
73  class ObjectIdSet;
74  class Query;
75  class Select;
76  class SQLDialect;
77  class CheckConstraint;
78  class ForeignKey;
79  class Index;
80  class PrimaryKey;
81  class Sequence;
82  class UniqueKey;
83 
84  /*!
85  \class DataSource
86 
87  \brief An abstract class for data providers like a DBMS, Web Services or a regular file.
88 
89  A data source is the fundamental class of the data access module and
90  it may represent a data repository. Among other things, a repository can be:
91  <ul>
92  <li>a PostgreSQL database</li>
93  <li>an Oracle database</li>
94  <li>an OGC Web Feature Service</li>
95  <li>a directory of ESRI shape-files</li>
96  <li>a data stream</li>
97  <li>
98 
99  A data source can be used to access data in a repository
100  and it requires a driver implementation that must register a
101  concrete factory for building data source objects
102  of the type of the driver (DataSourceFactory).
103 
104  Each data source is characterized by a set of parameters that can be used
105  to set up an access channel to its underlying repository. This information
106  is referred as the data source connection information.
107 
108  A data source exposes the data contained in it as a collection of datasets.
109  The information about the data stored in a data source may be retrieved.
110 
111  Besides the descriptive information about the underlying data repository,
112  each data source also provides information about their capabilities.
113 
114  \ingroup dataaccess
115 
116  \sa DataSourceManager, DataSourceFactory, DataSet, DataSetType
117  */
118  class TEDATAACCESSEXPORT DataSource : public boost::noncopyable
119  {
120  public:
121 
122  /*! \brief Default constructor that can be called by subclasses. */
123  DataSource();
124 
125  /*! \brief Virtual destructor. */
126  virtual ~DataSource();
127 
128  /*!
129  \brief An identification value for the data source.
130 
131  \return The data source identification.
132  */
133  const std::string& getId() const;
134 
135  /*!
136  \brief It sets the data source identification.
137 
138  \param id An identification value.
139  */
140  void setId(const std::string& id);
141 
142  /** @name Data Source Basic Methods
143  * Basic Methods for operating a data source.
144  */
145  //@{
146 
147  /*!
148  \brief It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
149 
150  \return The data source type name. Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
151 
152  \note Each data source driver must have a unique name.
153 
154  \note Thread-safe!
155  */
156  virtual std::string getType() const = 0;
157 
158  /*!
159  \brief It returns the set of parameters used to set up the access channel to the underlying repository.
160 
161  This is the connection information used by a data source in order to enter in an operational mode,
162  when the open method is called.
163 
164  The key-value-pairs (kvp) may contain information about: maximum number of accepted connections,
165  user name and password required for establishing a connection, the url of a service, or any other
166  information needed by the data source to operate. This information is dependent on the data source
167  driver, so check the driver documentation for any additional information about the kvp.
168 
169  \return An associative container (key-value-pair) with information about the data source.
170 
171  \note Thread-safe!
172  */
173  virtual const std::map<std::string, std::string>& getConnectionInfo() const = 0;
174 
175  /*!
176  \brief It sets the connection information to be used when connecting to the data source.
177 
178  \param connInfo Key-value-pairs (kvp) with the connection information.
179  */
180  virtual void setConnectionInfo(const std::map<std::string, std::string>& connInfo) = 0;
181 
182  /*!
183  \brief It returns an object that can execute transactions in the context of a data source.
184 
185  Use this method to get an object that allows to retrieve a dataset, to insert or update data,
186  or to modify dataset types(schemas). You don't need to cache this kind of object because each
187  driver in TerraLib already keeps a connection pooling. So, as soon as you finish using
188  the transactor, destroy it.
189 
190  \return A pointer to an object that can execute transactions in the context of a data source.
191 
192  \exception Exception An exception can be thrown, if it is not possible to get a transactor;
193  for example, if there is no available connection.
194 
195  \note Thread-safe!
196  */
197  virtual std::auto_ptr<DataSourceTransactor> getTransactor() = 0;
198 
199  /*!
200  \brief It opens the data source and makes it ready for using.
201 
202  If the subclass needs to open a connection to a database server,
203  to open a file, or to get information from a Web Service, this
204  method can do this kind of job to prepare the data source to be
205  in an operational mode. It will use the connection information
206  provided by the setConnectionInfo methods.
207 
208  \exception Exception An exception can be thrown, if the data source cannot be opened.
209 
210  \note Not thread-safe!
211  */
212  virtual void open() = 0;
213 
214  /*!
215  \brief It closes the data source and clears all the resources used by its internal communication channel.
216 
217  This method closes any connection, any opened file, and releases any other resources.
218 
219  \exception Exception An exception can be thrown, if the data source cannot be closed.
220 
221  \note Not thread-safe!
222  */
223  virtual void close() = 0;
224 
225  /*!
226  \brief It returns true if the data source is opened, otherwise it returns false.
227 
228  This method will not check if the data source is available for using;
229  it will just answer if the data source has already been opened.
230  If you want to know if the data source is available for using,
231  check the isValid() method.
232 
233  \return It returns true if the data source is opened; otherwise, it returns false.
234 
235  \note Not thread-safe!
236  */
237  virtual bool isOpened() const = 0;
238 
239  /*!
240  \brief It checks if the data source is valid (available for using).
241 
242  For a DBMS, it will check the opened connections.
243  For a WFS client, it will check if the server is reachable.
244  For a file, it will check if it can be read.
245 
246  \return It returns true if the data source is available; otherwise, it returns false.
247 
248  \note Not thread-safe!
249  */
250  virtual bool isValid() const = 0;
251 
252  /*!
253  \brief It returns the known capabilities of the data source.
254 
255  The returned object has all the information about the operations the data source can perform.
256  Here you will find if the data source implementation supports primary keys,
257  foreign keys, if it can be used in a thread environment and much more information.
258 
259  \param capabilities The known capabilities of the data source.
260 
261  \note Thread-safe!
262  */
263  virtual const DataSourceCapabilities& getCapabilities() const = 0;
264 
265  /*!
266  \brief It returns the data source SQL dialect, if there is one.
267 
268  \return The data source SQL dialect.
269 
270  \note Thread-safe!
271  */
272  virtual const SQLDialect* getDialect() const = 0;
273  //@}
274 
275  /** @name Data Retrieval
276  * Methods for retrieving data from the data source.
277  */
278  //@{
279 
280  /*!
281  \brief It gets the dataset identified by the given name.
282  This method always returns a disconnected dataset, that is, a dataset that no more depends
283  of the data source that provided the connection for its creation. Therefore, the disconnected
284  dataset continues to live after the connection given by the data source has been released.
285 
286  \param name The dataset name.
287  \param accessPolicy Access policy.
288  \param travType The traverse type associated to the returned dataset.
289 
290  \exception Exception It can throw an exception if:
291  <ul>
292  <li>something goes wrong during the data retrieval</li>
293  <li>if the data source driver doesn't support the traversal type</li>
294  </ul>
295 
296  \note Thread-safe!
297  */
298  virtual std::auto_ptr<DataSet> getDataSet(const std::string& name,
300  const te::common::AccessPolicy accessPolicy = te::common::RAccess);
301 
302  /*!
303  \brief It gets the dataset identified by the given name using a spatial filter over the specified property.
304  This method always returns a disconnected dataset, that is, a dataset that no more depends
305  of the data source that provided the connection for its creation. Therefore, the disconnected
306  dataset continues to live after the connection given by the data source has been released.
307 
308  \param name The dataset name.
309  \param propertyName The name of the spatial property used to apply the spatial filter.
310  \param e A rectangle used as a spatial filter when retrieving the dataset.
311  \param r The spatial relation used during the filtering.
312  \param accessPolicy Access policy.
313  \param travType The traversal type associated to the returned dataset.
314 
315  \exception Exception It can throw an exception if:
316  <ul>
317  <li>something goes wrong during the data retrieval</li>
318  <li>if the data source driver doesn't support the traversal type</li>
319  </ul>
320 
321  \note The envelope coordinates should be in the same coordinate system as the dataset.
322 
323  \note Thread-safe!
324  */
325  virtual std::auto_ptr<DataSet> getDataSet(const std::string& name,
326  const std::string& propertyName,
327  const te::gm::Envelope* e,
330  const te::common::AccessPolicy accessPolicy = te::common::RAccess);
331 
332  /*!
333  \brief It gets the dataset identified by the given name using a spatial filter over the given geometric property.
334  This method always returns a disconnected dataset, that is, a dataset that no more depends
335  of the data source that provided the connection for its creation. Therefore, the disconnected
336  dataset continues to live after the connection given by the data source has been released.
337 
338  \param name The dataset name.
339  \param propertyName The name of the spatial property used to apply the spatial filter.
340  \param g The geometry used as a spatial filter when retrieving the dataset.
341  \param r The spatial relation used during the filtering.
342  \param accessPolicy Access policy.
343  \param travType The traverse type associated to the returned dataset.
344 
345  \note The geometry coordinates should be in the same coordinate system as the dataset.
346 
347  \note Thread-safe!
348  */
349  virtual std::auto_ptr<DataSet> getDataSet(const std::string& name,
350  const std::string& propertyName,
351  const te::gm::Geometry* g,
354  const te::common::AccessPolicy accessPolicy = te::common::RAccess);
355 
356  /*!
357  \brief It gets the dataset identified by the given name using the identification of the objects.
358  This method always returns a disconnected dataset, that is, a dataset that no more depends
359  of the data source that provided the connection for its creation. Therefore, the disconnected
360  dataset continues to live after the connection given by the data source has been released.
361 
362  \param name The dataset name.
363  \param oids A pointer to the set of objects. Do not pass a null pointer nor an empty set.
364  \param accessPolicy Access policy.
365  \param travType The traverse type associated to the returned dataset.
366 
367  \exception Exception It can throw an exception if:
368  <ul>
369  <li>something goes wrong during data retrieval</li>
370  <li>if the data source driver doesn't support the traversal type</li>
371  </ul>
372 
373  \note Thread-safe!
374  */
375  std::auto_ptr<te::da::DataSet> getDataSet(const std::string& name,
376  const te::da::ObjectIdSet* oids,
378  const te::common::AccessPolicy accessPolicy = te::common::RAccess);
379 
380  /*!
381  \brief It executes a query that may return some data using a generic query.
382  This method always returns a disconnected dataset, that is, a dataset that no more depends
383  of the data source that provided the connection for its creation. Therefore, the disconnected
384  dataset continues to live after the connection given by the data source has been released.
385 
386  This method is different of the method that accepts a dataset name and
387  a spatial filter; this method allows the retrieving of only a
388  subset of the attributes, since a query can include a property list.
389 
390  \param q A valid query object.
391  \param travType The traverse type associated to the returned dataset.
392  \param accessPolicy Access policy.
393 
394  \exception Exception It can throw an exception if:
395  <ul>
396  <li>something goes wrong during data retrieval</li>
397  <li>if the data source driver doesn't support the traversal type</li>
398  </ul>
399 
400  \note Thread-safe!
401  */
402  virtual std::auto_ptr<DataSet> query(const Select& q,
404  const te::common::AccessPolicy accessPolicy = te::common::RAccess);
405 
406  /*!
407  \brief It executes a query that may return some data using the data source native language.
408  This method always returns a disconnected dataset, that is, a dataset that is no more dependent
409  of the data source that provided the connection for its creation. Therefore, the disconnected
410  dataset continues to live after the connection given by the data source has been released.
411 
412  \param query A query string in the data source native language.
413  \param travType The traverse type associated to the returned dataset.
414  \param accessPolicy Access policy.
415 
416  \exception Exception It can throw an exception if:
417  <ul>
418  <li>something goes wrong during data retrieval</li>
419  <li>if the data source driver doesn't support the traversal type</li>
420  </ul>
421 
422  \note Don't use this method, if you want portability for your application.
423  \note Thread-safe!
424  */
425  virtual std::auto_ptr<DataSet> query(const std::string& query,
427  const te::common::AccessPolicy accessPolicy = te::common::RAccess);
428  //@}
429 
430  /** @name Command Execution Methods
431  * Methods for executing commands against the data source.
432  */
433  //@{
434  /*!
435  \brief It executes the specified command using a generic query representation.
436 
437  \param command A query like: CREATE, DROP, ALTER, INSERT, UPDATE, DELETE.
438 
439  \exception Exception An exception can be thrown if the query cannot be performed.
440 
441  \note Thread-safe!
442  */
443  virtual void execute(const Query& command);
444 
445  /*!
446  \brief It executes the specified command in the data source native language.
447 
448  \param command A query string in the data source native language (like: CREATE, DROP, ALTER, INSERT, UPDATE, DELETE).
449 
450  \exception Exception An exception can be thrown if the query can not be performed.
451 
452  \note Thread-safe!
453  */
454  virtual void execute(const std::string& command);
455  //@}
456 
457  /** @name Auxiliary Methods for Commands and Queries
458  * Auxiliary methods for commands and queries.
459  */
460  //@{
461  /*!
462  \brief It escapes a string for using in commands and queries.
463 
464  \param value Any string.
465 
466  \return A valid escaped string.
467 
468  \note Thread-safe!
469  */
470  virtual std::string escape(const std::string& value);
471 
472  /*!
473  \brief It checks if the given dataset name is valid.
474 
475  \param datasetName A dataset name whose validity will be checked.
476 
477  \return True, if the name is valid according to the data source rules.
478 
479  \note Thread-safe!
480  */
481  virtual bool isDataSetNameValid(const std::string& datasetName);
482 
483  /*!
484  \brief It checks if the given property name is valid.
485 
486  \param propertyName A property name whose validity will be checked.
487 
488  \return True, if the name is valid according to the data source rules.
489 
490  \note Thread-safe!
491  */
492  virtual bool isPropertyNameValid(const std::string& propertyName);
493  //@}
494 
495  /** @name Dataset Metadata Retrieval
496  * Methods for retrieving metadata about the datasets of the data source.
497  */
498  //@{
499  /*!
500  \brief It gets the dataset names available in the data source.
501 
502  \return The dataset names available in the data source.
503 
504  \exception Exception An exception can be thrown, if the dataset names could not be retrieved.
505 
506  \note Each dataset in the data source must have a unique name. For example, in a DBMS the name
507  may contain the schema name before the table name separated by a dot notation (".").
508 
509  \note Thread-safe!
510  */
511  virtual std::vector<std::string> getDataSetNames();
512 
513  /*!
514  \brief It retrieves the number of data sets available in the data source.
515 
516  \exception Exception An exception can be thrown, if the number of datasets could not be retrieved.
517 
518  \return The number of data sets available in the data source.
519 
520  \note Thread-safe!
521  */
522  virtual std::size_t getNumberOfDataSets();
523 
524  /*!
525  \brief It gets information about the given dataset.
526 
527  This method can provide the following information about a dataset:
528  <ul>
529  <li>the list of properties, including: name, data type, size, if the value is required or not, if it is an autoincrement</li>
530  <li>primary key</li>
531  <li>foreign keys</li>
532  <li>unique keys</li>
533  <li>check constraints</li>
534  <li>indexes</li>
535  </ul>
536 
537  \param name The name of the dataset we are looking information for.
538 
539  \exception Exception An exception can be thrown, if the information about the dataset could not be retrieved.
540 
541  \return The dataset schema.
542 
543  \note Thread-safe!
544  */
545  virtual std::auto_ptr<te::da::DataSetType> getDataSetType(const std::string& name);
546 
547  /*!
548  \brief It gets capabilities about a data set.
549 
550  \param name Name of the dataset.
551 
552  \return The capabilities of the data set.
553  */
554  std::auto_ptr<te::da::DataSetTypeCapabilities> getCapabilities(const std::string& name);
555 
556  /*!
557  \brief It retrieves the properties of the dataset.
558 
559  \param datasetName The dataset name.
560 
561  \exception Exception An exception can be thrown, if the dataset properties could not be retrieved.
562 
563  \return The dataset properties.
564 
565  \note Thread-safe!
566  */
567  virtual boost::ptr_vector<te::dt::Property> getProperties(const std::string& datasetName);
568 
569  /*!
570  \brief It retrieves the property with the given name from the dataset.
571 
572  \param datasetName The dataset name.
573  \param propertyName The property name.
574 
575  \exception Exception An exception can be thrown, if the dataset property could not be retrieved.
576 
577  \return The property with the given name from the dataset.
578 
579  \note Thread-safe!
580  */
581  virtual std::auto_ptr<te::dt::Property> getProperty(const std::string& datasetName, const std::string& name);
582 
583  /*!
584  \brief It retrieves the property lying in the given position from the dataset.
585 
586  \param datasetName The dataset name.
587  \param propertyPos The property position.
588 
589  \exception Exception An exception can be thrown, if the property lying in the given position could not be retrieved.
590 
591  \return The property in the given position.
592 
593  \note Thread-safe!
594  */
595  virtual std::auto_ptr<te::dt::Property> getProperty(const std::string& datasetName, std::size_t propertyPos);
596 
597  /*!
598  \brief It gets the property names of the given dataset.
599 
600  \param datasetName The dataset name.
601 
602  \exception Exception An exception can be thrown, if the property names of the dataset could not be retrieved.
603 
604  \return The property names of the dataset.
605 
606  \note Each dataset in the data source must have a unique name. For example, in a DBMS the name
607  may contain the schema name before the table name separated by a dot notation (".").
608 
609  \note Thread-safe!
610  */
611  virtual std::vector<std::string> getPropertyNames(const std::string& datasetName);
612 
613  /*!
614  \brief It gets the number of properties of the given dataset.
615 
616  \param datasetName The dataset name.
617 
618  \exception Exception An exception can be thrown, if the number of dataset properties could not be retrieved.
619 
620  \return The number of dataset properties.
621 
622  \note Thread-safe!
623  */
624  virtual std::size_t getNumberOfProperties(const std::string& datasetName);
625 
626  /*!
627  \brief It checks if a property with the given name exists in the dataset.
628 
629  \param datasetName The dataset name.
630  \param name The property name.
631 
632  \exception Exception An exception can be thrown, if the existence of the dataset property could not be obtained.
633 
634  \return True, if the property exists in the dataset; otherwise, it returns false.
635 
636  \note Thread-safe!
637  */
638  virtual bool propertyExists(const std::string& datasetName, const std::string& name);
639 
640  /*!
641  \brief It adds a new property to the dataset schema.
642 
643  \param datasetName The dataset where the property will be added.
644  \param p The new property to be added.
645 
646  \exception Exception An exception can be thrown, if the property could not be added to the dataset schema.
647 
648  \note Don't delete the given property, because the schema will take the ownership of it.
649  \note Thread-safe!
650  */
651  virtual void addProperty(const std::string& datasetName, te::dt::Property* p);
652 
653  /*!
654  \brief It removes a property from the given dataset.
655 
656  \param datasetName The dataset from where the given property will be removed.
657  \param name The property to be removed from the dataset.
658 
659  \exception Exception An exception can be thrown, if the dataset property could not be removed.
660 
661  \note Thread-safe!
662  */
663  virtual void dropProperty(const std::string& datasetName, const std::string& name);
664 
665  /*!
666  \brief It renames a property of the given dataset.
667 
668  \param datasetName The dataset containing the property to be renamed.
669  \param propertyName The property to be renamed from the dataset.
670  \param newPropertyName The new property name.
671 
672  \exception Exception An exception can be thrown, if the dataset property could not be renamed.
673 
674  \note Thread-safe!
675  */
676  virtual void renameProperty(const std::string& datasetName,
677  const std::string& propertyName,
678  const std::string& newPropertyName);
679 
680  virtual void changePropertyDefinition(const std::string& datasetName, const std::string& propName, te::dt::Property* newProp);
681 
682  virtual void changePropertiesDefinitions(const std::string& datasetName, const std::vector<std::string>& propsNames, const std::vector<te::dt::Property*> newProps);
683 
684  /*!
685  \brief It retrieves the primary key of the dataset.
686 
687  \param datasetName The dataset name.
688 
689  \exception Exception An exception can be thrown, if the primary key could not be retrieved.
690 
691  \return If a primary key exists in the dataset, it is returned; otherwise, a NULL is returned.
692 
693  \note Thread-safe!
694  */
695  virtual std::auto_ptr<te::da::PrimaryKey> getPrimaryKey(const std::string& datasetName);
696 
697  /*!
698  \brief It checks if a primary key exists in the dataset.
699 
700  \param datasetName The dataset name.
701  \param name The primary key name.
702 
703  \exception Exception An exception can be thrown, if the existence of the primary key could not be determined.
704 
705  \return True, if a primary key exists in the dataset; otherwise, it returns false.
706 
707  \note Thread-safe!
708  */
709  virtual bool primaryKeyExists(const std::string& datasetName, const std::string& name);
710 
711  /*!
712  \brief It adds a primary key constraint to the dataset schema.
713 
714  \param datasetName The name of the dataset where the primary key will be added.
715  \param pk The primary key constraint.
716 
717  \exception Exception An exception can be thrown, if the primary key could not be added to the dataset schema.
718 
719  \note Don't delete the given primary key, because the schema will take the ownership of it.
720  \note Thread-safe!
721  */
722  virtual void addPrimaryKey(const std::string& datasetName, PrimaryKey* pk);
723 
724  /*!
725  \brief It removes the primary key constraint from the dataset schema.
726 
727  \param datasetName The dataset from where the primary key will be removed.
728 
729  \exception Exception An exception can be thrown, if the primary key could not be dropped from the dataset schema.
730 
731  \note Thread-safe!
732  */
733  virtual void dropPrimaryKey(const std::string& datasetName);
734 
735  /*!
736  \brief It retrieves the foreign key from the given dataset.
737 
738  \param datasetName The dataset name.
739  \param name The foreign key name.
740 
741  \exception Exception An exception can be thrown, if the foreign key could not be retrieved.
742 
743  \return If the foreign key exists in the dataset, it is returned; otherwise, a NULL is returned.
744 
745  \note Thread-safe!
746  */
747  virtual std::auto_ptr<ForeignKey> getForeignKey(const std::string& datasetName, const std::string& name);
748 
749  /*!
750  \brief It gets the foreign key names of the given dataset.
751 
752  \param datasetName The dataset name.
753 
754  \exception Exception An exception can be thrown, if the foreign key names could not be retrieved.
755 
756  \return The foreign key names of the dataset.
757 
758  \note Thread-safe!
759  */
760  virtual std::vector<std::string> getForeignKeyNames(const std::string& datasetName);
761 
762  /*!
763  \brief It checks if a foreign key with the given name exists in the data source.
764 
765  \param datasetName The dataset name.
766  \param name The foreign key name.
767 
768  \exception Exception An exception can be thrown, if the existence of the foreign key could not be obtained.
769 
770  \return True, if the foreign key exists in the dataset; otherwise, it returns false.
771  */
772  virtual bool foreignKeyExists(const std::string& datasetName, const std::string& name);
773 
774  /*!
775  \brief It adds a foreign key constraint to a dataset.
776 
777  \param datasetName The dataset where the foreign key constraint will be added.
778  \param fk The foreign key constraint.
779 
780  \exception Exception An exception can be thrown, if the foreign key could not be added to the dataset schema.
781 
782  \note Don't delete the given foreign key, because the schema will take the ownership of it.
783  \note Thread-safe!
784  */
785  virtual void addForeignKey(const std::string& datasetName, ForeignKey* fk);
786 
787  /*!
788  \brief It removes the foreign key constraint from the dataset schema.
789 
790  \param datasetName The dataset where the foreign key will be removed.
791  \param fkName The foreign key to be removed.
792 
793  \exception Exception An exception can be thrown, if the foreign key could not be removed from the dataset schema.
794 
795  \note Thread-safe!
796  */
797  virtual void dropForeignKey(const std::string& datasetName, const std::string& fkName);
798 
799  /*!
800  \brief It gets the unique key in the dataset with the given name.
801 
802  \param datasetName The dataset name.
803  \param name The unique key name.
804 
805  \exception Exception An exception can be thrown, if the unique key could not be retrieved.
806 
807  \return The unique key with the given name in the dataset.
808 
809  \note Thread-safe!
810  */
811  virtual std::auto_ptr<te::da::UniqueKey> getUniqueKey(const std::string& datasetName, const std::string& name);
812 
813  /*!
814  \brief It gets the unique key names of the given dataset.
815 
816  \param datasetName The dataset name.
817 
818  \exception Exception An exception can be thrown, if the unique key names could not be obtained.
819 
820  \return The unique key names of the dataset.
821 
822  \note Thread-safe!
823  */
824  virtual std::vector<std::string> getUniqueKeyNames(const std::string& datasetName);
825 
826  /*!
827  \brief It checks if a unique key with the given name exists in the dataset.
828 
829  \param datasetName The dataset name.
830  \param name The unique key name.
831 
832  \exception Exception An exception can be thrown, if the existence of the unique key could not be determined.
833 
834  \return True, if the unique key exists in the dataset; otherwise, it returns false.
835 
836  \note Thread-safe!
837  */
838  virtual bool uniqueKeyExists(const std::string& datasetName, const std::string& name);
839 
840  /*!
841  \brief It adds a unique key constraint to the dataset.
842 
843  \param datasetName The dataset where the unique key will be added.
844  \param uk The unique key constraint.
845 
846  \exception Exception An exception can be thrown, if the unique key could not be added to the dataset schema.
847 
848  \note Don't delete the given unique key, because the schema will take the ownership of it.
849  \note Thread-safe!
850  */
851  virtual void addUniqueKey(const std::string& datasetName, UniqueKey* uk);
852 
853  /*!
854  \brief It removes the unique key constraint from the dataset.
855 
856  \param datasetName The dataset from where the unique key will be removed.
857  \param name The unique key constraint name.
858 
859  \exception Exception An exception can be thrown, if the unique key could not be removed from the dataset schema.
860 
861  \note Thread-safe!
862  */
863  virtual void dropUniqueKey(const std::string& datasetName, const std::string& name);
864 
865  /*!
866  \brief It gets the check constraint of the dataset with the given name.
867 
868  \param datasetName The dataset name.
869  \param name The check constraint name.
870 
871  \exception Exception An exception can be thrown, if the check constraint could not be retrieved.
872 
873  \return The check constraint with the given name.
874 
875  \note Thread-safe!
876  */
877  virtual std::auto_ptr<te::da::CheckConstraint> getCheckConstraint(const std::string& datasetName, const std::string& name);
878 
879  /*!
880  \brief It gets the check constraint names of the given dataset.
881 
882  \param datasetName The dataset name.
883 
884  \exception Exception An exception can be thrown, if the check constraint names could not be retrieved.
885 
886  \return The check constraint names of the dataset.
887 
888  \note Thread-safe!
889  */
890  virtual std::vector<std::string> getCheckConstraintNames(const std::string& datasetName);
891 
892  /*!
893  \brief It checks if a check-constraint with the given name exists in the data source.
894 
895  \param datasetName The dataset name.
896  \param name The check-constraint name.
897 
898  \exception Exception An exception can be thrown, if the existence of the check constraint could not be determined.
899 
900  \return True, if the check-constraint exists in the dataset; otherwise, it returns false.
901 
902  \note Thread-safe!
903  */
904  virtual bool checkConstraintExists(const std::string& datasetName, const std::string& name);
905 
906  /*!
907  \brief It adds a check constraint to the dataset.
908 
909  \param datasetName The dataset where the constraint will be added.
910  \param cc The check constraint to be added.
911 
912  \exception Exception An exception can be thrown, if the check constraint could not be added to the dataset schema.
913 
914  \note Don't delete the given check constraint, because the schema will take the ownership of it.
915  \note Thread-safe!
916  */
917  virtual void addCheckConstraint(const std::string& datasetName, CheckConstraint* cc);
918 
919  /*!
920  \brief It removes the check constraint from the dataset.
921 
922  \param datasetName The dataset from where the check constraint will be removed.
923  \param name The check constraint to be removed.
924 
925  \exception Exception An exception can be thrown, if the check constraint could not be removed from the dataset schema.
926 
927  \note Thread-safe!
928  */
929  virtual void dropCheckConstraint(const std::string& datasetName, const std::string& name);
930 
931  /*!
932  \brief It gets the index with the given name from the dataset.
933 
934  \param datasetName The dataset name.
935  \param name The index name.
936 
937  \exception Exception An exception can be thrown, if the index could not be retrieved.
938 
939  \return The index from the given dataset.
940 
941  \note Thread-safe!
942  */
943  virtual std::auto_ptr<te::da::Index> getIndex(const std::string& datasetName, const std::string& name);
944 
945  /*!
946  \brief It gets the index names of the given dataset.
947 
948  \param datasetName The dataset name.
949 
950  \exception Exception An exception can be thrown, if the index names could not be retrieved.
951 
952  \return The index names of the given dataset.
953 
954  \note Thread-safe!
955  */
956  virtual std::vector<std::string> getIndexNames(const std::string& datasetName);
957 
958  /*!
959  \brief It checks if an index with the given name exists in the dataset.
960 
961  \param datasetName The dataset name.
962  \param name The index name.
963 
964  \exception Exception An exception can be thrown, if the index existence could not be determined.
965 
966  \return True, if the index exists in the dataset; otherwise, it returns false.
967 
968  \note Thread-safe!
969  */
970  virtual bool indexExists(const std::string& datasetName, const std::string& name);
971 
972  /*!
973  \brief It adds an index to the dataset.
974 
975  \param datasetName The dataset where the index will be added.
976  \param idx The index to be added.
977  \param options A list of optional modifiers (driver specific).
978 
979  \exception Exception An exception can be thrown, if the index could not be added to the dataset schema.
980 
981  \note Don't delete the given index, because the schema will take the ownership of it.
982  \note Thread-safe!
983  */
984  virtual void addIndex(const std::string& datasetName, Index* idx,
985  const std::map<std::string, std::string>& options);
986 
987  /*!
988  \brief It removes the index from the given dataset.
989 
990  \param datasetName The dataset where the index will be removed.
991  \param idxName The index to be removed.
992 
993  \exception Exception An exception can be thrown, if the index could not be removed from the dataset schema.
994 
995  \note Thread-safe!
996  */
997  virtual void dropIndex(const std::string& datasetName, const std::string& idxName);
998 
999  /*!
1000  \brief It gets the sequence with the given name in the data source.
1001 
1002  \param name The sequence name.
1003 
1004  \exception Exception An exception can be thrown, if the sequence could not be retrieved from the data source.
1005 
1006  \return The sequence with the given name.
1007 
1008  \note Thread-safe!
1009  */
1010  virtual std::auto_ptr<Sequence> getSequence(const std::string& name);
1011 
1012  /*!
1013  \brief It gets the sequence names available in the data source.
1014 
1015  \note Each sequence in the data source must have a unique name. For example, in a DBMS the name
1016  may contain the schema name before the sequence name separated by a dot notation (".").
1017 
1018  \exception Exception An exception can be thrown, if the sequence names could not be retrieved.
1019 
1020  \return The sequence names of the data source.
1021 
1022  \note Thread-safe!
1023  */
1024  virtual std::vector<std::string> getSequenceNames();
1025 
1026  /*!
1027  \brief It checks if a sequence with the given name exists in the data source.
1028 
1029  \param name The sequence name.
1030 
1031  \exception Exception An exception can be thrown, if the index existence could not be determined.
1032 
1033  \return True, if the sequence exists in the data source; otherwise, it returns false.
1034 
1035  \note Thread-safe!
1036  */
1037  virtual bool sequenceExists(const std::string& name);
1038 
1039  /*!
1040  \brief It adds a new sequence in the data source.
1041 
1042  \exception Exception An exception can be thrown, if the sequence could not be added to the data source.
1043 
1044  \note Don't delete the given sequence, because the data source will take the ownership of it.
1045  \note Thread-safe!
1046  */
1047  virtual void addSequence(Sequence* sequence);
1048 
1049  /*!
1050  \brief It removes the sequence from the data source.
1051 
1052  \param name The sequence that will be removed.
1053 
1054  \exception Exception An exception can be thrown, if the sequence could not be removed from the data source.
1055 
1056  \note Thread-safe!
1057  */
1058  virtual void dropSequence(const std::string& name);
1059 
1060  /*!
1061  \brief It retrieves the bounding rectangle of the spatial property for the given dataset.
1062 
1063  \param datasetName The dataset name.
1064  \param propertyName The spatial property name.
1065 
1066  \exception Exception An exception can be thrown, if the extent of the geometry property could not be retrieved.
1067 
1068  \return The spatial property bounding rectangle, or NULL, if none can be retrieved.
1069 
1070  \note Thread-safe!
1071  */
1072  virtual std::auto_ptr<te::gm::Envelope> getExtent(const std::string& datasetName,
1073  const std::string& propertyName);
1074 
1075  /*!
1076  \brief It retrieves the bounding rectangle for the spatial property lying in the given position in the dataset.
1077 
1078  \param datasetName The dataset name.
1079  \param propertyPos The spatial property position.
1080 
1081  \exception Exception An exception can be thrown, if the extent of the geometry property lying in the given position could not be retrieved.
1082 
1083  \return The spatial property bounding rectangle, or NULL, if none can be retrieved.
1084 
1085  \note Thread-safe!
1086  */
1087  virtual std::auto_ptr<te::gm::Envelope> getExtent(const std::string& datasetName, std::size_t propertyPos);
1088 
1089  /*!
1090  \brief It retrieves the number of items of the given dataset.
1091 
1092  \param datasetName The dataset name.
1093 
1094  \exception Exception An exception can be thrown, if the number of items of the dataset could not be retrieved.
1095 
1096  \return The number of items of the given dataset.
1097 
1098  \note Thread-safe!
1099  */
1100  virtual std::size_t getNumberOfItems(const std::string& datasetName);
1101 
1102  /*!
1103  \brief It checks if the data source has any dataset.
1104 
1105  \exception Exception An exception can be thrown, if it is not possible to check if the data source has datasets .
1106 
1107  \return True, if the data source has datasets; otherwise, it returns false.
1108 
1109  \note Thread-safe!
1110  */
1111  virtual bool hasDataSets();
1112 
1113  /*!
1114  \brief It checks if a dataset with the given name exists in the data source.
1115 
1116  \param name The dataset name.
1117 
1118  \exception Exception An exception can be thrown, if the existence of a dataset in the data source could not be determined.
1119 
1120  \return True, if the dataset exists in the data source; otherwise, it returns false.
1121 
1122  \note Thread-safe!
1123  */
1124  virtual bool dataSetExists(const std::string& name);
1125  //@}
1126 
1127  /** @name Dataset Schema Persistence Methods
1128  * Methods for dealing with datasource and dataset schema changes.
1129  */
1130  //@{
1131 
1132  /*!
1133  \brief It creates the dataset schema definition in the target data source.
1134 
1135  If a dataset schema with the same name already exists in the target data source,
1136  this may throw an exception.
1137 
1138  After calling this method, the dataset schema may be updated.
1139 
1140  \param dt The dataset schema to be created. It may be changed during the operation.
1141  \param options A list of optional modifiers (driver specific).
1142 
1143  \pre The schema of a related dataset in a foreign key must be already in the data source.
1144 
1145  \post In some data sources, this method may output implicit indexes, sequences or constraints.
1146  The method, if necessary, will create and adjust the dataset schema.
1147 
1148  \post The caller of this method will take the ownership of the given schema.
1149 
1150  \note If you want to create a new schema based on an already existing one,
1151  you must create a fresh copy of the DataSetType with the clone() method.
1152 
1153  \note Thread-safe!
1154  */
1155  virtual void createDataSet(DataSetType* dt, const std::map<std::string, std::string>& options);
1156 
1157  /*!
1158  \brief It clones the dataset in the data source.
1159 
1160  \param name The dataset to be cloned.
1161  \param cloneName The name of the cloned dataset.
1162  \param options A list of optional modifiers. It is driver specific.
1163 
1164  \exception Exception An exception can be thrown, if the dataset schema could not be cloned.
1165 
1166  \note Thread-safe!
1167  */
1168  virtual void cloneDataSet(const std::string& name,
1169  const std::string& cloneName,
1170  const std::map<std::string, std::string>& options);
1171 
1172  /*!
1173  \brief It removes the dataset schema from the data source.
1174 
1175  \param name The dataset name whose schema will be removed from the data source.
1176 
1177  \exception Exception An exception can be thrown, if the dataset could not be removed from the data source.
1178 
1179  \note Thread-safe!
1180  */
1181  virtual void dropDataSet(const std::string& name);
1182 
1183  /*!
1184  \brief It renames a dataset.
1185 
1186  \param name The name of the dataset to be renamed.
1187  \param newName The new dataset name.
1188 
1189  \exception Exception An exception can be thrown, if the dataset could not be renamed.
1190 
1191  \note Thread-safe!
1192  */
1193  virtual void renameDataSet(const std::string& name, const std::string& newName);
1194  //@}
1195 
1196  /** @name Dataset Persistence Methods
1197  * Methods for dealing with the persistence of data in a data source.
1198  */
1199  //@{
1200 
1201  /*!
1202  \brief It adds data items to the dataset in the data source.
1203 
1204  \param datasetName The target dataset name.
1205  \param d The data items to be added to the dataset.
1206  \param options A list of optional modifiers (driver specific).
1207  \param limit The number of items to be used from the input dataset. If set to 0 (default), all items are used.
1208 
1209  \exception Exception An exception can be thrown, if the input dataset items could not be added to the given dataset.
1210 
1211  \note The dataset reading will start in the current position.
1212  So, keep in mind that it is the caller responsability
1213  to inform the right position(and a valid one) in the dataset 'd', to start the inserting process.
1214 
1215  \note Thread-safe!
1216  */
1217  virtual void add(const std::string& datasetName,
1218  DataSet* d,
1219  const std::map<std::string, std::string>& options,
1220  std::size_t limit = 0);
1221 
1222  /*!
1223  \brief It return the DataSource current encoding.
1224 
1225  \return The DataSource current encoding.
1226  */
1227  virtual te::common::CharEncoding getEncoding();
1228 
1229  /*!
1230  \brief It removes all the informed items from the dataset.
1231 
1232  It removes all the data items from a dataset which are identified by
1233  a set of object identifiers. If this set is not informed, all items will be removed.
1234 
1235  \param datasetName The dataset name.
1236  \param oids A set of object identifiers used used to remove data from the dataset, or NULL, for removing all.
1237 
1238  \exception Exception An exception can be thrown, if the data items could not be removed.
1239 
1240  \note Thread-safe!
1241  */
1242  virtual void remove(const std::string& datasetName, const te::da::ObjectIdSet* oids = 0);
1243 
1244  /*!
1245  \brief It updates the contents of a dataset for the set of data items.
1246 
1247  \param datasetName The target dataset name.
1248  \param dataset The list of data items to be updated.
1249  \param properties The list of properties of the dataset to be updated.
1250  \param oids The list of objects to be updated.
1251  \param options A list of optional modifiers. It is driver specific.
1252  \param limit The number of items to be used from the input dataset. If set to 0 (default) all items are used.
1253 
1254  \exception Exception An exception can be thrown, if the dataset could not be updated.
1255 
1256  \note The dataset reading will start in the
1257  current position. So, keep in mind that it is the caller responsability
1258  to inform the right position(and a valid one) for the dataset 'd', to start the updating process.
1259 
1260  \note Thread-safe!
1261  */
1262  virtual void update(const std::string& datasetName,
1263  DataSet* dataset,
1264  const std::vector<std::size_t>& properties,
1265  const te::da::ObjectIdSet* oids,
1266  const std::map<std::string, std::string>& options,
1267  std::size_t limit = 0);
1268 
1269  /*!
1270  \brief It updates the contents of a dataset.
1271 
1272  All rows are edited. The third parameter tells wich columns are edited for each row.
1273 
1274  \param datasetName Name pf the dataset.
1275  \param dataset Dataset with editions.
1276  \param properties Columns edited for each row. Note that the size of \a properties must be the same of the \a dataset.
1277  \param ids List of positions of the columns that identifies rows.
1278 
1279  \exception te::da::Exception An exception can be thrown, if the dataset could not be updated.
1280  */
1281  virtual void update(const std::string& datasetName,
1282  DataSet* dataset,
1283  const std::vector< std::set<int> >& properties,
1284  const std::vector<size_t>& ids);
1285 
1286  //@}
1287 
1288  /** @name Data Source static methods
1289  * Data Source static methods
1290  */
1291  //@{
1292 
1293  /*!
1294  \brief It creates a new repository for a data source.
1295 
1296  \param dsType The type of data source to be created (example: POSTGIS, ORACLE, SQLITE).
1297  \param dsInfo The information for creating a new data source.
1298 
1299  \exception Exception An exception can be thrown, if the data source could not be created.
1300 
1301  \return A data source for the new data repository.
1302 
1303  \note Thread-safe!
1304  */
1305  static std::auto_ptr<DataSource> create(const std::string& dsType, const std::map<std::string, std::string>& dsInfo);
1306 
1307  /*!
1308  \brief It removes a data source identified by its connection information and the driver type.
1309 
1310  \param dsType The data source type name (example: POSTGIS, ORACLE, SQLITE).
1311  \param dsInfo The connection information for removing the data source.
1312 
1313  \exception Exception An exception can be thrown, if the data source could not be removed.
1314 
1315  \note No other instance of the data source to be removed can be opened, when calling this method.
1316 
1317  \note Thread-safe!
1318  */
1319  static void drop(const std::string& dsType, const std::map<std::string, std::string>& dsInfo);
1320 
1321  /*!
1322  \brief It checks if the data source exists with the connection information and the driver type.
1323 
1324  \param dsType The data source type name (example: POSTGIS, ORACLE, SQLITE).
1325  \param dsInfo The data source information.
1326 
1327  \exception Exception An exception can be thrown, if the data source exists in the driver.
1328 
1329  \return True, if the data source exists; otherwise, it returns false.
1330 
1331  \note Thread-safe!
1332  */
1333  static bool exists(const std::string& dsType, const std::map<std::string, std::string>& dsInfo);
1334 
1335  /*!
1336  \brief It returns the data source names available in the driver.
1337 
1338  \param dsType The type name of the data source(example: PostGIS, Oracle, WFS).
1339  \param dsInfo The information about the data sources.
1340 
1341  \exception Exception An exception can be thrown, if the data source names could not be retrieved.
1342 
1343  \return The data source names available.
1344 
1345  \exception Exception An exception can be thrown, if the list of data source names could not be retrieved.
1346  */
1347  static std::vector<std::string> getDataSourceNames(const std::string& dsType, const std::map<std::string, std::string>& info);
1348 
1349  /*!
1350  \brief It gets the encoding names of the data source.
1351 
1352  \param dsType The data source type name (example: PostGIS, Oracle, WFS).
1353  \param dsInfo The data source information.
1354 
1355  \exception Exception An exception can be thrown, if the encoding names could not be retrieved.
1356 
1357  \return The encoding types of the data source.
1358  */
1359  static std::vector<te::common::CharEncoding> getEncodings(const std::string& dsType, const std::map<std::string, std::string>& info);
1360  //@}
1361 
1362  protected:
1363 
1364  /** @name Protected Data Source Methods????
1365  * The protected methods of the data source
1366  */
1367  //@{
1368 
1369  /*!
1370  \brief It creates a new data source.
1371 
1372  \param dsInfo The information for creating a new data source.
1373 
1374  \exception Exception An exception can be thrown, if the data source could not be created.
1375 
1376  \note Not thread-safe!
1377  */
1378  virtual void create(const std::map<std::string, std::string>& dsInfo) = 0;
1379 
1380  /*!
1381  \brief It removes the data source with the connection information from a driver.
1382 
1383  \param dsInfo The information for removing a data source from a driver.
1384 
1385  \exception Exception An exception can be thrown, if the data source could not be removed.
1386 
1387  \note Not thread-safe!
1388  */
1389  virtual void drop(const std::map<std::string, std::string>& dsInfo) = 0;
1390 
1391  /*!
1392  \brief Check the existence of a data source in a driver.
1393 
1394  \param dsInfo The data source information.
1395 
1396  \exception Exception An exception can be thrown, if the existence of a data source in a driver could not be determined.
1397 
1398  \return True, if the data source exists, or false, otherwise.
1399 
1400  \note Thread-safe!
1401  */
1402  virtual bool exists(const std::map<std::string, std::string>& dsInfo) = 0;
1403 
1404  /*!
1405  \brief It gets the data source names available in a driver.
1406 
1407  \param dsInfo The data source information.
1408 
1409  \exception Exception An exception can be thrown, if the data source names could not be retrieved.
1410 
1411  \return The data source names available in the driver.
1412 
1413  \note Not thread-safe!
1414  */
1415  virtual std::vector<std::string> getDataSourceNames(const std::map<std::string, std::string>& dsInfo) = 0;
1416 
1417  /*!
1418  \brief It gets the encodings for the data source.
1419 
1420  \param dsInfo The data source information.
1421 
1422  \exception Exception An exception can be thrown, if the encoding names could not be retrieved.
1423 
1424  \return The encoding types for the data source.
1425 
1426  */
1427  virtual std::vector<te::common::CharEncoding> getEncodings(const std::map<std::string, std::string>& dsInfo) = 0;
1428  //@}
1429 
1430  protected:
1431 
1432  std::string m_id; //!< The data source identification.
1433  };
1434 
1435  typedef boost::shared_ptr<DataSource> DataSourcePtr;
1436 
1437  } // end namespace da
1438 } // end namespace te
1439 
1440 #endif // __TERRALIB_DATAACCESS_DATASOURCE_INTERNAL_DATASOURCE_H
CharEncoding
Supported charsets (character encoding).
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
A class that models the description of a dataset.
Definition: DataSetType.h:72
It represents the SQL query dialect accepted by a given data source.
Definition: SQLDialect.h:55
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:127
It describes a sequence (a number generator).
Definition: Sequence.h:56
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
A class that describes a check constraint.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:118
It models a property definition.
Definition: Property.h:59
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
URI C++ Library.
It models a foreign key constraint for a DataSetType.
Definition: ForeignKey.h:50
It describes a unique key (uk) constraint.
Definition: UniqueKey.h:53
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
std::string m_id
The data source identification.
Definition: DataSource.h:1432
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
It describes a primary key (pk) constraint.
Definition: PrimaryKey.h:52
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
A Query is independent from the data source language/dialect.
Definition: Query.h:46
It describes an index associated to a DataSetType.
Definition: Index.h:54