Loading...
Searching...
No Matches
AbstractTable.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace SqlUtil {
class AbstractTable : public AbstractSqlUtilBase {
public:
const TableOptions = ...;
const IndexOptions = ...;
const ConstraintOptions = IndexOptions;
const CacheOptions = ...;
const ForeignConstraintOptions = ...;
const TriggerOptions = AbstractDatabase::CreationOptions;
const SelectOptions = ...;
const TableOmissionOptions = ...;
const TableCreationOptions = ...;
const AlignTableOptions = ...;
const TableDescriptionHashOptions = ...;
const ColumnDescOptions = ...;
const AdditionalColumnDescOptions = ...;
const ColumnOptions = {};
const SqlDataCallbackOptions = ...;
const InsertOptions = ...;
const UpsertOptions = ...;
const InsertFromIteratorOptions = ...;
const UpsertInsertFirst = 1;
const UpsertUpdateFirst = 2;
const UpsertSelectFirst = 3;
const UpsertAuto = 4;
const UpsertInsertOnly = 5;
const UpsertUpdateOnly = 6;
const UpsertStrategyMap = ...;
const UpsertStrategyDescriptionMap = ...;
const UR_Inserted = 1;
const UR_Verified = 2;
const UR_Updated = 3;
const UR_Unchanged = 4;
const UR_Deleted = 5;
const UpsertResultMap = ...;
const UpsertResultDescriptionMap = ...;
const UpsertResultLetterMap = ...;
protected:
string name;
Columns columns;
AbstractPrimaryKey primaryKey;
Indexes indexes;
ForeignConstraints foreignConstraints;
Constraints constraints;
Triggers triggers;
bool native_case = False;
bool inDb = False;
bool manual = False;
hash m_customCopMap = {};
public:
protected:
constructor(AbstractDatasource nds, string nname, *hash nopts) ;
public:
copy(AbstractTable old);
setDatasource(AbstractDatasource nds);
protected:
doTableOptions(*hash<auto> nopts);
public:
beginTransaction();
commit();
rollback();
bool inDb();
Qore::AbstractIterator getUniqueConstraintIterator();
dropCommit(*hash<auto> opt);
drop(*hash<auto> opt);
deprecated dropNoCommit(*hash<auto> opt);
auto tryExec(string sql);
auto tryExecArgs(string sql, *softlist<auto> args);
auto tryExecRaw(string sql);
softlist<auto> getDropSql(*hash<auto> opt);
truncateCommit();
truncate();
deprecated truncateNoCommit();
string getTruncateSql(*hash<auto> opt);
createCommit(*hash<auto> opt);
create(*hash<auto> opt);
deprecated createNoCommit(*hash<auto> opt);
rename(string new_name, *reference<string> sql, *Tables table_cache);
protected:
doRenameIntern(string new_name, *Tables table_cache);
public:
bool emptyData();
bool empty();
protected:
bool emptyUnlocked();
public:
setupTable(hash<auto> desc, *hash<auto> opt);
AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
list<auto> getAddColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
protected:
AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
public:
protected:
addColumnToTableUnlocked(AbstractColumn c);
public:
AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
list<auto> getModifyColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
protected:
AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
public:
protected:
validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt);
public:
protected:
validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt, string tag);
public:
protected:
execSql(softlist lsql);
public:
AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
protected:
setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
public:
protected:
AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
public:
protected:
AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
public:
list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
protected:
list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
public:
list<auto> getDropPrimaryKeySql(*hash<auto> opt);
AbstractPrimaryKey dropPrimaryKey(*reference lsql);
AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
protected:
AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
public:
protected:
AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
public:
AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
protected:
AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
public:
protected:
AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
public:
AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
AbstractIndex dropIndex(string iname, *reference<string> sql);
string getDropIndexSql(string iname, *hash<auto> opt);
AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
protected:
Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
public:
protected:
AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
public:
protected:
AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
public:
AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
AbstractForeignConstraint removeForeignConstraint(string cname);
AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
protected:
AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
public:
protected:
AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
public:
AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
string getDropConstraintSql(string cname, *hash<auto> opt);
*string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
protected:
AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
public:
AbstractConstraint dropConstraint(string cname, *reference<string> sql);
AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
protected:
AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
public:
protected:
AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
public:
AbstractTrigger dropTrigger(string tname, *reference<string> sql);
list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
protected:
getAllConstraintsUnlocked(*hash<auto> opt);
public:
protected:
checkUniqueConstraintName(string err, string cname);
public:
protected:
checkUniqueConstraintNameValidateOptions(string err, string cname, hash<auto> ropt, reference<hash> opt);
public:
protected:
validateColumnOptions(string cname, reference<hash> opt, bool nullable);
public:
AbstractColumn dropColumn(string cname, *reference lsql);
list<auto> getDropColumnSql(string cname, *hash<auto> opt);
*hash<auto> insertCommit(hash<auto> row);
*hash<auto> insertCommit(hash<auto> row, reference<string> sql);
*hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
*hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
*hash<auto> insert(hash<auto> row);
*hash<auto> insert(hash<auto> row, reference<string> sql);
*hash<auto> insert(hash<auto> row, hash<auto> opt);
*hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
protected:
*hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
protected:
hash<auto> getPlaceholdersAndValues(hash<auto> row);
public:
bool hasReturning();
int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
int insertFromSelectCommit(list cols, AbstractTable source);
int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
int insertFromSelect(list cols, AbstractTable source);
int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
protected:
int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash<auto> opt);
int insertFromIterator(Qore::AbstractIterator i, *hash<auto> opt);
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
protected:
int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
public:
int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
code getBulkUpsertClosure(hash<auto> example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
code getUpsertClosureWithValidation(hash<auto> example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
*hash<string, int> upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
*hash<string, int> upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
deprecated *hash<string, int> upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
protected:
*hash<string, int> upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
public:
protected:
*hash<string, int> doDeleteOthersIntern(hash<auto> pkh, *hash<auto> opt);
public:
*hash<string, int> upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
*hash<string, int> upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
*hash<string, int> upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
deprecated *hash<string, int> upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
deprecated *hash<string, int> upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
deprecated *hash<string, int> upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
softint rowCount();
Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
protected:
Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
public:
*hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
protected:
*hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
*list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
protected:
*list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
*hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
protected:
*hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
*hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
*list<auto> selectRows(*hash<auto> sh, *hash<auto> opt);
*hash<auto> select(*hash<auto> sh, *hash<auto> opt);
string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
*AbstractUniqueConstraint matchAnyUnique(softlist<auto> cols);
protected:
string getSelectSqlStringIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
public:
// column & table information must be retrieved before calling this method
protected:
string getSelectSqlStringIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<string, bool> subquery_column_map, *hash<auto> opt, *hash<auto> pseudo_column_map);
public:
AbstractTable getSubtableFromString(string table, *hash<auto> opt);
string getExpressionArg(reference<hash<QueryInfo>> info, int role, auto arg, AbstractDataProviderType expected_type);
protected:
string getFromIntern(string from, *hash<auto> qh);
public:
protected:
list<auto> getGroupByListUnlocked(hash<QueryInfo> info, list<auto> coll);
public:
protected:
list<auto> getOrderByListIntern(hash<QueryInfo> info, list<auto> coll);
public:
protected:
list<auto> getGroupOrderByListIntern(hash<QueryInfo> info, string key, list<auto> coll);
public:
protected:
doForUpdate(reference<string> sql);
public:
protected:
string getSelectSqlName(*hash<auto> qh);
public:
protected:
string getColumnExpressionIntern(reference<hash<QueryInfo>> info, auto cvc);
public:
protected:
string doColumnOperatorIntern(reference<hash<QueryInfo>> info, hash<auto> cvc);
public:
protected:
string doColumnOperatorIntern(reference<hash<QueryInfo>> info, auto cop, auto arg, *string cve);
public:
protected:
string getColumnNameIntern(hash<QueryInfo> info, string column_name);
public:
protected:
bool asteriskRequiresPrefix();
public:
protected:
getSelectWhereSqlIntern(reference<hash<QueryInfo>> info, reference<string> sql);
public:
protected:
*string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<string, AbstractTable> join_map);
public:
protected:
*string getWhereExpressionIntern(reference<hash<QueryInfo>> info, hash<DataProviderExpression> cond, *string cprefix);
public:
protected:
*string getExpressionIntern(reference<hash<QueryInfo>> info, int role, hash<DataProviderExpression> cond, AbstractDataProviderType expected_type);
public:
protected:
*string getWhereClauseIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
public:
protected:
*list<string> getWhereClauseListIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
public:
protected:
string doWhereExpressionIntern(reference<hash<QueryInfo>> info, string cn, auto we);
public:
string getOrClause(reference<hash<QueryInfo>> info, list<auto> arglist);
string getOrClause(reference<hash<QueryInfo>> info, hash<auto> arg);
protected:
doSelectOrderBySqlIntern(hash<QueryInfo> info, reference<string> sql, list<auto> coll);
public:
int delCommit(hash<auto> cond, reference<string> sql, hash<auto> opt);
int delCommit(hash<auto> cond, hash<auto> opt);
int delCommit(hash<auto> cond, reference<string> sql);
int delCommit(hash<auto> cond);
int delCommit();
int del(hash<auto> cond, reference<string> sql, hash<auto> opt);
int del(hash<auto> cond, hash<auto> opt);
int del(hash<auto> cond, reference<string> sql);
int del(hash<auto> cond);
int del();
hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
deprecated int delNoCommit(*hash<auto> cond, *reference<string> sql);
protected:
int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql);
int updateCommit(hash<auto> set, hash<auto> cond, hash<auto> opt);
int updateCommit(hash<auto> set, hash<auto> cond);
int updateCommit(hash<auto> set);
int update(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
int update(hash<auto> set, hash<auto> cond, reference<string> sql);
int update(hash<auto> set, hash<auto> cond, hash<auto> opt);
int update(hash<auto> set, hash<auto> cond);
int update(hash<auto> set);
hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *reference<string> sql);
deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *hash<auto> opt);
protected:
int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
public:
protected:
string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
public:
protected:
bool emptyDataIntern();
public:
protected:
Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
public:
protected:
code getUpsertInsertFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
public:
protected:
code getUpsertUpdateFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
public:
protected:
code getUpsertSelectFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
public:
protected:
code getUpsertInsertOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
public:
protected:
code getUpsertUpdateOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
public:
protected:
Columns getUpsertColumns(reference<string> csrc);
public:
protected:
hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
public:
protected:
bool matchUniqueColumns(Columns cols, hash<auto> row);
public:
protected:
string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
public:
protected:
string getUpsertInsertSql(hash<auto> row);
public:
protected:
string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
public:
protected:
softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
public:
protected:
checkValue(string cname, string argname, reference val, string type);
public:
string getSqlFromList(list<auto> l);
string getSqlValue(auto v);
string getName();
cache(*hash<auto> opts);
clear();
hash<auto> getDescriptionHash();
Columns describe();
AbstractPrimaryKey getPrimaryKey();
*AbstractUniqueConstraint findUniqueConstraint(string name);
protected:
*AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
public:
Indexes getIndexes();
ForeignConstraints getForeignConstraints(*hash<auto> opt);
Constraints getConstraints();
Triggers getTriggers();
string getRenameSql(string new_name, *hash<auto> opt);
string getCreateSqlString(*hash<auto> opt);
list<auto> getCreateSql(*hash<auto> opt);
string getCreateTableSql(*hash<auto> opt);
bool checkExistence();
protected:
*hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
public:
list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
protected:
list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
public:
protected:
*AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
public:
protected:
*list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
public:
protected:
renameIndexUnlocked(AbstractIndex ix, string new_name);
public:
string getAlignSqlString(AbstractTable t, *hash<auto> opt);
*list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
*string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
*list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
*list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
*list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
*list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
*hash find(auto id);
*list find(list<auto> ids);
protected:
string getPrimaryKeyColumn();
public:
*hash<auto> find(hash<auto> row);
*hash<auto> findSingle(*hash<auto> cond);
*list<auto> findAll(*hash<auto> cond);
string getDesc();
string getBaseType();
string getSqlName();
string getColumnSqlName(string col);
list<auto> getColumnSqlNames(softlist cols);
bool bindEmptyStringsAsNull();
*hash<string, AbstractDataField> getRecordType();
AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
AbstractDataProviderType getDbType(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options);
AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
AbstractSavepointHelper getSavepointHelper(*string savepoint);
hash<auto> getExpressionMap();
hash<auto> getWhereOperatorMap();
abstract bool hasArrayBind();
protected:
hash<auto> getTableOptions();
public:
protected:
hash<auto> getForeignConstraintOptions();
public:
protected:
hash<auto> getConstraintOptions();
public:
protected:
hash<auto> getCacheOptions();
public:
protected:
hash<auto> getTableCreationOptions();
public:
protected:
hash<auto> getAlignTableOptions();
public:
protected:
hash<auto> getTableDescriptionHashOptions();
public:
protected:
hash<auto> getColumnOptions();
public:
protected:
hash<auto> getColumnDescOptions();
public:
protected:
hash<auto> getTableColumnDescOptions();
public:
protected:
hash<auto> getIndexOptions();
public:
protected:
hash<auto> getTriggerOptions();
public:
protected:
hash<auto> getSelectOptions();
public:
protected:
hash<auto> getUpsertOptions();
public:
protected:
hash<auto> getInsertOptions();
public:
protected:
hash<auto> getInsertFromIteratorOptions();
public:
protected:
hash<auto> getSqlDataCallbackOptions();
public:
protected:
hash<auto> getColumnOperatorMap();
public:
protected:
*hash<auto> getColumnOperatorMapImpl();
public:
addCustomCopOperator(string name, hash<auto> operator);
bool isDuplicateRowError(hash<ExceptionInfo> ex);
protected:
hash<auto> getInsertOperatorMap();
public:
protected:
hash<auto> getUpdateOperatorMap();
public:
protected:
hash<auto> getRawUpdateOperatorMap();
public:
protected:
*hash<auto> getPseudoColumnHash();
public:
protected:
string getCreateTableSqlUnlocked(*hash<auto> opt);
public:
protected:
*list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
*string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
*list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
*list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
*list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
*list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
public:
protected:
cacheUnlocked(*hash<auto> opt);
public:
protected:
auto execData(*hash<auto> opt, string sql, *list<auto> args);
public:
protected:
execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
public:
static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
protected:
getColumnsUnlocked();
public:
protected:
getPrimaryKeyUnlocked();
public:
// also loads primary key and constraints (for unique constraints)
protected:
getIndexesUnlocked();
public:
protected:
getForeignConstraintsUnlocked(*hash<auto> opt);
public:
protected:
addSourceConstraint(string table_name, AbstractForeignConstraint fk);
public:
protected:
getConstraintsUnlocked();
public:
protected:
getTriggersUnlocked();
public:
protected:
bool hasReturningImpl();
public:
protected:
softlist<auto> getDropSqlImpl();
public:
protected:
string getTruncateSqlImpl();
public:
protected:
auto tryExecArgsImpl(string sql, *softlist<auto> args);
public:
protected:
auto tryExecRawImpl(string sql);
public:
protected:
clearImpl();
public:
protected:
preSetupTableImpl(reference desc, *hash<auto> opt);
public:
protected:
abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
public:
protected:
abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
public:
protected:
abstract bool emptyImpl();
public:
protected:
abstract *string getSqlValueImpl(auto v);
public:
protected:
abstract bool checkExistenceImpl();
public:
protected:
abstract bool supportsTablespacesImpl();
public:
protected:
abstract bool constraintsLinkedToIndexesImpl();
public:
protected:
abstract bool uniqueIndexCreatesConstraintImpl();
public:
protected:
abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
public:
protected:
abstract Columns describeImpl();
public:
protected:
abstract AbstractPrimaryKey getPrimaryKeyImpl();
public:
protected:
abstract Indexes getIndexesImpl();
public:
protected:
abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
public:
protected:
abstract Constraints getConstraintsImpl();
public:
protected:
abstract Triggers getTriggersImpl();
public:
protected:
abstract string getCreateTableSqlImpl(*hash<auto> opt);
public:
protected:
abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
public:
protected:
abstract string getCreateSqlImpl(list<auto> l);
public:
protected:
abstract string getRenameSqlImpl(string new_name);
public:
protected:
abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
public:
protected:
abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
public:
protected:
abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
public:
protected:
abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
public:
protected:
abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
public:
protected:
abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
public:
protected:
abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
public:
protected:
abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
public:
protected:
abstract bool tryInsertImpl(string sql, hash<auto> row);
public:
protected:
abstract hash<auto> getQoreTypeMapImpl();
public:
protected:
abstract hash<auto> getTypeMapImpl();
public:
protected:
abstract doSelectOrderByWithOffsetSqlInternImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
public:
protected:
abstract doSelectLimitOnlyInternImpl(reference<hash<QueryInfo>> info, reference<string> sql);
public:
protected:
abstract copyImpl(AbstractTable old);
public:
protected:
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint);
public:
protected:
abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
public:
};
};
SqlUtil::AbstractCheckConstraint
abstract class for check constraints
Definition SqlUtil.qm.dox.h:5872
SqlUtil::AbstractColumn
the base class for column information
Definition SqlUtil.qm.dox.h:5502
SqlUtil::AbstractColumnSupportingConstraint
the API for a constraint with columns
Definition SqlUtil.qm.dox.h:5929
SqlUtil::AbstractConstraint
abstract base class for constraints
Definition SqlUtil.qm.dox.h:5810
SqlUtil::AbstractDatabase::CreationOptions
const CreationOptions
default generic creation options
Definition AbstractDatabase.qc.dox.h:118
SqlUtil::AbstractForeignConstraint
the base class for foreign key constraint information
Definition SqlUtil.qm.dox.h:6093
SqlUtil::AbstractIndex
the abstract base class for index information
Definition SqlUtil.qm.dox.h:5680
SqlUtil::AbstractPrimaryKey
represents a primary key
Definition SqlUtil.qm.dox.h:6012
SqlUtil::AbstractSavepointHelper
Abstract base class for savepoint helpers for epheremal transaction support.
Definition AbstractSavepointHelper.qc.dox.h:33
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::AbstractTable::getDropColumnSql
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
SqlUtil::AbstractTable::constraintsLinkedToIndexesImpl
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insertCommit() variant
SqlUtil::AbstractTable::TableOptions
const TableOptions
table options
Definition AbstractTable.qc.dox.h:41
SqlUtil::AbstractTable::dropCommit
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping the table
SqlUtil::AbstractTable::isDuplicateRowError
bool isDuplicateRowError(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
SqlUtil::AbstractTable::tryExecRawImpl
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
SqlUtil::AbstractTable::del
int del(hash< auto > cond, reference< string > sql)
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::find
*hash< auto > find(hash< auto > row)
finds a row in the table with the given primary key value given as a hash; if no row matches the prim...
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs,...
SqlUtil::AbstractTable::modifyColumn
AbstractColumn modifyColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
modifies an existing column in the table; if the table is already known to be in the database,...
SqlUtil::AbstractTable::constructor
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
SqlUtil::AbstractTable::dropPrimaryKey
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::upsertFromSelect
*hash< string, int > upsertFromSelect(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given foreign table and select option hash into the curre...
SqlUtil::AbstractTable::getNumericTypeImpl
abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
SqlUtil::AbstractTable::rowCount
softint rowCount()
returns the number of rows in the table
SqlUtil::AbstractTable::getSqlValueImpl
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
SqlUtil::AbstractTable::ColumnOptions
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition AbstractTable.qc.dox.h:144
SqlUtil::AbstractTable::getQoreTypeMapImpl
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
SqlUtil::AbstractTable::upsertFromSelectNoCommit
deprecated *hash< string, int > upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
SqlUtil::AbstractTable::getTableOptions
hash< auto > getTableOptions()
returns the table options for this driver
SqlUtil::AbstractTable::getCreateConstraintsSql
*list< auto > getCreateConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create non-foreign constraints on the table or no...
SqlUtil::AbstractTable::selectRowWithInfo
hash< SqlResultInfo > selectRowWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result representing the row in the table that matches the argument hash; if mor...
SqlUtil::AbstractTable::describe
Columns describe()
returns an object of class Columns describing the table
SqlUtil::AbstractTable::TableOmissionOptions
const TableOmissionOptions
alignment omission options
Definition AbstractTable.qc.dox.h:83
SqlUtil::AbstractTable::addCustomCopOperator
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::getDropPrimaryKeySql
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table
SqlUtil::AbstractTable::hasReturningImpl
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements,...
SqlUtil::AbstractTable::checkExistenceImpl
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
SqlUtil::AbstractTable::getUpdateSql
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
SqlUtil::AbstractTable::getPseudoColumnHash
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
SqlUtil::AbstractTable::renameConstraint
AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql)
renames an existing constraint; this can be any constraint on the table, a primary key,...
SqlUtil::AbstractTable::getDescriptionHash
hash< auto > getDescriptionHash()
Returns a description hash of the table.
SqlUtil::AbstractTable::rename
rename(string new_name, *reference< string > sql, *Tables table_cache)
renames the table
SqlUtil::AbstractTable::upsertFromIteratorNoCommit
deprecated *hash< string, int > upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromIterator() wrapper.
SqlUtil::AbstractTable::setupTable
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
SqlUtil::AbstractTable::getColumnDataField
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
SqlUtil::AbstractTable::copy
copy(AbstractTable old)
copies the object
SqlUtil::AbstractTable::getDropAllConstraintsAndIndexesOnColumnSql
list< auto > getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash< auto > opt)
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the col...
SqlUtil::AbstractTable::del
int del(hash< auto > cond)
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::upsertCommit
int upsertCommit(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
SqlUtil::AbstractTable::dropColumn
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
SqlUtil::AbstractTable::getDropIndexSql
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
SqlUtil::AbstractTable::getTableCreationOptions
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
SqlUtil::AbstractTable::dropNoCommit
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
SqlUtil::AbstractTable::constraints
Constraints constraints
constraint descriptions
Definition AbstractTable.qc.dox.h:307
SqlUtil::AbstractTable::createNoCommit
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
SqlUtil::AbstractTable::getStatement
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::getDesc
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
SqlUtil::AbstractTable::UpsertResultLetterMap
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition AbstractTable.qc.dox.h:292
SqlUtil::AbstractTable::getPrimaryKey
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::UpsertOptions
const UpsertOptions
default upsert option keys
Definition AbstractTable.qc.dox.h:174
SqlUtil::AbstractTable::update
int update(hash< auto > set, hash< auto > cond)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::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::AbstractTable::getColumnSqlNames
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
SqlUtil::AbstractTable::getDropTriggerSql
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
SqlUtil::AbstractTable::delCommit
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::getStatementNoExec
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
SqlUtil::AbstractTable::upsertFromSelectCommit
*hash< string, int > upsertFromSelectCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
Upserts or merges data from the given foreign table and select option hash into the current table.
SqlUtil::AbstractTable::addUniqueConstraint
AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a unique constraint to the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::insertWithInfo
hash< SqlResultInfo > insertWithInfo(hash< auto > row, *hash< auto > opt)
Inserts a row and returns the result and also the SQL used.
SqlUtil::AbstractTable::getRecordType
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
SqlUtil::AbstractTable::getAddColumnSql
list< auto > getAddColumnSql(string cname, hash< auto > copt, bool nullable=True, *hash< auto > opt)
returns a list of SQL strings that can be use to add a column to the table
SqlUtil::AbstractTable::addColumn
AbstractColumn addColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
adds a column to the table; if the table is already known to be in the database, then it is added in ...
SqlUtil::AbstractTable::update
int update(hash< auto > set, hash< auto > cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; no tr...
SqlUtil::AbstractTable::getSqlName
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema,...
SqlUtil::AbstractTable::ColumnDescOptions
const ColumnDescOptions
Column description options.
Definition AbstractTable.qc.dox.h:133
SqlUtil::AbstractTable::getAddUniqueConstraintSql
string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash< auto > opt)
returns an SQL string that can be used to add a unique constraint to the table
SqlUtil::AbstractTable::getInsertFromIteratorOptions
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
SqlUtil::AbstractTable::getStatementNoExec
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
SqlUtil::AbstractTable::inDb
bool inDb
in database
Definition AbstractTable.qc.dox.h:313
SqlUtil::AbstractTable::getAlignSql
list< auto > getAlignSql(AbstractTable t, *hash< auto > opt)
returns a list of SQL strings required to align the table to the table given as an argument
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insert() variant
SqlUtil::AbstractTable::update
int update(hash< auto > set, hash< auto > cond, reference< string > sql)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::name
string name
the table's name
Definition AbstractTable.qc.dox.h:297
SqlUtil::AbstractTable::getCreateTriggersSql
*list< auto > getCreateTriggersSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create triggers on the table or nothing if there ...
SqlUtil::AbstractTable::IndexOptions
const IndexOptions
default index options
Definition AbstractTable.qc.dox.h:50
SqlUtil::AbstractTable::getCreateTableSql
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
SqlUtil::AbstractTable::find
*hash find(auto id)
finds a row in the table with the given primary key value; if no row matches the primary key value pa...
SqlUtil::AbstractTable::getAddCheckConstraintSql
string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash< auto > opt)
returns an SQL string that can be used to add a check constraint to the table
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
SqlUtil::AbstractTable::getCacheOptions
hash< auto > getCacheOptions()
returns the cache options for this driver
SqlUtil::AbstractTable::getColumnSqlName
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
SqlUtil::AbstractTable::selectRows
*list< auto > selectRows(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
SqlUtil::AbstractTable::upsertFromSelectCommit
*hash< string, int > upsertFromSelectCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelectCommit() variant
SqlUtil::AbstractTable::addIndex
AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash< auto > opt, *reference< string > sql)
adds an index to the table; if the table is already known to be in the database, then it is added in ...
SqlUtil::AbstractTable::hasReturning
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements,...
SqlUtil::AbstractTable::getUpsertClosureWithValidation
code getUpsertClosureWithValidation(hash< auto > example_row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
SqlUtil::AbstractTable::getDropConstraintSql
string getDropConstraintSql(string cname, *hash< auto > opt)
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the ...
SqlUtil::AbstractTable::doSelectLimitOnlyInternImpl
abstract doSelectLimitOnlyInternImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
SqlUtil::AbstractTable::upsertNoCommit
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
SqlUtil::AbstractTable::bindEmptyStringsAsNull
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
SqlUtil::AbstractTable::getAddTriggerSql
list< auto > getAddTriggerSql(string tname, string src, *hash topt, *hash< auto > opt)
returns a list of SQL strings that can be used to add a trigger to the table
SqlUtil::AbstractTable::getColumnDescOptions
hash< auto > getColumnDescOptions()
returns the column description options for this driver
SqlUtil::AbstractTable::getDbType
AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size=-1, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
SqlUtil::AbstractTable::getCreateMiscSql
*list< auto > getCreateMiscSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create other table attributes (such as comments,...
SqlUtil::AbstractTable::SqlDataCallbackOptions
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition AbstractTable.qc.dox.h:151
SqlUtil::AbstractTable::tryExec
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractTable::InsertOptions
const InsertOptions
generic SQL insert options
Definition AbstractTable.qc.dox.h:164
SqlUtil::AbstractTable::getColumnDataField
AbstractDataField getColumnDataField(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options, *string append_desc)
returns a field object for the given column
SqlUtil::AbstractTable::insertFromIteratorNoCommit
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
SqlUtil::AbstractTable::isDuplicateRowErrorImpl
abstract bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
SqlUtil::AbstractTable::renameIndex
AbstractIndex renameIndex(string old_name, string new_name, reference< string > sql)
renames an existing index; if the table is already known to be in the database, then the changes are ...
SqlUtil::AbstractTable::delCommit
int delCommit(hash< auto > cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; the transacti...
SqlUtil::AbstractTable::getSelectOptions
hash< auto > getSelectOptions()
returns the select options for this driver
SqlUtil::AbstractTable::delCommit
int delCommit(hash< auto > cond, hash< auto > opt)
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::getCreateSql
list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that could be used to create the table and all known properties of the ...
SqlUtil::AbstractTable::copyImpl
abstract copyImpl(AbstractTable old)
db-specific copy actions
SqlUtil::AbstractTable::insertNoCommit
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
SqlUtil::AbstractTable::dropConstraint
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key,...
SqlUtil::AbstractTable::getRenameSql
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
SqlUtil::AbstractTable::delCommit
int delCommit(hash< auto > cond)
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::getTriggerOptions
hash< auto > getTriggerOptions()
returns the trigger options for this driver
SqlUtil::AbstractTable::getUpsertOptions
hash< auto > getUpsertOptions()
returns the upsert options for this driver
SqlUtil::AbstractTable::getRawUpdateOperatorMap
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
SqlUtil::AbstractTable::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::AbstractTable::getAllUpsertColumns
hash< string, Columns > getAllUpsertColumns(*hash< auto > row)
returns a hash with a single value\
SqlUtil::AbstractTable::removeForeignConstraint
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case,...
SqlUtil::AbstractTable::CacheOptions
const CacheOptions
default cache options
Definition AbstractTable.qc.dox.h:59
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
SqlUtil::AbstractTable::findSingle
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match,...
SqlUtil::AbstractTable::getAddIndexSql
string getAddIndexSql(string iname, bool unique, softlist cols, *hash< auto > ixopt, *hash< auto > opt)
returns an SQL string that can be used to add an index to the table
SqlUtil::AbstractTable::native_case
bool native_case
native case option
Definition AbstractTable.qc.dox.h:311
SqlUtil::AbstractTable::insertFromIterator
int insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
SqlUtil::AbstractTable::delWithInfo
hash< SqlResultInfo > delWithInfo(hash< auto > cond, *hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
SqlUtil::AbstractTable::getUpsertClosure
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
SqlUtil::AbstractTable::getColumnOptions
hash< auto > getColumnOptions()
returns the column options for this driver
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::asteriskRequiresPrefix
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
SqlUtil::AbstractTable::emptyData
bool emptyData()
returns True if the table has no data rows, False if not
SqlUtil::AbstractTable::select
*hash< auto > select(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash< auto > set, hash< auto > cond, hash< auto > opt)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractTable::drop
drop(*hash< auto > opt)
drops the table from the database without any transaction management
SqlUtil::AbstractTable::getNumericType
AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
SqlUtil::AbstractTable::insertFromSelectNoCommit
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
SqlUtil::AbstractTable::upsertFromIteratorCommit
*hash< string, int > upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
SqlUtil::AbstractTable::uniqueIndexCreatesConstraintImpl
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash< auto > set, hash< auto > cond)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
SqlUtil::AbstractTable::getTableDescriptionHashOptions
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
SqlUtil::AbstractTable::updateNoCommit
deprecated int updateNoCommit(hash< auto > set, *hash< auto > cond, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::update() wrapper.
SqlUtil::AbstractTable::columns
Columns columns
column description object
Definition AbstractTable.qc.dox.h:299
SqlUtil::AbstractTable::getIndexes
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
SqlUtil::AbstractTable::getCreatePrimaryKeySql
*string getCreatePrimaryKeySql(*hash< auto > opt, bool cache=True)
returns an SQL string that could be used to create the primary key on the table
SqlUtil::AbstractTable::getName
string getName()
returns the name of the table
SqlUtil::AbstractTable::dropForeignConstraint
AbstractForeignConstraint dropForeignConstraint(string cname, *reference< string > sql)
drops a foreign constraint from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::getInsertOptions
hash< auto > getInsertOptions()
returns the insert options for this driver
SqlUtil::AbstractTable::selectRow
*hash< auto > selectRow(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash
SqlUtil::AbstractTable::selectRows
*list< auto > selectRows(*hash< auto > sh, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
SqlUtil::AbstractTable::getTriggers
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
SqlUtil::AbstractTable::getStatement
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
SqlUtil::AbstractTable::foreignConstraints
ForeignConstraints foreignConstraints
foreign constraints description
Definition AbstractTable.qc.dox.h:305
SqlUtil::AbstractTable::clearImpl
clearImpl()
clears any driver-specific table information
SqlUtil::AbstractTable::SelectOptions
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition AbstractTable.qc.dox.h:79
SqlUtil::AbstractTable::getColumnOperatorMapImpl
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
SqlUtil::AbstractTable::upsert
int upsert(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
SqlUtil::AbstractTable::findUniqueConstraintUnlocked
*AbstractUniqueConstraint findUniqueConstraintUnlocked(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
SqlUtil::AbstractTable::del
int del(hash< auto > cond, hash< auto > opt)
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::setDatasource
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
SqlUtil::AbstractTable::getRowIterator
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
SqlUtil::AbstractTable::cache
cache(*hash< auto > opts)
reads in all attributes of the table from the database
SqlUtil::AbstractTable::truncateCommit
truncateCommit()
truncates all the table data; releases the transaction lock after executing
SqlUtil::AbstractTable::updateNoCommit
deprecated int updateNoCommit(hash< auto > set, *hash< auto > cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
SqlUtil::AbstractTable::insertFromIteratorCommit
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
SqlUtil::AbstractTable::del
int del(hash< auto > cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
SqlUtil::AbstractTable::ConstraintOptions
const ConstraintOptions
default constraint options
Definition AbstractTable.qc.dox.h:56
SqlUtil::AbstractTable::selectRowsWithInfo
hash< SqlResultInfo > selectRowsWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a list of hashes representing the rows in the table that...
SqlUtil::AbstractTable::getUpdateOperatorMap
hash< auto > getUpdateOperatorMap()
returns the update operator map for this object
SqlUtil::AbstractTable::getIndexOptions
hash< auto > getIndexOptions()
returns the index options for this driver
SqlUtil::AbstractTable::createCommit
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table
SqlUtil::AbstractTable::getCreateForeignConstraintsSql
*list< auto > getCreateForeignConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create foreign constraints on the table or nothin...
SqlUtil::AbstractTable::upsertFromSelect
deprecated *hash< string, int > upsertFromSelect(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelect() variant
SqlUtil::AbstractTable::getBaseType
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
SqlUtil::AbstractTable::updateWithInfo
hash< SqlResultInfo > updateWithInfo(hash< auto > set, hash< auto > cond, *hash< auto > opt)
updates rows in the table matching an optional condition and returns an info hash with the count of r...
SqlUtil::AbstractTable::getStatementNoExecWithInfo
hash< SqlResultInfo > getStatementNoExecWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
SqlUtil::AbstractTable::TableDescriptionHashOptions
const TableDescriptionHashOptions
Table description options.
Definition AbstractTable.qc.dox.h:117
SqlUtil::AbstractTable::getTableColumnDescOptions
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
SqlUtil::AbstractTable::update
int update(hash< auto > set)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::update
int update(hash< auto > set, hash< auto > cond, hash< auto > opt)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::clear
clear()
purges the current table definition
SqlUtil::AbstractTable::getStatementWithInfo
hash< SqlResultInfo > getStatementWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
SqlUtil::AbstractTable::UpsertResultDescriptionMap
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition AbstractTable.qc.dox.h:288
SqlUtil::AbstractTable::doSelectOrderByWithOffsetSqlInternImpl
abstract doSelectOrderByWithOffsetSqlInternImpl(reference< hash< QueryInfo > > info, reference< string > sql, list< auto > coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractTable::insertNoCommit
deprecated *hash< auto > insertNoCommit(hash< auto > row, hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
SqlUtil::AbstractTable::getConstraintOptions
hash< auto > getConstraintOptions()
returns the constraint options for this driver
SqlUtil::AbstractTable::getAddPrimaryKeySql
string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash< auto > opt)
returns the SQL that can be used to add a primary key to the table
SqlUtil::AbstractTable::upsertFromIterator
*hash< string, int > upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; the t...
SqlUtil::AbstractTable::getAlignTableOptions
hash< auto > getAlignTableOptions()
returns the align table options for this driver
SqlUtil::AbstractTable::getConstraints
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
SqlUtil::AbstractTable::hasArrayBind
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
SqlUtil::AbstractTable::validateColumnOptions
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
SqlUtil::AbstractTable::truncateNoCommit
deprecated truncateNoCommit()
A legacy warpper for truncate()
SqlUtil::AbstractTable::commit
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::checkExistence
bool checkExistence()
returns True if the table exists in the database, False if not
SqlUtil::AbstractTable::getDropSql
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::getSelectSql
string getSelectSql(*hash< auto > sh, *reference< list< auto > > args)
returns the SQL string to be executed corresponding to the argument hash with an output parameter for...
SqlUtil::AbstractTable::getSubtableFromString
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
SqlUtil::AbstractTable::TableCreationOptions
const TableCreationOptions
table creation options
Definition AbstractTable.qc.dox.h:90
SqlUtil::AbstractTable::delCommit
int delCommit(hash< auto > cond, reference< string > sql)
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
SqlUtil::AbstractTable::triggers
Triggers triggers
trigger descriptions
Definition AbstractTable.qc.dox.h:309
SqlUtil::AbstractTable::renameColumn
AbstractColumn renameColumn(string old_name, string new_name, reference< string > sql)
renames an existing column; if the table is already known to be in the database, then the changes are...
SqlUtil::AbstractTable::getSavepointHelperImpl
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash< auto > set)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractTable::getColumnDataType
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
SqlUtil::AbstractTable::getInsertOperatorMap
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
SqlUtil::AbstractTable::primaryKey
AbstractPrimaryKey primaryKey
primary key description
Definition AbstractTable.qc.dox.h:301
SqlUtil::AbstractTable::inDb
bool inDb()
returns True if the table has been read from or created in the database, False if not
SqlUtil::AbstractTable::getRowIterator
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::dropIndex
AbstractIndex dropIndex(string iname, *reference< string > sql)
drops the given index from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::addForeignConstraint
AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash< auto > opt, *reference< string > sql)
adds a foreign constraint to the table; if the table is already known to be in the database,...
SqlUtil::AbstractTable::selectWithInfo
hash< SqlResultInfo > selectWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a hash of lists representing the columns and rows in the...
SqlUtil::AbstractTable::addPrimaryKey
AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a primary key to the table; if the table is already known to be in the database,...
SqlUtil::AbstractTable::getIndexesImpl
abstract Indexes getIndexesImpl()
Always called with the lock held.
SqlUtil::AbstractTable::getTypeMapImpl
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
SqlUtil::AbstractTable::beginTransaction
beginTransaction()
begins a transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::supportsTablespacesImpl
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
SqlUtil::AbstractTable::getColumnOperatorMap
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
SqlUtil::AbstractTable::rollback
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::getTruncateSql
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
SqlUtil::AbstractTable::getSqlFromList
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
SqlUtil::AbstractTable::getRenameColumnSql
string getRenameColumnSql(string old_name, string new_name, *hash< auto > opt)
gets an SQL string that can be used to rename an existing column in the table
SqlUtil::AbstractTable::addCheckConstraint
AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash< auto > opt, *reference< string > sql)
adds a check constraint to the table; if the table is already known to be in the database,...
SqlUtil::AbstractTable::getForeignConstraints
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
SqlUtil::AbstractTable::getSqlValue
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
SqlUtil::AbstractTable::TriggerOptions
const TriggerOptions
default trigger options
Definition AbstractTable.qc.dox.h:73
SqlUtil::AbstractTable::AlignTableOptions
const AlignTableOptions
table alignment options
Definition AbstractTable.qc.dox.h:102
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::getBulkUpsertClosure
code getBulkUpsertClosure(hash< auto > example_row, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing either a single row or a se...
SqlUtil::AbstractTable::tryExecRaw
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
SqlUtil::AbstractTable::findUniqueConstraint
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
SqlUtil::AbstractTable::getCreateSqlString
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table
SqlUtil::AbstractTable::del
int del()
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::UpsertResultMap
const UpsertResultMap
hash mapping upsert results to a description
Definition AbstractTable.qc.dox.h:282
SqlUtil::AbstractTable::getSavepointHelper
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
SqlUtil::AbstractTable::getSqlDataCallbackOptions
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
SqlUtil::AbstractTable::truncate
truncate()
truncates all the table data without any transaction management
SqlUtil::AbstractTable::dropTrigger
AbstractTrigger dropTrigger(string tname, *reference< string > sql)
drops the given trigger from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::getDbType
AbstractDataProviderType getDbType(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
SqlUtil::AbstractTable::getDropConstraintIfExistsSql
*string getDropConstraintIfExistsSql(string cname, *hash< auto > opt, *reference< AbstractConstraint > cref)
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns not...
SqlUtil::AbstractTable::getAlignSqlString
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
SqlUtil::AbstractTable::addTrigger
AbstractTrigger addTrigger(string tname, string src, *hash< auto > opt, *reference lsql)
adds a trigger to the table; if the table is already known to be in the database, then it is added in...
SqlUtil::AbstractTable::findAll
*list< auto > findAll(*hash< auto > cond)
finds all rows in the table with the given column values; a list of hashes is returned representing t...
SqlUtil::AbstractTable::getRowIteratorNoExec
Qore::SQL::SQLStatement getRowIteratorNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
SqlUtil::AbstractTable::manual
bool manual
manual edits
Definition AbstractTable.qc.dox.h:315
SqlUtil::AbstractTable::find
*list find(list< auto > ids)
finds rows in the table with the given primary key values; if no row matches any primary key value pa...
SqlUtil::AbstractTable::upsertFromSelectNoCommit
deprecated *hash< string, int > upsertFromSelectNoCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
SqlUtil::AbstractTable::getForeignConstraintOptions
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
SqlUtil::AbstractTable::ForeignConstraintOptions
const ForeignConstraintOptions
default foreign constraint options
Definition AbstractTable.qc.dox.h:67
SqlUtil::AbstractTable::AdditionalColumnDescOptions
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition AbstractTable.qc.dox.h:140
SqlUtil::AbstractTable::InsertFromIteratorOptions
const InsertFromIteratorOptions
default insert option keys
Definition AbstractTable.qc.dox.h:182
SqlUtil::AbstractTable::getAddForeignConstraintSql
string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash< auto > opt)
returns an SQL string that can be used to add a foreign constraint to the table
SqlUtil::AbstractTable::empty
bool empty()
returns True if the table has no definitions, False if not
SqlUtil::AbstractTable::delNoCommit
deprecated int delNoCommit(*hash< auto > cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
SqlUtil::AbstractTable::getUniqueConstraintIterator
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any)
SqlUtil::AbstractTable::getExpressionMap
hash< auto > getExpressionMap()
Returns the expression map for this database server.
SqlUtil::AbstractTable::select
*hash< auto > select(*hash< auto > sh, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
SqlUtil::AbstractTable::indexes
Indexes indexes
index descriptions
Definition AbstractTable.qc.dox.h:303
SqlUtil::AbstractTable::getCreateIndexesSql
*list< auto > getCreateIndexesSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create indexes on the table or nothing if there a...
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::insertFromSelectWithInfo
hash< SqlResultInfo > insertFromSelectWithInfo(list< auto > cols, AbstractTable source, hash< auto > select_hash, *hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
SqlUtil::AbstractTable::getWhereOperatorMap
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
SqlUtil::AbstractTable::tryInsertImpl
abstract bool tryInsertImpl(string sql, hash< auto > row)
tries to insert a row, if there is a duplicate key, then it returns False, if successful,...
SqlUtil::AbstractTable::create
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
SqlUtil::AbstractTable::selectRow
*hash< auto > selectRow(*hash< auto > sh, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash; if more than one row...
SqlUtil::AbstractTable::getModifyColumnSql
list< auto > getModifyColumnSql(string cname, hash< auto > copt, bool nullable=True, *hash< auto > opt)
gets a list of SQL strings that can be used to modify an existing column in the table
SqlUtil::AbstractTrigger
the base class for triggers
Definition SqlUtil.qm.dox.h:6295
SqlUtil::AbstractUniqueConstraint
represents a unique column constraint
Definition SqlUtil.qm.dox.h:6003
SqlUtil::Columns
column container class that throws an exception if an unknown column is accessed
Definition SqlUtil.qm.dox.h:5420
SqlUtil::Constraints
constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:5768
SqlUtil::ForeignConstraints
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition SqlUtil.qm.dox.h:6023
SqlUtil::Indexes
index container class that throws an exception if an unknown index is accessed
Definition SqlUtil.qm.dox.h:5634
SqlUtil::Table
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition Table.qc.dox.h:44
SqlUtil::Tables
the table container class stores a collection of tables in a schema
Definition SqlUtil.qm.dox.h:5232
SqlUtil::Triggers
trigger container class that throws an exception if an unknown trigger is accessed
Definition SqlUtil.qm.dox.h:6313
SqlUtil::AbstractTable::UpsertUpdateFirst
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition AbstractTable.qc.dox.h:214
SqlUtil::AbstractTable::UpsertStrategyMap
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition AbstractTable.qc.dox.h:249
SqlUtil::AbstractTable::UpsertInsertOnly
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition AbstractTable.qc.dox.h:237
SqlUtil::AbstractTable::UpsertInsertFirst
const UpsertInsertFirst
Definition AbstractTable.qc.dox.h:206
SqlUtil::AbstractTable::UpsertUpdateOnly
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition AbstractTable.qc.dox.h:244
SqlUtil::AbstractTable::UpsertAuto
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition AbstractTable.qc.dox.h:230
SqlUtil::AbstractTable::UpsertStrategyDescriptionMap
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition AbstractTable.qc.dox.h:255
SqlUtil::AbstractTable::UpsertSelectFirst
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition AbstractTable.qc.dox.h:223
SqlUtil::AbstractTable::UR_Updated
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition AbstractTable.qc.dox.h:270
SqlUtil::AbstractTable::UR_Verified
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition AbstractTable.qc.dox.h:267
SqlUtil::AbstractTable::UR_Deleted
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition AbstractTable.qc.dox.h:276
SqlUtil::AbstractTable::UR_Inserted
const UR_Inserted
Definition AbstractTable.qc.dox.h:264
SqlUtil::AbstractTable::UR_Unchanged
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition AbstractTable.qc.dox.h:273
SqlUtil
Qore AbstractDatabase class definition.
Definition AbstractDatabase.qc.dox.h:26