132 hash<GenericColumnInfo>
c_int(
bool notnull = False, *
string comment);
142 hash<GenericColumnInfo>
c_int(
string comment);
151 hash<GenericColumnInfo>
c_varchar(
int size,
bool notnull = False, *
string comment);
158 hash<GenericColumnInfo>
c_varchar(
int size,
string comment);
167 hash<GenericColumnInfo>
c_char(
int size,
bool notnull = False, *
string comment);
174 hash<GenericColumnInfo>
c_char(
int size,
string comment);
184 hash<GenericColumnInfo>
c_date(
bool notnull = False, *
string comment);
192 hash<GenericColumnInfo>
c_date(
string comment);
202 hash<GenericColumnInfo>
c_timestamp(
bool notnull = False, *
string comment);
221 hash<GenericColumnInfo>
c_number(
bool notnull = False, *
string comment);
233 hash<GenericColumnInfo>
c_number(
int size,
int scale,
bool notnull = False, *
string comment);
244 hash<GenericColumnInfo>
c_number(
int size,
bool notnull = False, *
string comment);
253 hash<GenericColumnInfo>
c_number(
int size,
string comment);
263 hash<GenericColumnInfo>
c_blob(
bool notnull = False, *
string comment);
271 hash<GenericColumnInfo>
c_blob(
string comment);
281 hash<GenericColumnInfo>
c_clob(
bool notnull = False, *
string comment);
289 hash<GenericColumnInfo>
c_clob(
string comment);
315 int change_count = 0;
319 list<string> sql_cache = ();
334 AbstractDatabase::AC_Create: True,
335 AbstractDatabase::AC_Add: True,
336 AbstractDatabase::AC_Insert: True,
351 infoCallback(
string str,
int ac, *
string type, *
string name, *
string table, *
string new_name, *
string info);
522 int align(
bool force = False,
int verbose = 0,
bool do_msgs = True);
538 hash<SchemaAlignmentInfo>
alignWithInfo(
bool force = False,
int verbose = 0,
bool do_msgs = True);
560 drop(
bool force = False,
int verbose = 0,
bool do_msgs = True);
820 doPostAlignment(Tables table_cache,
bool first_time_install, *hash<auto> initial_schema_info,
int verbose);
826 doPostAlignment(Tables table_cache,
bool first_time_install, *hash<auto> initial_schema_info);
838 postDataActions(Tables table_cache,
bool first_time_install, *hash<auto> initial_schema_info,
int verbose);
850 doTable(AbstractTable table, list rows,
int upsert_strategy,
bool delete_others,
int verbose, reference<hash<string, int>> sh);
the AbstractSchema class is a base class to assist with automatic schema management
Definition: Schema.qm.dox.h:412
doPostAlignment(Tables table_cache, bool first_time_install, *hash< auto > initial_schema_info, int verbose)
this method is called after schema structural alignment has been executed but before schema reference...
doPostAlignment(Tables table_cache, bool first_time_install, *hash< auto > initial_schema_info)
this method is called after schema structural alignment has been executed but before schema reference...
hash schema
the schema template, as assembled from method callbacks providing schema element definitions
Definition: Schema.qm.dox.h:422
string getVersion()
returns the version of the schema
constructor(Qore::SQL::AbstractDatasource ds, *hash< SchemaOptionInfo > opts)
creates the object from the arguments
*hash< auto > getTablesImpl()
returns table definitions
hash callback_opts
callback options plus all options
Definition: Schema.qm.dox.h:444
string drv
the name of the database driver
Definition: Schema.qm.dox.h:436
abstract string getNameImpl()
returns the name of the schema
static list getRows(*softlist< auto > l)
returns a list of hashes from a list of lists where the first list element in the top-level list is a...
*hash< auto > getPackages()
returns (Oracle) package definitions
SqlUtil::Database db
the Database object for the schema
Definition: Schema.qm.dox.h:439
static hash combineOptions(*hash h)
combines option hashes into a single target option hash
doTable(AbstractTable table, list rows, int upsert_strategy, bool delete_others, int verbose, reference< hash< string, int > > sh)
this method is called to perform schema reference data managment on the given table with the given da...
*hash< auto > getMaterializedViewsImpl()
returns materialized view definitions
*hash< auto > getReferenceDataHashImpl()
returns a hash of "normal reference data", describing data that must appear in the target table,...
Qore::SQL::AbstractDatasource ds
the datasource for the schema
Definition: Schema.qm.dox.h:434
*string data_ts
explicit data tablespace name
Definition: Schema.qm.dox.h:450
*hash< auto > getTypesImpl()
returns type definitions
*hash< auto > getMaterializedViews()
returns materialized view definitions
constructor(Qore::SQL::AbstractDatasource ds, *string dts, *string its, *hash opts)
creates the object from the arguments
logpf(string fmt)
outputs a log message prefixed with the schema name
postDataActions(Tables table_cache, bool first_time_install, *hash< auto > initial_schema_info, int verbose)
this method is called after schema reference data has been managed
*hash creation_options
creation options, as provided by getCreationOptions()
Definition: Schema.qm.dox.h:427
*hash< auto > getReferenceDataHash()
returns a hash of "normal reference data", describing data that must appear in the target table,...
int align(bool force=False, int verbose=0, bool do_msgs=True)
executes a schema alignment action on the database with the current schema template
*hash< auto > getFunctionsImpl()
returns function definitions
bool checkDropSchema(bool force)
this method returns True if the schema can be dropped
*hash< auto > getTables()
returns table definitions
hash< SchemaAlignmentInfo > alignWithInfo(bool force=False, int verbose=0, bool do_msgs=True)
executes a schema alignment action on the database with the current schema template
*hash< auto > getTypes()
returns type definitions
*hash< auto > getGenericOptionsImpl()
returns schema creation options
*hash< auto > getProcedures()
returns stored procedure definitions
hash pure_callback_opts
just callback options
Definition: Schema.qm.dox.h:442
init(Qore::SQL::AbstractDatasource ds, *hash< SchemaOptionInfo > opts)
shared constructor initialization
*hash column_options
column options, as provided by getColumnOptions()
Definition: Schema.qm.dox.h:429
code info_callback
the info callback for schema operations; can be used for explicit logging
Definition: Schema.qm.dox.h:447
*hash< auto > getCreateOnlyReferenceData()
returns a hash of "create-only reference data", describing data that is written to the table when the...
*string index_ts
explicit index tablespace name
Definition: Schema.qm.dox.h:453
*hash< auto > getCreationOptions()
returns schema creation options
string version
the version of the schema
Definition: Schema.qm.dox.h:419
postDataActions(bool first_time_install)
this method is called after schema reference data has been managed
*hash< auto > getColumnOptionsImpl()
returns column options
Qore::SQL::AbstractDatasource getDatasource()
returns the datasource used for the schema
int getUpsertStrategy(bool first_time_install)
this method is called to return the upsert strategy before schema reference data management
*hash index_options
index options, as provided by getIndexOptions()
Definition: Schema.qm.dox.h:425
*hash< auto > getIndexOptions()
returns index options
bool checkFirstTimeInstall()
returns True if checkExistence() returns False
*hash< auto > getColumnOptions()
returns column options
*hash< auto > getProceduresImpl()
returns stored procedure definitions
*hash< auto > getIndexOptionsImpl()
returns index options
*hash< auto > getPackagesImpl()
returns (Oracle) package definitions
abstract string getVersionImpl()
returns the version of the schema
SqlUtil::AbstractDatabase getDatabase()
returns the AbstractDatabase object used for the schema
*hash< auto > getFunctions()
returns function definitions
bool checkExistence()
returns True if the method can detect that DB objects defined in the schema exist in the database
*hash< auto > getInsertOnlyReferenceDataImpl()
returns a hash of "insert-only reference data", describing data that will only be inserted if missing...
string getName()
returns the name of the schema
*hash< auto > getCreateOnlyReferenceDataImpl()
returns a hash of "create-only reference data", describing data that is written to the table when the...
*hash all_options
combined creation and column options
Definition: Schema.qm.dox.h:431
*hash< auto > getInsertOnlyReferenceData()
returns a hash of "create-only reference data", describing data that will only be inserted if missing...
*hash< auto > getSequences()
returns sequence definitions
string name
the name of the schema
Definition: Schema.qm.dox.h:417
*hash< auto > getSequencesImpl()
returns sequence definitions
SchemaCallbackHelper alignIntern(bool force=False, int verbose=0, bool do_msgs=True)
executes a schema alignment action on the database with the current schema template
drop(bool force=False, int verbose=0, bool do_msgs=True)
executes a schema drop operation in the database
*hash< auto > getStrictReferenceDataHashImpl()
returns a hash of "strict reference data", describing the only data that can appear in the target tab...
*hash< auto > getStrictReferenceDataHash()
returns a hash of "strict reference data", describing the only data that can appear in the target tab...
logProgress(string str)
outputs a log message without any newline
bool checkUpdateSchema(bool force, reference< hash< auto > > initial_schema_info)
this method returns True if the schema can be updated
log(string fmt)
outputs a log message
this class extends Schema::AbstractSchema by providing version logic based on a schema version string...
Definition: Schema.qm.dox.h:873
bool checkDowngrade(string current_version)
this method is called if the current schema version is greater than the target version; returns True ...
string version_column
the name of the column containing the version string
Definition: Schema.qm.dox.h:880
string getVersionTable()
returns the name of the table holding the schema version string by calling getVersionTableImpl()
abstract hash getVersionWhereImpl()
returns the where clause hash defining the row where the schema version string is located
bool checkUpdateSchema(bool force, reference< hash< auto > > initial_schema_info)
this method returns True if the schema can be updated
abstract string getVersionColumnImpl()
returns the name of the column holding the schema version string
string getVersionColumn()
returns the name of the column holding the schema version string by calling getVersionColumnImpl()
*softstring getSchemaVersion()
returns the existing schema version or NOTHING if not present
hash getVersionWhere()
returns the where clause hash defining the row where the schema version string is located by calling ...
bool checkUpgrade(string current_version)
this method is called if the current schema version is less than the target version; returns True if ...
hash version_where
a where clause hash defining the row where the schema version string is located
Definition: Schema.qm.dox.h:882
abstract string getVersionTableImpl()
returns the name of the table holding the schema version string
constructor(Qore::SQL::AbstractDatasource ds, *string dts, *string its, *hash opts)
creates the object based on the arguments giving the location of the schema
bool checkDropSchema(bool force)
this method returns True if the schema can be dropped
string version_table
the name of the table containing the version string
Definition: Schema.qm.dox.h:878
this class provides callback support for schema operations
Definition: Schema.qm.dox.h:310
const CreateActionMap
Map of create actions.
Definition: Schema.qm.dox.h:333
infoCallback(string str, int ac, *string type, *string name, *string table, *string new_name, *string info)
this is the informational callback method for schema operations
bool created
Set to True if only creations / additions were made.
Definition: Schema.qm.dox.h:330
constructor(AbstractSchema sc, int v=0)
creates the callback object from the given arguments
nothing sqlForceCallback(string str)
this is the SQL callback method for forced schema operations
sqlCallback(string str)
this is the SQL callback method for schema operations
hash< string, int > change_map
Change map; action code -> count.
Definition: Schema.qm.dox.h:322
hash< SchemaAlignmentInfo > getInfo()
Returns information about schema changes made.
hash< auto > getCallbacks(bool force=False)
returns a callback option hash usable with SqlUtil schema operations
hash< string, int > data_change_map
Summary map for data changes; upsert action code -> count.
Definition: Schema.qm.dox.h:325
this namespace contains all public definitions in the Schema module
Definition: Schema.qm.dox.h:117
hash< GenericColumnInfo > c_blob(bool notnull=False, *string comment)
returns a column hash for a BLOB column
hash< GenericColumnInfo > c_date(bool notnull=False, *string comment)
returns a column hash for a DATE column
hash< GenericColumnInfo > c_clob(bool notnull=False, *string comment)
returns a column hash for a CLOB column
hash< GenericColumnInfo > c_number(bool notnull=False, *string comment)
returns a column hash for a NUMBER or NUMERIC column
hash< GenericColumnInfo > c_timestamp(bool notnull=False, *string comment)
returns a column hash for a TIMESTAMP column
hash< GenericColumnInfo > c_varchar(int size, bool notnull=False, *string comment)
returns a column hash for a VARCHAR column
hash< GenericColumnInfo > c_char(int size, bool notnull=False, *string comment)
returns a column hash for a CHAR column
hash< GenericColumnInfo > c_int(bool notnull=False, *string comment)
returns a column hash for an INT column
const C_NULL
Helper constant for column hash functions with "NULL" constraint for better readability.
Definition: Schema.qm.dox.h:119
const C_NOT_NULL
Helper constant for column hash functions with "NOT NULL" constraint for better readability.
Definition: Schema.qm.dox.h:121
Provides information on schema changes.
Definition: Schema.qm.dox.h:293
bool created
Set to True if only creations / additions were made.
Definition: Schema.qm.dox.h:297
*hash< string, int > change_map
Change map; action code -> count.
Definition: Schema.qm.dox.h:303
int num_changes
The total number of changes made.
Definition: Schema.qm.dox.h:300
*hash< string, int > data_change_map
Summary map for data changes; upsert action code -> count.
Definition: Schema.qm.dox.h:306
Schema option hash definitions.
Definition: Schema.qm.dox.h:368
*string data_ts
explicit data tablespace name
Definition: Schema.qm.dox.h:370
*hash< auto > db_opts
options for SqlUtil::Database::constructor()
Definition: Schema.qm.dox.h:376
*string index_ts
explicit index tablespace name
Definition: Schema.qm.dox.h:373