179 const GET_PHYSICAL_DB_SIZE_NOVAL = -1;
198 static doOkCallback(*hash<auto> opt,
int ac,
string type,
string name, *
string table, *
string info);
201 static runInfoCallback(code info_callback,
int ac,
string type,
string name, *
string table, *
string new_name, *
string info);
205 static *
string doCallback(*hash<auto> opt, *
string sql,
int ac,
string type,
string name, *
string table, *
string new_name, *
string info);
207 static list doCallback(*hash<auto> opt,
list sql,
int ac,
string type,
string name, *
string table, *
string new_name, *
string info);
235 auto tryExecArgs(
string sql, *softlist<auto> args);
289 list dropSqlUnlocked(
string type,
hash schema_hash, code
get, code make, *hash<auto> opt,
string make_arg_type);
294 list alignCodeUnlocked(
string type,
hash schema_hash, code
get, code make, *hash<auto> opt,
string make_arg_type);
510 doDropSql(*softlist
l,
string type,
string name, *hash<auto> opt);
513 bool doDrop(*softlist
l,
string type,
string name, *hash<auto> opt);
770 validateOptionsIntern(
string err, hash<auto> ropt, reference<hash> opt);
775 validateOptionsIntern(
string err, hash<auto> ropt, reference<hash> opt,
string tag);
785 static checkDriverOptions(reference<hash> h,
string drv);
866 abstract string getCreateSqlImpl(
list l);
869 abstract list<auto> getAlignSqlImpl(
hash schema_hash, *hash<auto> opt);
872 abstract list<auto> getDropSchemaSqlImpl(
hash schema_hash, *hash<auto> opt);
899 abstract list<string> featuresImpl();
902 abstract list<string> listTablesImpl();
905 abstract list<string> listFunctionsImpl();
908 abstract list<string> listProceduresImpl();
911 abstract list<string> listSequencesImpl();
914 abstract list<string> listViewsImpl();
931 abstract bool supportsPackagesImpl();
934 abstract bool supportsTypesImpl();
938 abstract bool rebuildIndexImpl(
string name, *hash<auto> options);
941 abstract computeStatisticsImpl(*hash<auto> options);
944 abstract reclaimSpaceImpl(*hash<auto> options);
947 abstract int getPhysicalSizeImpl();
const ActionMap
maps from action codes to action descriptions
Definition: AbstractDatabase.qc.dox.h:106
AbstractFunction makeFunction(string name, string src, *hash< auto > opts)
creates a database-specific AbstractFunction object corresponding to the arguments ...
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost ...
hash< auto > getComputeStatisticsOptions()
override in subclasses to return driver-specific options
hash< auto > getDatabaseOptions()
override in subclasses to return driver-specific options
const AC_Unchanged
used when an existing object matches the template and no changes are made
Definition: AbstractDatabase.qc.dox.h:69
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:30
bool rebuildIndex(string name, *hash< auto > options)
Rebuild an index in the DB.
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5009
hash< auto > getRebuildIndexOptions()
override in subclasses to return driver-specific options
*hash< auto > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:41
const DropSchemaOptions
default generic drop schema options
Definition: AbstractDatabase.qc.dox.h:138
reclaimSpace(*hash< auto > options)
Reclaim taken but unused space in the DB.
const SchemaDescriptionOptions
default generic schema description keys
Definition: AbstractDatabase.qc.dox.h:154
*AbstractView getView(string name)
returns an AbstractView argument for the given view name or NOTHING if the view cannot be found ...
bool dropSequenceIfExists(string name, *hash< auto > opt)
drops the given sequence if it exists; returns True if the sequence was dropped, False if not ...
const DatabaseOptions
database options
Definition: AbstractDatabase.qc.dox.h:41
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5454
constructor(AbstractDatasource nds, *hash nopts)
creates the object; private constructor
Qore::ListIterator procedureIterator()
returns an iterator listing the string procedure names in the database
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...
computeStatistics(*hash< auto > options)
Compute database statistics.
hash< auto > getCallbackOptions()
override in subclasses to return driver-specific options
const AC_Create
used when a new object is created
Definition: AbstractDatabase.qc.dox.h:72
base class for sequences
Definition: SqlUtil.qm.dox.h:5876
*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...
int getPhysicalSize()
Get the current database physical size in bytes.
*AbstractSequence getSequence(string name)
returns an AbstractSequence argument for the given sequence name or NOTHING if the sequence cannot be...
number number(softnumber n)
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...
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:34
const CacheOptions
generic cache options
Definition: AbstractDatabase.qc.dox.h:48
const AC_Modify
used when an object is modified in place
Definition: AbstractDatabase.qc.dox.h:81
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 ...
*AbstractFunction getFunction(string name)
returns an AbstractFunction argument for the given function name or NOTHING if the function cannot be...
const AC_Drop
used when an object is dropped
Definition: AbstractDatabase.qc.dox.h:75
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
Qore::ListIterator sequenceIterator()
returns an iterator listing the string sequence names in the database
const ActionLetterMap
maps from action codes to action letter codes
Definition: AbstractDatabase.qc.dox.h:114
hash< auto > getSchemaDescriptionOptions()
override in subclasses to return driver-specific options
bool supportsPackages()
returns True if the database supports packages
int index(softstring str, softstring substr, softint pos=0)
Qore::ListIterator functionIterator()
returns an iterator listing the string function names in the database
hash< auto > getCreationOptions()
override in subclasses to return driver-specific options
const AC_Rename
used when an object is renamed
Definition: AbstractDatabase.qc.dox.h:78
list< string > listTables()
returns a list of string table names in the database
bool dropViewIfExists(string name, *hash< auto > opt)
drops the given view if it exists; returns True if the view was dropped, False if not ...
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:124
const AC_Insert
used when data is inserted in a table
Definition: AbstractDatabase.qc.dox.h:93
hash< auto > getAlignSchemaOptions()
override in subclasses to return driver-specific options
hash< auto > getSequenceDescriptionOptions()
override in subclasses to return driver-specific options
Qore::ListIterator tableIterator()
returns an iterator listing the string table names in the database
abstract bool supportsSequencesImpl()
returns True if the database supports sequences
string getSqlFromList(list l)
returns an SQL string corresponding to the list of commands in the argument
bool supportsTypes()
returns True if the database supports named types
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...
Qore::ListIterator viewIterator()
returns an iterator listing the string view names in the database
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...
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
base class for functions
Definition: SqlUtil.qm.dox.h:5993
const AC_Recreate
used when an object is recreated (usually dropped and recreated in place)
Definition: AbstractDatabase.qc.dox.h:90
base class for views
Definition: SqlUtil.qm.dox.h:5912
bool native_case
native case option
Definition: AbstractDatabase.qc.dox.h:176
hash< auto > hash(object obj)
AbstractTable makeTable(string name, hash< auto > desc, *hash< auto > opts)
creates a database-specific AbstractTable object corresponding to the arguments
hash< auto > getDropSchemaOptions()
override in subclasses to return driver-specific options
const SequenceDescriptionOptions
default generic sequence description keys
Definition: AbstractDatabase.qc.dox.h:163
hash< auto > getReclaimSpaceOptions()
override in subclasses to return driver-specific options
list< string > listSequences()
returns a list of string sequence names in the database
list< string > listProcedures()
returns a list of string procedure names in the database
bool dropFunctionIfExists(string name, *hash< auto > opt)
drops the given function if it exists; returns True if the function was dropped, False if not ...
const AlignSchemaOptions
default generic schema description / alignment options
Definition: AbstractDatabase.qc.dox.h:131
int getNextSequenceValue(string name)
returns the next value in the given sequence
const AC_Truncate
used when a table is truncated
Definition: AbstractDatabase.qc.dox.h:84
transient Mutex l()
mutex for atomic actions
list< string > listViews()
returns a list of string view names in the database
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 ...
*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...
hash< auto > getCacheOptions()
override in subclasses to return driver-specific options
list features()
See DB Features Constants.
*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...
list< string > listFunctions()
returns a list of string function names in the database
const CallbackOptions
generic callback options
Definition: AbstractDatabase.qc.dox.h:57
const ActionDescMap
maps from action descriptions to action codes
Definition: AbstractDatabase.qc.dox.h:110
*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...
*AbstractFunction getProcedure(string name)
returns an AbstractFunction argument for the given stored procedure name or NOTHING if the stored pro...
int getCurrentSequenceValue(string name)
returns the last value issued for the given sequence in the current session
bool dropProcedureIfExists(string name, *hash< auto > opt)
drops the given procedure if it exists; returns True if the procedure was dropped, False if not
const AC_Delete
used when data is deleted in a table
Definition: AbstractDatabase.qc.dox.h:99
const ComputeStatisticsOptions
Options for computeStatistics()
Definition: AbstractDatabase.qc.dox.h:167
const AC_Update
used when data is updated in a table
Definition: AbstractDatabase.qc.dox.h:96
const AC_NotFound
used when dropping object but the object is not present
Definition: AbstractDatabase.qc.dox.h:102
abstract int getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
AbstractFunction makeProcedure(string name, string src, *hash< auto > opt)
creates a database-specific AbstractFunction object for a stored procedure corresponding to the argum...
the base abstract class for the database implementation
Definition: AbstractDatabase.qc.dox.h:34
bool dropTableIfExists(string name, *hash< auto > opt)
drops the given table if it exists; returns True if the table was dropped, False if not ...
const AC_Add
used when an element is added to an existing object
Definition: AbstractDatabase.qc.dox.h:87
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
*AbstractTable getTable(string name)
returns an AbstractTable argument for the given table name or NOTHING if the table cannot be found ...
abstract int getNextSequenceValueImpl(string name)
returns the next value in the given sequence
bool supportsSequences()
returns True if the database supports sequences
const ReclaimSpaceOptions
Options for reclaimSpace()
Definition: AbstractDatabase.qc.dox.h:171