HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ORMMigrationBuilder.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_ORMMigrationBuilder.h
7  *
8  * COMMENTS:
9  *
10  * The UT_ORMMigrationBuilder is the object that defines all of the
11  * various migrations that are required given a set of model metas. The
12  * model metas are based on the currently registerd and yet to be built
13  * models in the UT_SQLORM object. This means during the lifetime of a
14  * program multiple builders could be generated each defining a subset of
15  * all model meta objects of a program.
16  *
17  * The migration builder also tries to verify the various operations make
18  * sense for a given model. For example, trying to drop a column that
19  * doesnt exist given the current steps of the migration for a model. The
20  * migration also tries to verify that the final result of the migration
21  * matches the current table as defined in the build step. These all help
22  * to ensure that the database and the current program are in sync with
23  * each other.
24  *
25  * See UT_SQLORM for detailed information on the entire system.
26  */
27 
28 #ifndef __UT_ORMMIGRATIONBUILDER_H__
29 #define __UT_ORMMIGRATIONBUILDER_H__
30 
31 #include "UT_API.h"
32 
33 #include "UT_StringHolder.h"
34 #include "UT_Array.h"
35 #include "UT_UniquePtr.h"
36 #include "UT_Map.h"
37 #include "UT_NonCopyable.h"
38 #include "UT_ORMColumn.h"
39 #include "UT_ErrorCode.h"
40 #include "UT_ORMMigration.h"
41 
42 class UT_IORMOperation;
49 class UT_ORMModelMeta;
51 
53 {
54 public:
55  UT_ORMMigrationBuilder() = default;
58 
59  UT_ORMMigration& addMigration(
60  const UT_StringHolder& model_mig_name,
61  const UT_StringHolder& mig_name);
62 
64  {
65  return myMigrations;
66  }
67 
68  const UT_StringHolder& errorMessage() const { return myErrorMessage; }
69  const UT_ErrorCode& errorCode() const { return myErrorCode; }
70 
71 private:
73  UT_StringHolder myErrorMessage;
74  UT_ErrorCode myErrorCode;
75 };
76 
77 #endif // __UT_ORMMIGRATIONBUILDER_H__
const UT_StringHolder & errorMessage() const
const UT_Array< UT_SharedPtr< UT_ORMMigration > > & migrations() const
#define UT_API
Definition: UT_API.h:14
const UT_ErrorCode & errorCode() const
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
std::error_code UT_ErrorCode
Definition: UT_ErrorCode.h:20