81 infoCallback(
string str,
int ac, *
string type, *
string name, *
string table, *
string new_name, *
string info);
152 AbstractDatasource
ds;
180 constructor(AbstractDatasource n_ds, *
string dts, *
string its);
225 int align(
bool force =
False,
int verbose = 0);
229 drop(
bool force =
False,
int verbose = 0);
442 private doPostAlignment(Tables table_cache,
bool first_time_install, *
hash initial_schema_info);
454 private doTable(AbstractTable table,
list rows,
int upsert_strategy,
bool delete_others,
int verbose, reference sh);
492 constructor(AbstractDatasource
ds, *
string dts, *
string its);
AbstractDatabase getDatabase()
returns the AbstractDatabase object used for the schema
private string getVersionColumn()
returns the name of the column holding the schema version string by calling getVersionColumnImpl() ...
private *hash getTablesImpl()
returns table definitions
logProgress(string str)
outputs a log message without any newline
*hash getIndexOptions()
returns index options
private bool checkUpgrade(string current_version)
this method is called if the current schema version is less than the target version; returns True if ...
*hash getProcedures()
returns stored procedure definitions
private *hash getStrictReferenceDataHashImpl()
returns a hash of "strict reference data", describing the only data that can appear in the target tab...
private *hash getGenericOptionsImpl()
returns schema creation options
abstract private string getVersionColumnImpl()
returns the name of the column holding the schema version string
hash getCallbacks(bool force=False)
returns a callback option hash usable with SqlUtil schema operations
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
private *hash getReferenceDataHashImpl()
returns a hash of "normal reference data", describing data that must appear in the target table...
AbstractDatasource ds
the datasource for the schema
Definition: Schema.qm.dox.h:152
private bool checkUpdateSchema(bool force, reference initial_schema_info)
this method returns True if the schema can be updated
string name
the name of the schema
Definition: Schema.qm.dox.h:135
*hash getSequences()
returns sequence definitions
private hash getVersionWhere()
returns the where clause hash defining the row where the schema version string is located by calling ...
private doPostAlignment(Tables table_cache, bool first_time_install, *hash initial_schema_info)
this method is called after schema structural alignment has been executed but before schema reference...
string getVersion()
returns the version of the schema
*hash getTables()
returns table definitions
*hash column_options
column options, as provided by getColumnOptions()
Definition: Schema.qm.dox.h:147
private bool checkFirstTimeInstall()
returns True if checkExistence() returns False
*hash getReferenceDataHash()
returns a hash of "normal reference data", describing data that must appear in the target table...
*hash getColumnOptions()
returns column options
hash callback_opts
callback options plus all options
Definition: Schema.qm.dox.h:162
abstract private hash getVersionWhereImpl()
returns the where clause hash defining the row where the schema version string is located ...
int align(bool force=False, int verbose=0)
executes a schema alignment action on the database with the current schema template ...
*hash getFunctions()
returns function definitions
*hash index_options
index options, as provided by getIndexOptions()
Definition: Schema.qm.dox.h:143
sqlCallback(string str)
this is the SQL callback method for schema operations
string version_column
the name of the column containing the version string
Definition: Schema.qm.dox.h:483
private *hash getColumnOptionsImpl()
returns column options
drop(bool force=False, int verbose=0)
executes a schema drop operation in the database
*string data_ts
explicit data tablespace name
Definition: Schema.qm.dox.h:168
*hash getMaterializedViews()
returns materialized view definitions
constructor(AbstractDatasource n_ds, *string dts, *string its)
creates the object from the arguments
constructor(AbstractSchema sc, int v=0)
creates the callback object from the given arguments
this namespace contains all public definitions in the Schema module
Definition: Schema.qm.dox.h:58
log(string fmt)
outputs a log message
*hash getCreateOnlyReferenceData()
returns a hash of "create-only reference data", describing data that is written to the table when the...
abstract private string getVersionTableImpl()
returns the name of the table holding the schema version string
private *hash getSequencesImpl()
returns sequence definitions
this class extends Schema::AbstractSchema by providing version logic based on a schema version string...
Definition: Schema.qm.dox.h:476
abstract private string getVersionImpl()
returns the version of the schema
private bool checkDropSchema(bool force)
this method returns True if the schema can be dropped
private postDataActions(bool first_time_install)
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:145
private *hash getIndexOptionsImpl()
returns index options
hash schema
the schema template, as assembled from method callbacks providing schema element definitions ...
Definition: Schema.qm.dox.h:140
private *hash getInsertOnlyReferenceDataImpl()
returns a hash of "create-only reference data", describing data that will only be inserted if missing...
this class provides callback support for schema operations
Definition: Schema.qm.dox.h:60
*hash getStrictReferenceDataHash()
returns a hash of "strict reference data", describing the only data that can appear in the target tab...
*hash getInsertOnlyReferenceData()
returns a hash of "create-only reference data", describing data that will only be inserted if missing...
*hash getCreationOptions()
returns schema creation options
static list getRows(*softlist l)
returns a list of hashes from a list of lists where the first list element in the top-level list is a...
private bool checkExistence()
returns True if the method can detect that DB objects defined in the schema exist in the database ...
string version_table
the name of the table containing the version string
Definition: Schema.qm.dox.h:481
*hash getTypes()
returns type definitions
string getName()
returns the name of the schema
SqlUtil::Database db
the Database object for the schema
Definition: Schema.qm.dox.h:157
private *hash getProceduresImpl()
returns stored procedure definitions
code info_callback
the info callback for schema operations; can be used for explicit logging
Definition: Schema.qm.dox.h:165
private *hash getFunctionsImpl()
returns function definitions
string version
the version of the schema
Definition: Schema.qm.dox.h:137
private bool checkUpdateSchema(bool force, reference initial_schema_info)
this method returns True if the schema can be updated
*hash all_options
combined creation and column options
Definition: Schema.qm.dox.h:149
private *softstring getSchemaVersion()
returns the existing schema version or NOTHING if not present
abstract private string getNameImpl()
returns the version of the schema
string drv
the name of the database driver
Definition: Schema.qm.dox.h:154
private int getUpsertStrategy(bool first_time_install)
this method is called to return the upsert strategy before schema reference data management ...
hash version_where
a where clause hash defining the row where the schema version string is located
Definition: Schema.qm.dox.h:485
private bool checkDowngrade(string current_version)
this method is called if the current schema version is greater than the target version; returns True ...
AbstractDatasource getDatasource()
returns the datasource used for the schema
logpf(string fmt)
outputs a log message prefixed with the schema name
hash pure_callback_opts
just callback options
Definition: Schema.qm.dox.h:160
private *hash getMaterializedViewsImpl()
returns materialized view definitions
private doTable(AbstractTable table, list rows, int upsert_strategy, bool delete_others, int verbose, reference sh)
this method is called to perform schema reference data managment on the given table with the given da...
private *hash getPackagesImpl()
returns (Oracle) package definitions
*hash getPackages()
returns (Oracle) package definitions
private string getVersionTable()
returns the name of the table holding the schema version string by calling getVersionTableImpl() ...
private *hash getCreateOnlyReferenceDataImpl()
returns a hash of "create-only reference data", describing data that is written to the table when the...
private *hash getTypesImpl()
returns type definitions
*string index_ts
explicit index tablespace name
Definition: Schema.qm.dox.h:171
nothing sqlForceCallback(string str)
this is the SQL callback method for forced schema operations
the AbstractSchema class is a base class to assist with automatic schema management ...
Definition: Schema.qm.dox.h:130
static hash combineOptions(*hash h)
combines option hashes into a single target option hash
constructor(AbstractDatasource ds, *string dts, *string its)
creates the object based on the arguments giving the location of the schema
private bool checkDropSchema(bool force)
this method returns True if the schema can be dropped