 |
Qore SqlUtil Module Reference
1.6
|
50 "table_cache":
"Tables",
60 "info_callback":
"code",
61 "sql_callback":
"code",
167 "table_cache":
"Tables",
232 "tables" :
"softstringlist",
237 "tables" :
"softstringlist",
245 const GET_PHYSICAL_DB_SIZE_NOVAL = -1;
264 static doOkCallback(*hash<auto> opt,
int ac,
string type,
string name, *
string table, *
string info);
267 static runInfoCallback(code info_callback,
int ac,
string type,
string name, *
string table, *
string new_name, *
string info);
271 static *
string doCallback(*hash<auto> opt, *
string sql,
int ac,
string type,
string name, *
string table, *
string new_name, *
string info);
273 static list doCallback(*hash<auto> opt,
list sql,
int ac,
string type,
string name, *
string table, *
string new_name, *
string info);
355 list dropSqlUnlocked(
string type,
hash schema_hash, code get, code make, *hash<auto> opt,
string make_arg_type);
360 list alignCodeUnlocked(
string type,
hash schema_hash, code get, code make, *hash<auto> opt,
string make_arg_type);
576 doDropSql(*softlist
l,
string type,
string name, *hash<auto> opt);
579 bool doDrop(*softlist
l,
string type,
string name, *hash<auto> opt);
836 validateOptionsIntern(
string err, hash<auto> ropt, reference<hash> opt);
841 validateOptionsIntern(
string err, hash<auto> ropt, reference<hash> opt,
string tag);
851 static checkDriverOptions(reference<hash> h,
string drv);
932 abstract string getCreateSqlImpl(
list l);
935 abstract list<auto> getAlignSqlImpl(
hash schema_hash, *hash<auto> opt);
938 abstract list<auto> getDropSchemaSqlImpl(
hash schema_hash, *hash<auto> opt);
965 abstract list<string> featuresImpl();
968 abstract list<string> listTablesImpl();
971 abstract list<string> listFunctionsImpl();
974 abstract list<string> listProceduresImpl();
977 abstract list<string> listSequencesImpl();
980 abstract list<string> listViewsImpl();
997 abstract bool supportsPackagesImpl();
1000 abstract bool supportsTypesImpl();
1004 abstract bool rebuildIndexImpl(
string name, *hash<auto> options);
1007 abstract computeStatisticsImpl(*hash<auto> options);
1010 abstract reclaimSpaceImpl(*hash<auto> options);
1013 abstract int getPhysicalSizeImpl();
list features()
See DB Features Constants.
bool native_case
native case option
Definition: AbstractDatabase.qc.dox.h:242
int getCurrentSequenceValue(string name)
returns the last value issued for the given sequence in the current session
const ActionMap
maps from action codes to action descriptions
Definition: AbstractDatabase.qc.dox.h:111
const AC_Unchanged
used when an existing object matches the template and no changes are made
Definition: AbstractDatabase.qc.dox.h:74
*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...
*AbstractFunction getFunction(string name)
returns an AbstractFunction argument for the given function name or NOTHING if the function cannot be...
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...
*AbstractView getView(string name)
returns an AbstractView argument for the given view name or NOTHING if the view cannot be found
bool supportsPackages()
returns True if the database supports packages
base class for sequences
Definition: SqlUtil.qm.dox.h:6204
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
bool supportsTypes()
returns True if the database supports named types
int index(softstring str, softstring substr, softint pos=0)
hash< auto > getDatabaseOptions()
override in subclasses to return driver-specific options
string getSqlFromList(list l)
returns an SQL string corresponding to the list of commands in the argument
AbstractTable makeTable(string name, hash< auto > desc, *hash< auto > opts)
creates a database-specific AbstractTable object corresponding to the arguments
const SchemaDescriptionOptions
default generic schema description keys
Definition: AbstractDatabase.qc.dox.h:201
const AC_Drop
used when an object is dropped
Definition: AbstractDatabase.qc.dox.h:80
bool dropProcedureIfExists(string name, *hash< auto > opt)
drops the given procedure if it exists; returns True if the procedure was dropped,...
Qore::ListIterator procedureIterator()
returns an iterator listing the string procedure names in the database
base class for functions
Definition: SqlUtil.qm.dox.h:6321
const SequenceDescriptionOptions
default generic sequence description keys
Definition: AbstractDatabase.qc.dox.h:224
bool dropTableIfExists(string name, *hash< auto > opt)
drops the given table if it exists; returns True if the table was dropped, False if not
computeStatistics(*hash< auto > options)
Compute database statistics.
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:34
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
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
int getNextSequenceValue(string name)
returns the next value in the given sequence
const ReclaimSpaceOptions
Options for reclaimSpace()
Definition: AbstractDatabase.qc.dox.h:236
AbstractFunction makeFunction(string name, string src, *hash< auto > opts)
creates a database-specific AbstractFunction object corresponding to the arguments
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...
hash< auto > getSchemaDescriptionOptions()
override in subclasses to return driver-specific options
const AC_NotFound
used when dropping object but the object is not present
Definition: AbstractDatabase.qc.dox.h:107
hash< auto > getCacheOptions()
override in subclasses to return driver-specific options
hash< auto > getDropSchemaOptions()
override in subclasses to return driver-specific options
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
Qore::ListIterator tableIterator()
returns an iterator listing the string table names in the database
hash< auto > getSequenceDescriptionOptions()
override in subclasses to return driver-specific options
const DatabaseOptions
database options
Definition: AbstractDatabase.qc.dox.h:41
*hash< auto > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:41
const AC_Rename
used when an object is renamed
Definition: AbstractDatabase.qc.dox.h:83
const AlignSchemaOptions
default generic schema description / alignment options
Definition: AbstractDatabase.qc.dox.h:176
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5817
list< string > listTables()
returns a list of string table names in the database
const AC_Modify
used when an object is modified in place
Definition: AbstractDatabase.qc.dox.h:86
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...
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
const CallbackOptions
generic callback options
Definition: AbstractDatabase.qc.dox.h:59
list< string > listFunctions()
returns a list of string function names in the database
const AC_Create
used when a new object is created
Definition: AbstractDatabase.qc.dox.h:77
hash< auto > getCreationOptions()
override in subclasses to return driver-specific options
hash< auto > getRebuildIndexOptions()
override in subclasses to return driver-specific options
bool rebuildIndex(AbstractIndex index, *hash< auto > options)
Rebuild an index in the DB.
list< string > listProcedures()
returns a list of string procedure names in the database
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:36
hash< auto > getComputeStatisticsOptions()
override in subclasses to return driver-specific options
bool supportsSequences()
returns True if the database supports sequences
hash< auto > hash(object obj)
const ActionLetterMap
maps from action codes to action letter codes
Definition: AbstractDatabase.qc.dox.h:143
bool dropViewIfExists(string name, *hash< auto > opt)
drops the given view if it exists; returns True if the view was dropped, False if not
constructor(AbstractDatasource nds, *hash nopts)
creates the object; private constructor
*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...
const AC_Truncate
used when a table is truncated
Definition: AbstractDatabase.qc.dox.h:89
hash< auto > getCallbackOptions()
override in subclasses to return driver-specific options
Qore::ListIterator sequenceIterator()
returns an iterator listing the string sequence names in the database
base class for views
Definition: SqlUtil.qm.dox.h:6240
*AbstractFunction getProcedure(string name)
returns an AbstractFunction argument for the given stored procedure name or NOTHING if the stored pro...
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:165
bool rebuildIndex(string name, *hash< auto > options)
Rebuild an index in the DB.
const AC_Recreate
used when an object is recreated (usually dropped and recreated in place)
Definition: AbstractDatabase.qc.dox.h:95
Qore::ListIterator functionIterator()
returns an iterator listing the string function names in the database
*AbstractSequence getSequence(string name)
returns an AbstractSequence argument for the given sequence name or NOTHING if the sequence cannot be...
reclaimSpace(*hash< auto > options)
Reclaim taken but unused space in the DB.
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
hash< auto > getReclaimSpaceOptions()
override in subclasses to return driver-specific options
list< string > listSequences()
returns a list of string sequence names in the database
abstract int getNextSequenceValueImpl(string name)
returns the next value in the given sequence
const AC_Delete
used when data is deleted in a table
Definition: AbstractDatabase.qc.dox.h:104
const AC_Add
used when an element is added to an existing object
Definition: AbstractDatabase.qc.dox.h:92
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 ActionDescMap
maps from action descriptions to action codes
Definition: AbstractDatabase.qc.dox.h:127
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5374
*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...
*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...
hash< auto > getAlignSchemaOptions()
override in subclasses to return driver-specific options
const CacheOptions
generic cache options
Definition: AbstractDatabase.qc.dox.h:49
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
number number(softnumber n)
const DropSchemaOptions
default generic drop schema options
Definition: AbstractDatabase.qc.dox.h:184
abstract bool supportsSequencesImpl()
returns True if the database supports sequences
list< string > listViews()
returns a list of string view names in the database
transient Mutex l()
mutex for atomic actions
*AbstractTable getTable(string name)
returns an AbstractTable argument for the given table name or NOTHING if the table cannot be found
const AC_Insert
used when data is inserted in a table
Definition: AbstractDatabase.qc.dox.h:98
bool dropFunctionIfExists(string name, *hash< auto > opt)
drops the given function if it exists; returns True if the function was dropped, False if not
Qore::ListIterator viewIterator()
returns an iterator listing the string view names in the database
const AC_Update
used when data is updated in a table
Definition: AbstractDatabase.qc.dox.h:101
int getPhysicalSize()
Get the current database physical size in bytes.
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...
const ComputeStatisticsOptions
Options for computeStatistics()
Definition: AbstractDatabase.qc.dox.h:231