Loading...
Searching...
No Matches
AbstractDatabase.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace SqlUtil {
class AbstractDatabase : public AbstractSqlUtilBase {
public:
const DatabaseOptions = ...;
const CacheOptions = ...;
const CallbackOptions = ...;
const AC_Unchanged = 0;
const AC_Create = 1;
const AC_Drop = 2;
const AC_Rename = 3;
const AC_Modify = 4;
const AC_Truncate = 5;
const AC_Add = 6;
const AC_Recreate = 7;
const AC_Insert = 8;
const AC_Update = 9;
const AC_Delete = 10;
const AC_NotFound = 11;
const ActionMap = ...;
const ActionDescMap = ...;
const ActionLetterMap = ...;
const CreationOptions = ...;
const AlignSchemaOptions = ...;
const DropSchemaOptions = ...;
const SchemaDescriptionOptions = ...;
const SequenceDescriptionOptions = ...;
const ComputeStatisticsOptions = ...;
const ReclaimSpaceOptions = ...;
protected:
bool native_case = False;
// AbstractDatabase::getPhysicalSize() return in a case of no data
const GET_PHYSICAL_DB_SIZE_NOVAL = -1;
public:
protected:
constructor(AbstractDatasource nds, *hash nopts) ;
public:
list features();
static doOkCallback(*hash<auto> opt, int ac, string type, string name, *string table, *string info);
protected:
static runInfoCallback(code info_callback, int ac, string type, string name, *string table, *string new_name, *string info);
public:
static *string doCallback(*hash<auto> opt, *string sql, int ac, string type, string name, *string table, *string new_name, *string info);
static list doCallback(*hash<auto> opt, list sql, int ac, string type, string name, *string table, *string new_name, *string info);
auto tryExec(string sql);
auto tryExecArgs(string sql, *softlist<auto> args);
auto tryExecRaw(string sql);
list<auto> getAlignSql(hash schema_hash, *hash<auto> opt, *Tables table_cache);
list<auto> getDropSchemaSql(hash schema_hash, *hash<auto> opt);
protected:
list dropSqlUnlocked(string type, hash schema_hash, code get, code make, *hash<auto> opt, string make_arg_type);
public:
protected:
list alignCodeUnlocked(string type, hash schema_hash, code get, code make, *hash<auto> opt, string make_arg_type);
public:
AbstractSequence makeSequence(string name, number start = 1, number increment = 1, *softnumber end, *hash<auto> opts);
AbstractSequence makeSequenceFromDescription(string name, *hash<auto> sh, *hash<auto> opts);
AbstractTable makeTable(string name, hash<auto> desc, *hash<auto> opts);
AbstractFunction makeFunction(string name, string src, *hash<auto> opts);
AbstractFunction makeProcedure(string name, string src, *hash<auto> opt);
bool dropFunctionIfExists(string name, *hash<auto> opt);
bool dropProcedureIfExists(string name, *hash<auto> opt);
bool dropSequenceIfExists(string name, *hash<auto> opt);
bool dropViewIfExists(string name, *hash<auto> opt);
bool dropTableIfExists(string name, *hash<auto> opt);
*string getDropFunctionSqlIfExists(string name, *hash<auto> opt);
*string getDropProcedureSqlIfExists(string name, *hash<auto> opt);
*string getDropSequenceSqlIfExists(string name, *hash<auto> opt);
*list<auto> getDropTableSqlIfExists(string name, *hash<auto> opt);
doDropSql(*softlist l, string type, string name, *hash<auto> opt);
bool doDrop(*softlist l, string type, string name, *hash<auto> opt);
list<auto> getAlignFunctionSql(AbstractFunction f, *hash<auto> opt);
list<auto> getAlignProcedureSql(AbstractFunction f, *hash<auto> opt);
*AbstractTable getTable(string name);
*AbstractSequence getSequence(string name);
*AbstractFunction getFunction(string name);
*AbstractFunction getProcedure(string name);
*AbstractView getView(string name);
int getNextSequenceValue(string name);
int getCurrentSequenceValue(string name);
string getSqlFromList(list l);
bool supportsSequences();
bool supportsTypes();
bool supportsPackages();
list<string> listTables();
Qore::ListIterator tableIterator();
list<string> listFunctions();
Qore::ListIterator functionIterator();
list<string> listProcedures();
Qore::ListIterator procedureIterator();
list<string> listSequences();
Qore::ListIterator sequenceIterator();
list<string> listViews();
Qore::ListIterator viewIterator();
bool rebuildIndex(string name, *hash<auto> options);
bool rebuildIndex(AbstractIndex index, *hash<auto> options);
computeStatistics(*hash<auto> options);
reclaimSpace(*hash<auto> options);
int getPhysicalSize();
bool requiresScale();
int getMaximumPrecision();
protected:
validateOptionsIntern(string err, hash<auto> ropt, reference<hash> opt);
public:
protected:
validateOptionsIntern(string err, hash<auto> ropt, reference<hash> opt, string tag);
public:
static AbstractDatabase getDatabase(AbstractDatasource nds, *hash<auto> opts);
static string loadModule(AbstractDatasource nds, *reference<string> drv);
static AbstractDatabase getDatabase(string dsstr, *hash<auto> opts);
static AbstractDatabase getDatabase(hash<auto> dsh, *hash<auto> opts);
static checkDriverOptions(reference<hash<auto>> h, string drv);
protected:
hash<auto> getDatabaseOptions();
public:
protected:
hash<auto> getCallbackOptions();
public:
protected:
hash<auto> getCreationOptions();
public:
protected:
hash<auto> getCacheOptions();
public:
protected:
hash<auto> getAlignSchemaOptions();
public:
protected:
hash<auto> getDropSchemaOptions();
public:
protected:
hash<auto> getSchemaDescriptionOptions();
public:
protected:
hash<auto> getSequenceDescriptionOptions();
public:
protected:
hash<auto> getRebuildIndexOptions();
public:
protected:
hash<auto> getComputeStatisticsOptions();
public:
protected:
hash<auto> getReclaimSpaceOptions();
public:
protected:
auto tryExecArgsImpl(string sql, *softlist<auto> args);
public:
protected:
auto tryExecRawImpl(string sql);
public:
protected:
abstract string getCreateSqlImpl(list l);
public:
protected:
abstract list<auto> getAlignSqlImpl(hash schema_hash, *hash<auto> opt);
public:
protected:
abstract list<auto> getDropSchemaSqlImpl(hash schema_hash, *hash<auto> opt);
public:
protected:
abstract *AbstractSequence getSequenceImpl(string name);
public:
protected:
abstract *AbstractFunction getFunctionImpl(string name);
public:
protected:
abstract *AbstractFunction getProcedureImpl(string name);
public:
protected:
abstract *AbstractView getViewImpl(string name);
public:
protected:
abstract AbstractSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash<auto> opts);
public:
protected:
abstract AbstractFunction makeFunctionImpl(string name, string src, *hash<auto> opts);
public:
protected:
abstract AbstractFunction makeProcedureImpl(string name, string src, *hash<auto> opts);
public:
protected:
abstract list<string> featuresImpl();
public:
protected:
abstract list<string> listTablesImpl();
public:
protected:
abstract list<string> listFunctionsImpl();
public:
protected:
abstract list<string> listProceduresImpl();
public:
protected:
abstract list<string> listSequencesImpl();
public:
protected:
abstract list<string> listViewsImpl();
public:
protected:
abstract int getNextSequenceValueImpl(string name);
public:
protected:
abstract int getCurrentSequenceValueImpl(string name);
public:
protected:
abstract bool supportsSequencesImpl();
public:
protected:
abstract bool supportsPackagesImpl();
public:
protected:
abstract bool supportsTypesImpl();
public:
protected:
abstract bool rebuildIndexImpl(string name, *hash<auto> options);
public:
protected:
abstract computeStatisticsImpl(*hash<auto> options);
public:
protected:
abstract reclaimSpaceImpl(*hash<auto> options);
public:
protected:
abstract int getPhysicalSizeImpl();
public:
};
};
SqlUtil::AbstractDatabase
the base abstract class for the database implementation
Definition AbstractDatabase.qc.dox.h:28
SqlUtil::AbstractDatabase::viewIterator
Qore::ListIterator viewIterator()
returns an iterator listing the string view names in the database
SqlUtil::AbstractDatabase::CreationOptions
const CreationOptions
default generic creation options
Definition AbstractDatabase.qc.dox.h:118
SqlUtil::AbstractDatabase::getNextSequenceValue
int getNextSequenceValue(string name)
returns the next value in the given sequence
SqlUtil::AbstractDatabase::CallbackOptions
const CallbackOptions
generic callback options
Definition AbstractDatabase.qc.dox.h:51
SqlUtil::AbstractDatabase::getReclaimSpaceOptions
hash< auto > getReclaimSpaceOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::dropProcedureIfExists
bool dropProcedureIfExists(string name, *hash< auto > opt)
drops the given procedure if it exists; returns True if the procedure was dropped,...
SqlUtil::AbstractDatabase::getRebuildIndexOptions
hash< auto > getRebuildIndexOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::DropSchemaOptions
const DropSchemaOptions
default generic drop schema options
Definition AbstractDatabase.qc.dox.h:132
SqlUtil::AbstractDatabase::getDropSequenceSqlIfExists
*string getDropSequenceSqlIfExists(string name, *hash< auto > opt)
returns the SQL require to drop the given sequence if it exists or nothing if the named sequence does...
SqlUtil::AbstractDatabase::CacheOptions
const CacheOptions
generic cache options
Definition AbstractDatabase.qc.dox.h:42
SqlUtil::AbstractDatabase::supportsTypes
bool supportsTypes()
returns True if the database supports named types
SqlUtil::AbstractDatabase::getCurrentSequenceValueImpl
abstract int getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
SqlUtil::AbstractDatabase::SchemaDescriptionOptions
const SchemaDescriptionOptions
default generic schema description keys
Definition AbstractDatabase.qc.dox.h:148
SqlUtil::AbstractDatabase::getAlignSql
list< auto > getAlignSql(hash schema_hash, *hash< auto > opt, *Tables table_cache)
accepts a hash argument describing a database schema and returns a list of SQL strings that can be us...
SqlUtil::AbstractDatabase::listProcedures
list< string > listProcedures()
returns a list of string procedure names in the database
SqlUtil::AbstractDatabase::getCallbackOptions
hash< auto > getCallbackOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::rebuildIndex
bool rebuildIndex(AbstractIndex index, *hash< auto > options)
Rebuild an index in the DB.
SqlUtil::AbstractDatabase::features
list features()
See DB Features Constants.
SqlUtil::AbstractDatabase::getCreationOptions
hash< auto > getCreationOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::getDropFunctionSqlIfExists
*string getDropFunctionSqlIfExists(string name, *hash< auto > opt)
returns the SQL require to drop the given function if it exists or nothing if the named function does...
SqlUtil::AbstractDatabase::makeFunction
AbstractFunction makeFunction(string name, string src, *hash< auto > opts)
creates a database-specific AbstractFunction object corresponding to the arguments
SqlUtil::AbstractDatabase::requiresScale
bool requiresScale()
Returns True if the driver requires a scale to support decimal values in numeric or decimal columns.
SqlUtil::AbstractDatabase::ActionMap
const ActionMap
maps from action codes to action descriptions
Definition AbstractDatabase.qc.dox.h:100
SqlUtil::AbstractDatabase::getProcedure
*AbstractFunction getProcedure(string name)
returns an AbstractFunction argument for the given stored procedure name or nothing if the stored pro...
SqlUtil::AbstractDatabase::getAlignProcedureSql
list< auto > getAlignProcedureSql(AbstractFunction f, *hash< auto > opt)
returns a list of SQL strings that can be used to update a stored procedure in the database to the st...
SqlUtil::AbstractDatabase::getPhysicalSize
int getPhysicalSize()
Get the current database physical size in bytes.
SqlUtil::AbstractDatabase::getDropTableSqlIfExists
*list< auto > getDropTableSqlIfExists(string name, *hash< auto > opt)
returns the SQL require to drop the given table if it exists or nothing if the named table does not e...
SqlUtil::AbstractDatabase::makeSequence
AbstractSequence makeSequence(string name, number start=1, number increment=1, *softnumber end, *hash< auto > opts)
creates a database-specific AbstractSequence object corresponding to the arguments
SqlUtil::AbstractDatabase::supportsPackages
bool supportsPackages()
returns True if the database supports packages
SqlUtil::AbstractDatabase::ActionDescMap
const ActionDescMap
maps from action descriptions to action codes
Definition AbstractDatabase.qc.dox.h:104
SqlUtil::AbstractDatabase::ComputeStatisticsOptions
const ComputeStatisticsOptions
Options for computeStatistics()
Definition AbstractDatabase.qc.dox.h:161
SqlUtil::AbstractDatabase::getDatabaseOptions
hash< auto > getDatabaseOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::reclaimSpace
reclaimSpace(*hash< auto > options)
Reclaim taken but unused space in the DB.
SqlUtil::AbstractDatabase::getCacheOptions
hash< auto > getCacheOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::rebuildIndex
bool rebuildIndex(string name, *hash< auto > options)
Rebuild an index in the DB.
SqlUtil::AbstractDatabase::getSequenceDescriptionOptions
hash< auto > getSequenceDescriptionOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::tryExecArgs
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractDatabase::AlignSchemaOptions
const AlignSchemaOptions
default generic schema description / alignment options
Definition AbstractDatabase.qc.dox.h:125
SqlUtil::AbstractDatabase::native_case
bool native_case
native case option
Definition AbstractDatabase.qc.dox.h:170
SqlUtil::AbstractDatabase::DatabaseOptions
const DatabaseOptions
database options
Definition AbstractDatabase.qc.dox.h:35
SqlUtil::AbstractDatabase::getView
*AbstractView getView(string name)
returns an AbstractView argument for the given view name or nothing if the view cannot be found
SqlUtil::AbstractDatabase::supportsSequences
bool supportsSequences()
returns True if the database supports sequences
SqlUtil::AbstractDatabase::getCurrentSequenceValue
int getCurrentSequenceValue(string name)
returns the last value issued for the given sequence in the current session
SqlUtil::AbstractDatabase::computeStatistics
computeStatistics(*hash< auto > options)
Compute database statistics.
SqlUtil::AbstractDatabase::dropTableIfExists
bool dropTableIfExists(string name, *hash< auto > opt)
drops the given table if it exists; returns True if the table was dropped, False if not
SqlUtil::AbstractDatabase::tryExecRaw
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
SqlUtil::AbstractDatabase::tryExec
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractDatabase::getSchemaDescriptionOptions
hash< auto > getSchemaDescriptionOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::tableIterator
Qore::ListIterator tableIterator()
returns an iterator listing the string table names in the database
SqlUtil::AbstractDatabase::supportsSequencesImpl
abstract bool supportsSequencesImpl()
returns True if the database supports sequences
SqlUtil::AbstractDatabase::tryExecArgsImpl
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
SqlUtil::AbstractDatabase::listViews
list< string > listViews()
returns a list of string view names in the database
SqlUtil::AbstractDatabase::functionIterator
Qore::ListIterator functionIterator()
returns an iterator listing the string function names in the database
SqlUtil::AbstractDatabase::ReclaimSpaceOptions
const ReclaimSpaceOptions
Options for reclaimSpace()
Definition AbstractDatabase.qc.dox.h:165
SqlUtil::AbstractDatabase::dropViewIfExists
bool dropViewIfExists(string name, *hash< auto > opt)
drops the given view if it exists; returns True if the view was dropped, False if not
SqlUtil::AbstractDatabase::getComputeStatisticsOptions
hash< auto > getComputeStatisticsOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::getMaximumPrecision
int getMaximumPrecision()
Returns the maximum precision for numeric or decimal columns.
SqlUtil::AbstractDatabase::dropSequenceIfExists
bool dropSequenceIfExists(string name, *hash< auto > opt)
drops the given sequence if it exists; returns True if the sequence was dropped, False if not
SqlUtil::AbstractDatabase::makeTable
AbstractTable makeTable(string name, hash< auto > desc, *hash< auto > opts)
creates a database-specific AbstractTable object corresponding to the arguments
SqlUtil::AbstractDatabase::getAlignSchemaOptions
hash< auto > getAlignSchemaOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::ActionLetterMap
const ActionLetterMap
maps from action codes to action letter codes
Definition AbstractDatabase.qc.dox.h:108
SqlUtil::AbstractDatabase::getNextSequenceValueImpl
abstract int getNextSequenceValueImpl(string name)
returns the next value in the given sequence
SqlUtil::AbstractDatabase::makeProcedure
AbstractFunction makeProcedure(string name, string src, *hash< auto > opt)
creates a database-specific AbstractFunction object for a stored procedure corresponding to the argum...
SqlUtil::AbstractDatabase::procedureIterator
Qore::ListIterator procedureIterator()
returns an iterator listing the string procedure names in the database
SqlUtil::AbstractDatabase::sequenceIterator
Qore::ListIterator sequenceIterator()
returns an iterator listing the string sequence names in the database
SqlUtil::AbstractDatabase::listSequences
list< string > listSequences()
returns a list of string sequence names in the database
SqlUtil::AbstractDatabase::tryExecRawImpl
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
SqlUtil::AbstractDatabase::getAlignFunctionSql
list< auto > getAlignFunctionSql(AbstractFunction f, *hash< auto > opt)
returns a list of SQL strings that can be used to update a function in the database to the function d...
SqlUtil::AbstractDatabase::getDropProcedureSqlIfExists
*string getDropProcedureSqlIfExists(string name, *hash< auto > opt)
returns the SQL require to drop the given procedure if it exists or nothing if the named procedure do...
SqlUtil::AbstractDatabase::getSqlFromList
string getSqlFromList(list l)
returns an SQL string corresponding to the list of commands in the argument
SqlUtil::AbstractDatabase::getTable
*AbstractTable getTable(string name)
returns an AbstractTable argument for the given table name or nothing if the table cannot be found
SqlUtil::AbstractDatabase::getFunction
*AbstractFunction getFunction(string name)
returns an AbstractFunction argument for the given function name or nothing if the function cannot be...
SqlUtil::AbstractDatabase::listFunctions
list< string > listFunctions()
returns a list of string function names in the database
SqlUtil::AbstractDatabase::constructor
constructor(AbstractDatasource nds, *hash nopts)
creates the object; private constructor
SqlUtil::AbstractDatabase::listTables
list< string > listTables()
returns a list of string table names in the database
SqlUtil::AbstractDatabase::getDropSchemaSql
list< auto > getDropSchemaSql(hash schema_hash, *hash< auto > opt)
accepts a hash argument describing a database schema and returns a list of SQL strings that can be us...
SqlUtil::AbstractDatabase::getSequence
*AbstractSequence getSequence(string name)
returns an AbstractSequence argument for the given sequence name or nothing if the sequence cannot be...
SqlUtil::AbstractDatabase::dropFunctionIfExists
bool dropFunctionIfExists(string name, *hash< auto > opt)
drops the given function if it exists; returns True if the function was dropped, False if not
SqlUtil::AbstractDatabase::getDropSchemaOptions
hash< auto > getDropSchemaOptions()
override in subclasses to return driver-specific options
SqlUtil::AbstractDatabase::SequenceDescriptionOptions
const SequenceDescriptionOptions
default generic sequence description keys
Definition AbstractDatabase.qc.dox.h:157
SqlUtil::AbstractFunction
base class for functions
Definition SqlUtil.qm.dox.h:6231
SqlUtil::AbstractIndex
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5680
SqlUtil::AbstractSequence
base class for sequences
Definition SqlUtil.qm.dox.h:6114
SqlUtil::AbstractSqlUtilBase
base class for abstract SqlUtil classes
Definition AbstractSqlUtilBase.qc.dox.h:28
SqlUtil::AbstractSqlUtilBase::l
transient Mutex l()
mutex for atomic actions
SqlUtil::AbstractSqlUtilBase::opts
*hash< auto > opts
option hash
Definition AbstractSqlUtilBase.qc.dox.h:35
SqlUtil::AbstractTable
the base abstract class for the table implementation
Definition AbstractTable.qc.dox.h:30
SqlUtil::AbstractView
base class for views
Definition SqlUtil.qm.dox.h:6150
SqlUtil::Tables
the table container class stores a collection of tables in a schema
Definition SqlUtil.qm.dox.h:5232
SqlUtil::AbstractDatabase::AC_NotFound
const AC_NotFound
used when dropping object but the object is not present
Definition AbstractDatabase.qc.dox.h:96
SqlUtil::AbstractDatabase::AC_Modify
const AC_Modify
used when an object is modified in place
Definition AbstractDatabase.qc.dox.h:75
SqlUtil::AbstractDatabase::AC_Add
const AC_Add
used when an element is added to an existing object
Definition AbstractDatabase.qc.dox.h:81
SqlUtil::AbstractDatabase::AC_Recreate
const AC_Recreate
used when an object is recreated (usually dropped and recreated in place)
Definition AbstractDatabase.qc.dox.h:84
SqlUtil::AbstractDatabase::AC_Update
const AC_Update
used when data is updated in a table
Definition AbstractDatabase.qc.dox.h:90
SqlUtil::AbstractDatabase::AC_Drop
const AC_Drop
used when an object is dropped
Definition AbstractDatabase.qc.dox.h:69
SqlUtil::AbstractDatabase::AC_Create
const AC_Create
used when a new object is created
Definition AbstractDatabase.qc.dox.h:66
SqlUtil::AbstractDatabase::AC_Delete
const AC_Delete
used when data is deleted in a table
Definition AbstractDatabase.qc.dox.h:93
SqlUtil::AbstractDatabase::AC_Truncate
const AC_Truncate
used when a table is truncated
Definition AbstractDatabase.qc.dox.h:78
SqlUtil::AbstractDatabase::AC_Unchanged
const AC_Unchanged
Definition AbstractDatabase.qc.dox.h:63
SqlUtil::AbstractDatabase::AC_Insert
const AC_Insert
used when data is inserted in a table
Definition AbstractDatabase.qc.dox.h:87
SqlUtil::AbstractDatabase::AC_Rename
const AC_Rename
used when an object is renamed
Definition AbstractDatabase.qc.dox.h:72
SqlUtil
Qore AbstractDatabase class definition.
Definition AbstractDatabase.qc.dox.h:26