FreetdsSqlUtil.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
// @file FreetdsSqlUtil.qm Qore user module for working with PostgreSQL SQL data
/* FreetdsSqlUtil.qm Copyright (C) 2015 - 2017 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// minimum qore version
// requires the SqlUtil module
// don't use "$" signs for variables and class members, assume local variable scope
// require type definitions everywhere
// enable all warnings
// version history is included below in the docs
namespace FreetdsSqlUtil {
FreetdsTable get_table(AbstractDatasource nds, string nname, *hash opts);
FreetdsDatabase get_database(AbstractDatasource nds, *hash opts);
parse_schema_name(string nname, reference<string> schema, reference<string> name);
class FreetdsIndex : public SqlUtil::AbstractIndex {
public:
public :
*string filegroup;
public:
constructor(string n_name, bool n_unique, hash n_cols, *string n_filegroup) ;
string getCreateSql(string table_name, *hash opt);
private:
bool equalImpl(AbstractIndex ix);
public:
string getRenameSql(string table_name, string new_name);
};
class FreetdsForeignConstraint : public SqlUtil::AbstractForeignConstraint {
public:
constructor(string n, Columns c, ForeignConstraintTarget t) ;
string getCreateSql(string table_name, *hash opt);
softlist getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opt);
};
class FreetdsCheckConstraint : public SqlUtil::AbstractCheckConstraint {
public:
constructor(string n, string n_src) ;
string getCreateSql(string table_name, *hash opt);
list getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opt);
};
class FreetdsColumn : public SqlUtil::AbstractColumn {
public:
public :
int byte_size;
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs) ;
string getNativeTypeString();
softlist getAddColumnSql(AbstractTable t);
list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
string getRenameSql(AbstractTable t, string new_name);
private:
bool equalImpl(AbstractColumn c);
public:
};
class FreetdsNumericColumn : public FreetdsColumn,public SqlUtil::NumericColumnInfo {
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint n_scale) ;
string getNativeTypeString();
};
class FreetdsUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
public:
private :
*string filegroup;
public:
constructor(*string ts);
*string getTablespace();
setTablespace(*string ts);
bool setIndexBase(string ix);
clearIndex();
getIndexSql(reference<string> sql, string name, *hash opts);
abstract AbstractIterator keyIterator();
};
class FreetdsUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public FreetdsUniqueConstraintCommon {
public:
private :
bool enabled;
public:
constructor(string n, hash n_cols, bool e = True, *string ts) ;
FreetdsColumn memberGate(string k);
string getCreateSql(string table_name, *hash opts);
list getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opts);
bool isEnabled();
};
class FreetdsPrimaryKey : public SqlUtil::AbstractPrimaryKey,public FreetdsUniqueConstraintCommon {
public:
constructor();
constructor(string n, *hash c, *string ts) ;
FreetdsColumn memberGate(string k);
string getCreateSql(string table_name, *hash opts);
softlist getRenameSql(string table_name, string new_name);
};
class FreetdsSequence : public SqlUtil::AbstractSequence {
public:
constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
string getCreateSql(*hash opt);
softlist getRenameSql(string new_name, *hash opt);
};
class FreetdsView : public SqlUtil::AbstractView {
public:
constructor(string n_name, string n_src, *string n_schemaname) ;
string getCreateSql(*hash opt);
softlist getRenameSql(string new_name, *hash opt);
};
class FreetdsTrigger : public SqlUtil::AbstractTrigger {
public:
constructor(string n, string n_src) ;
softlist getCreateSql(string table_name, *hash opt);
softlist getDropSql(string table_name);
private:
bool equalImpl(AbstractFunctionBase t);
public:
softlist getRenameSql(string table_name, string new_name);
};
class FreetdsFunction : public SqlUtil::AbstractFunction {
public:
public :
*string args;
public:
constructor(string n, string n_src, *string a) ;
softlist getCreateSql(*hash opt);
string getDropSql(*hash opt);
private:
bool equalImpl(AbstractFunctionBase t);
public:
softlist getRenameSql(string new_name, *hash opt);
setName(string new_name);
};
class FreetdsDatabase : public SqlUtil::AbstractDatabase {
public:
public :
bool is_sybase;
const FreetdsSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions;
const FreeTDS_TempSavepoint = "qore_freetds_tmp_savepoint";
const FreetdsReclaimSpaceOptions = ReclaimSpaceOptions;
const FreetdsReservedWords = (
"add": True,
"all": True,
"alter": True,
"and": True,
"any": True,
"as": True,
"asc": True,
"authorization": True,
"backup": True,
"begin": True,
"between": True,
"break": True,
"browse": True,
"bulk": True,
"by": True,
"cascade": True,
"case": True,
"check": True,
"checkpoint": True,
"close": True,
"clustered": True,
"coalesce": True,
"collate": True,
"column": True,
"commit": True,
"compute": True,
"constraint": True,
"contains": True,
"containstable": True,
"continue": True,
"convert": True,
"create": True,
"cross": True,
"current": True,
"current_date": True,
"current_time": True,
"current_timestamp": True,
"current_user": True,
"cursor": True,
"database": True,
"dbcc": True,
"deallocate": True,
"declare": True,
"default": True,
"delete": True,
"deny": True,
"desc": True,
"disk": True,
"distinct": True,
"distributed": True,
"double": True,
"drop": True,
"dump": True,
"else": True,
"end": True,
"errlvl": True,
"escape": True,
"except": True,
"exec": True,
"execute": True,
"exists": True,
"exit": True,
"external": True,
"fetch": True,
"file": True,
"fillfactor": True,
"for": True,
"foreign": True,
"freetext": True,
"freetexttable": True,
"from": True,
"full": True,
"function": True,
"goto": True,
"grant": True,
"group": True,
"having": True,
"holdlock": True,
"identity": True,
"identity_insert": True,
"identitycol": True,
"if": True,
"in": True,
"index": True,
"inner": True,
"insert": True,
"intersect": True,
"into": True,
"is": True,
"join": True,
"key": True,
"kill": True,
"left": True,
"like": True,
"lineno": True,
"load": True,
"merge": True,
"national": True,
"nocheck": True,
"nonclustered": True,
"not": True,
"null": True,
"nullif": True,
"of": True,
"off": True,
"offsets": True,
"on": True,
"open": True,
"opendatasource": True,
"openquery": True,
"openrowset": True,
"openxml": True,
"option": True,
"or": True,
"order": True,
"outer": True,
"over": True,
"percent": True,
"pivot": True,
"plan": True,
"precision": True,
"primary": True,
"print": True,
"proc": True,
"procedure": True,
"public": True,
"raiserror": True,
"read": True,
"readtext": True,
"reconfigure": True,
"references": True,
"replication": True,
"restore": True,
"restrict": True,
"return": True,
"revert": True,
"revoke": True,
"right": True,
"rollback": True,
"rowcount": True,
"rowguidcol": True,
"rule": True,
"save": True,
"schema": True,
"securityaudit": True,
"select": True,
"semantickeyphrasetable": True,
"semanticsimilaritydetailstable": True,
"semanticsimilaritytable": True,
"session_user": True,
"set": True,
"setuser": True,
"shutdown": True,
"some": True,
"statistics": True,
"system_user": True,
"table": True,
"tablesample": True,
"textsize": True,
"then": True,
"to": True,
"top": True,
"tran": True,
"transaction": True,
"trigger": True,
"truncate": True,
"try_convert": True,
"tsequal": True,
"union": True,
"unique": True,
"unpivot": True,
"update": True,
"updatetext": True,
"use": True,
"user": True,
"values": True,
"varying": True,
"view": True,
"waitfor": True,
"when": True,
"where": True,
"while": True,
"with": True,
"within group": True,
"writetext": True,
);
public:
constructor(AbstractDatasource nds, *hash opts) ;
private:
list featuresImpl();
public:
private:
FreetdsSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
public:
private:
*AbstractSequence getSequenceImpl(string name);
public:
private:
*AbstractView getViewImpl(string name);
public:
private:
FreetdsFunction makeFunctionImpl(string name, string src, *hash opts);
public:
private:
FreetdsFunction makeProcedureImpl(string name, string src, *hash opts);
public:
private:
*AbstractFunction getFunctionImpl(string name);
public:
private:
AbstractFunction getProcedureImpl(string name);
public:
private:
list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
public:
private:
list getAlignSqlImpl(hash schema_hash, *hash opt);
public:
private:
softlist listTablesImpl();
public:
private:
list listFunctionsImpl();
public:
private:
list listProceduresImpl();
public:
private:
list listSequencesImpl();
public:
private:
list listViewsImpl();
public:
private:
string getCreateSqlImpl(list l);
public:
static bool isSybase(AbstractDatasource ds);
static string getCreateSql(list l);
private:
hash getSchemaDescriptionOptions();
public:
private:
hash getReclaimSpaceOptions();
public:
private:
softint getNextSequenceValueImpl(string name);
public:
private:
softint getCurrentSequenceValueImpl(string name);
public:
private:
bool supportsSequencesImpl();
public:
private:
bool supportsTypesImpl();
public:
private:
bool supportsPackagesImpl();
public:
private:
bool rebuildIndexImpl(string name, *hash options);
public:
private:
computeStatisticsImpl(*hash options);
public:
private:
reclaimSpaceImpl(*hash options);
public:
private:
auto tryExecArgsImpl(string sql, *softlist args);
public:
private:
auto tryExecRawImpl(string sql, *softlist args);
public:
static auto tryExecArgs(AbstractDatasource ds, string sql, *softlist args);
static auto tryExecRaw(AbstractDatasource ds, string sql);
};
class FreetdsTable : public SqlUtil::AbstractTable {
public:
public :
bool is_sybase;
bool ss_has_merge = False;
const FreetdsTypeMap = (
"numeric": ("qore": Type::Number, "size": SZ_NUM,),
"decimal": ("qore": Type::Number, "size": SZ_NUM,),
"tinyint": ("qore": Type::Int,),
"smallint": ("qore": Type::Int,),
"int": ("qore": Type::Int,),
"bigint": ("qore": Type::Int,),
"double": ("qore": Type::Float,),
"float": ("qore": Type::Float,), // NOTE: optional precision
"real": ("qore": Type::Float,),
"money": ("qore": Type::Number,),
"smallmoney": ("qore": Type::Number,),
"datetime": ("qore": Type::Date,),
"smalldatetime": ("qore": Type::Date,),
"date": ("qore": Type::Date,),
"time": ("qore": Type::Date,),
// NOTE: "size_range" is different between MS SQL Server and Sybase SQL Anywhere Server
// MS SQL: range is (1, 8000) or special keyword "max" for varchar types
// Sybase: range is (1, 32767) and size is mandatory for character-length semantics
"char": ("qore": Type::String, "size": SZ_OPT),
"char varying": ("qore": Type::String, "size": SZ_OPT),
"character varying": ("qore": Type::String, "size": SZ_OPT),
"varchar": ("qore": Type::String, "size": SZ_OPT),
// The following uni* types are used in Sybase Adaptive Server
"unichar": ("qore": Type::String, "size": SZ_MAND,),
"univarchar": ("qore": Type::String, "size": SZ_MAND,),
"unitext": ("qore": Type::String,),
// NOTE: "size_range" is different between MS SQL Server and Sybase SQL Anywhere Server
// MS SQL: range is (1, 8000) or special keyword "max" for varbinary types
// Sybase: range is (1, 32767)
"binary": ("qore": Type::Binary, "size": SZ_OPT),
"binary varying": ("qore": Type::Binary, "size": SZ_OPT),
"varbinary": ("qore": Type::Binary, "size": SZ_OPT),
"varbinary(max)": ("qore": Type::Binary,),
// The following are used in Sybase, supported & deprecated in MS SQL
"text": ("qore": Type::String,), // domain, implemented as "long varchar"
"image": ("qore": Type::Binary,), // domain, implemented as "long binary"
// The following are Sybase specific
"long binary": ("qore": Type::Binary,),
"long varchar": ("qore": Type::String,),
);
const QoreTypeMap = (
"integer": "bigint",
"float": "float",
"number": "numeric",
"string": "varchar",
"date": "datetime",
"binary": "varbinary",
"bool": "tinyint",
SqlUtil::CHAR: "char",
SqlUtil::CLOB: "text",
);
const MsQoreTypeMap = QoreTypeMap + (
SqlUtil::BLOB: "varbinary(max)",
);
const SybaseQoreTypeMap = QoreTypeMap;
const FreetdsTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions;
const FreetdsColumnDescOptions = AbstractTable::ColumnDescOptions;
const FreetdsIndexOptions = AbstractTable::IndexOptions;
const FreetdsConstraintOptions = AbstractTable::ConstraintOptions + FreetdsIndexOptions;
const FreetdsTableCreationOptions = AbstractTable::TableCreationOptions + FreetdsConstraintOptions;
const FreetdsAlignTableOptions = AbstractTable::AlignTableOptions + FreetdsTableCreationOptions;
const FreetdsSelectOptions = AbstractTable::SelectOptions + (
"tablehint": "softstringlist",
);
const MsSqlServerTableHints = (
"fastfirstrow": True,
"holdlock": True,
"nolock": True,
"paglock": True,
"readcommitted": True,
"readpast": True,
"readuncommitted": True,
"repeatableread": True,
"rowlock": True,
"serializable": True,
"tablock": True,
"tablockx": True,
"updlock": True,
"xlock": True,
);
const FreetdsOpMap = DefaultOpMap + (
OP_SUBSTR: (
"code": string (object t, string cn, softlist arg, reference<list> args, *hash jch, bool join = False, *hash ch, *hash psch) {
args += arg[0]; // start
if (!exists arg[1]);
args += arg[1]; // count
args += arg[2]; // text
return sprintf("substring(%s,%v,%v) = %v", cn);
},
),
);
const FreetdsCopMap = (
COP_CAST: (
"code": string (string cve, list args) {
string name = QoreTypeMap{args[0]} ?? args[0];
hash desc = FreetdsTypeMap{name};
string sql = sprintf ("cast (%s as %s", cve, name);
switch (name);
sql += ")";
return sql;
},
),
COP_PREPEND: (
"arg": Type::String,
"sqlvalue": True,
"code": string (string cve, string arg) {
return sprintf("%s + %s", arg, cve);
},
),
COP_APPEND: (
"arg": Type::String,
"sqlvalue": True,
"code": string (string cve, string arg) {
return sprintf("%s + %s", cve, arg);
},
),
COP_SUBSTR: (
"code": string (string cve, list args) {
if (!exists args[1])
return sprintf("substring(%s,%d,32767)", cve, args[0]); // NOTE: length arg is required
return sprintf("substring(%s,%d,%d)", cve, args[0], args[1]);
},
),
COP_YEAR: (
"code": string (string arg1, auto arg) {
return sprintf("substring(convert(varchar, dt, 120), 1, 4)", arg1);
}
),
COP_YEAR_MONTH: (
"code": string (string arg1, auto arg) {
return sprintf("substring(convert(varchar, dt, 120), 1, 7)", arg1);
}
),
COP_YEAR_DAY: (
"code": string (string arg1, auto arg) {
return sprintf("substring(convert(varchar, dt, 120), 1, 10)", arg1);
}
),
COP_YEAR_HOUR: (
"code": string (string arg1, auto arg) {
return sprintf("substring(convert(varchar, dt, 120), 1, 13)", arg1);
}
),
COP_SEQ: (
"nocolumn": True,
"withalias": True,
"code": string (*string cve, hash arg, reference<hash> psch) {
string sql = sprintf("next value for %s", arg.seq);
if (arg.as);
return sql;
}
),
COP_SEQ_CURRVAL: (
"nocolumn": True,
"code": string (*string cve, hash arg) {
throw "SEQUENCE-ERROR", sprintf("cannot select the current value of sequence %y because this database does not support this operation", arg.seq);
}
),
COP_LENGTH: (
"code": string (string cve, auto arg) {
return sprintf("len(%s)", cve);
},
),
COP_TRUNC_DATE: (
"code": string sub(string arg1, auto arg) {
if (!FreetdsTruncDate.hasKey(arg));
string cmd = FreetdsTruncDate{arg};
return replace(cmd, "%s", arg1);
}
)
);
/* Impl. note here. There is shorter workaround for this, but it does not work with seconds
and with dates older than 1.1.1970. (minutes will overflow later too etc.).
So no usage for: dateadd(ss, datediff(ss, 0, %s), 0) for example
*/
const FreetdsTruncDate = (
DT_YEAR : "datetimefromparts(datepart(year, %s), 1, 1, 0, 0, 0, 0)",
DT_MONTH : "datetimefromparts(datepart(year, %s), datepart(month, %s), 1, 0, 0, 0, 0)",
DT_DAY : "datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), 0, 0, 0, 0)",
DT_HOUR : "datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), 0, 0, 0)",
DT_MINUTE : "datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), datepart(minute, %s), 0, 0)",
DT_SECOND : "datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), datepart(minute, %s), datepart(second, %s), 0)",
);
const FreetdsIopMap = DefaultIopMap + (
IOP_SEQ: (
"arg": Type::String,
"placeholder": "next value for %v",
),
);
const FreetdsUopMap = DefaultUopMap + (
COP_SEQ: (
"nocolumn": True,
"withalias": True,
"code": string (*string cve, string arg) {
return sprintf("next value for %s", arg);
}
),
COP_SEQ_CURRVAL: (
"nocolumn": True,
"code": string (*string cve, string arg) {
throw "SEQUENCE-ERROR", sprintf("cannot select the current value of sequence %y because this database does not support this operation", arg);
}
),
);
public:
private :
*string filegroup;
string schema;
Functions triggerFunctions;
public:
constructor(AbstractDatasource nds, string nname, *hash opts) ;
string getSchemaName();
*string getTablespaceName();
code getUpsertClosure(hash row, int upsert_strategy = UpsertAuto, *hash opt);
bool hasArrayBind();
string getSqlName();
private:
string getFromIntern(string from, *hash qh);
public:
private:
hash getTableCreationOptions();
public:
private:
hash getTableDescriptionHashOptions();
public:
private:
hash getColumnDescOptions();
public:
private:
hash getIndexOptions();
public:
private:
hash getConstraintOptions();
public:
private:
hash getAlignTableOptions();
public:
private:
hash getWhereOperatorMap();
public:
private:
hash getColumnOperatorMapImpl();
public:
private:
hash getInsertOperatorMap();
public:
private:
hash getRawUpdateOperatorMap();
public:
private:
hash getSelectOptions();
public:
private:
bool checkExistenceImpl();
public:
private:
Columns describeImpl();
public:
private:
Columns describeSybaseImpl();
public:
private:
Columns describeMssqlImpl();
public:
private:
FreetdsPrimaryKey getPrimaryKeyImpl();
public:
private:
FreetdsPrimaryKey getPrimaryKeySybaseImpl();
public:
private:
FreetdsPrimaryKey getPrimaryKeyMssqlImpl();
public:
private:
Indexes getIndexesImpl();
public:
private:
Indexes getIndexesSybaseImpl();
public:
private:
Indexes getIndexesMssqlImpl();
public:
private:
ForeignConstraints getForeignConstraintsImpl(*hash opts);
public:
private:
ForeignConstraints getForeignConstraintsSybaseImpl();
public:
private:
ForeignConstraints getForeignConstraintsMssqlImpl();
public:
private:
Constraints getConstraintsImpl();
public:
private:
Constraints getConstraintsSybaseImpl();
public:
private:
Constraints getConstraintsMssqlImpl();
public:
private:
Triggers getTriggersImpl();
public:
private:
string getCreateTableSqlImpl(*hash opt);
public:
private:
*list getCreateMiscSqlImpl(*hash opt, bool cache);
public:
private:
*list getAlignSqlImpl(AbstractTable table, *hash opt);
public:
private:
string getCreateSqlImpl(list l);
public:
private:
string getRenameSqlImpl(string new_name);
public:
private:
AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
public:
private:
AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
public:
private:
AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
public:
private:
AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
public:
private:
AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
public:
private:
AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
public:
private:
AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
public:
private:
bool tryInsertImpl(string sql, hash row);
public:
private:
hash getQoreTypeMapImpl();
public:
private:
hash getTypeMapImpl();
public:
private:
*string getSqlValueImpl(auto v);
public:
string getColumnSqlName(string col);
list getColumnSqlNames(softlist cols);
private:
bool emptyImpl();
public:
private:
clearImpl();
public:
private:
setupTableImpl(hash desc, *hash opt);
public:
private:
bool constraintsLinkedToIndexesImpl();
public:
private:
bool uniqueIndexCreatesConstraintImpl();
public:
private:
bool supportsTablespacesImpl();
public:
private:
doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list> args, *hash qh);
public:
private:
doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list> args, *hash qh, *hash jch, *hash ch, *hash psch, list coll);
public:
private:
auto tryExecArgsImpl(string sql, *softlist args);
public:
private:
auto tryExecRawImpl(string sql, *softlist args);
public:
private:
copyImpl(AbstractTable old);
public:
private:
*hash doReturningImpl(hash opt, reference<string> sql, list args);
public:
private:
softbool tryUpdate(string sql, hash row, Columns cols, list updc);
public:
};
};
Date
const Date
FreetdsSqlUtil::FreetdsIndex::getRenameSql
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
COP_SEQ
const COP_SEQ
UpsertAuto
const UpsertAuto
String
const String
DefaultIopMap
const DefaultIopMap
FreetdsSqlUtil::FreetdsTable::is_sybase
bool is_sybase
sybase flag
Definition: FreetdsSqlUtil.qm.dox.h:990
sprintf
string sprintf(string fmt,...)
FreetdsSqlUtil::FreetdsIndex::equalImpl
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
SqlUtil::AbstractTable
FreetdsSqlUtil::FreetdsNumericColumn
represents a FreeTDS-specific numeric column
Definition: FreetdsSqlUtil.qm.dox.h:312
FreetdsSqlUtil::FreetdsSequence
class for FreeTDS sequences
Definition: FreetdsSqlUtil.qm.dox.h:461
SqlUtil::AbstractIndex
FreetdsSqlUtil::FreetdsTable::schema
string schema
schema name for the table
Definition: FreetdsSqlUtil.qm.dox.h:1245
FreetdsSqlUtil::FreetdsColumn
represents a FreeTDS-specific column
Definition: FreetdsSqlUtil.qm.dox.h:244
FreetdsSqlUtil::FreetdsPrimaryKey
represents a FreeTDS-specific primary key constraint
Definition: FreetdsSqlUtil.qm.dox.h:417
COP_SEQ_CURRVAL
const COP_SEQ_CURRVAL
SqlUtil::NumericColumnInfo
True
const True
SZ_MAND
const SZ_MAND
SqlUtil::CHAR
const CHAR
FreetdsSqlUtil::FreetdsDatabase::is_sybase
bool is_sybase
sybase flag
Definition: FreetdsSqlUtil.qm.dox.h:577
FreetdsSqlUtil::FreetdsUniqueConstraintCommon
common base class for unique constraints
Definition: FreetdsSqlUtil.qm.dox.h:325
SqlUtil::AbstractSequence
number
number number(softnumber n)
COP_YEAR_HOUR
const COP_YEAR_HOUR
FreetdsSqlUtil::FreetdsColumn::byte_size
int byte_size
byte size of the column
Definition: FreetdsSqlUtil.qm.dox.h:249
FreetdsSqlUtil::FreetdsUniqueConstraint
class modeling a unique constraint
Definition: FreetdsSqlUtil.qm.dox.h:363
FreetdsSqlUtil::FreetdsIndex::filegroup
*string filegroup
the tablespace (filegroup) name of the index
Definition: FreetdsSqlUtil.qm.dox.h:179
FreetdsSqlUtil::FreetdsForeignConstraint
represents a FreeTDS-specific foreign constraint
Definition: FreetdsSqlUtil.qm.dox.h:204
SqlUtil::AbstractForeignConstraint
False
const False
SqlUtil::AbstractCheckConstraint
replace
string replace(string str, string source, string target, int start=0, int end=-1)
list
list list(...)
Float
const Float
DT_DAY
const DT_DAY
FreetdsSqlUtil
the FreetdsSqlUtil namespace contains all the objects in the FreetdsSqlUtil module ...
Definition: FreetdsSqlUtil.qm.dox.h:161
FreetdsSqlUtil::FreetdsIndex::constructor
constructor(string n_name, bool n_unique, hash n_cols, *string n_filegroup)
creates the object from the arguments
SZ_NUM
const SZ_NUM
FreetdsSqlUtil::FreetdsTable::triggerFunctions
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: FreetdsSqlUtil.qm.dox.h:1248
Binary
const Binary
exists
bool exists(...)
FreetdsSqlUtil::FreetdsDatabase
provides the FreeTDS-specific implementation of the AbstractDatabase interface
Definition: FreetdsSqlUtil.qm.dox.h:572
COP_YEAR_MONTH
const COP_YEAR_MONTH
COP_LENGTH
const COP_LENGTH
FreetdsSqlUtil::FreetdsIndex
represents a FreeTDS-specific index
Definition: FreetdsSqlUtil.qm.dox.h:174
SqlUtil::BLOB
const BLOB
SqlUtil::AbstractIndex::name
string name
SqlUtil::CLOB
const CLOB
FreetdsSqlUtil::FreetdsView
represents a FreeTDS view
Definition: FreetdsSqlUtil.qm.dox.h:482
FreetdsSqlUtil::FreetdsTable
provides the FreeTDS-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: FreetdsSqlUtil.qm.dox.h:985
FreetdsSqlUtil::FreetdsCheckConstraint
represents a FreeTDS-specific check constraint
Definition: FreetdsSqlUtil.qm.dox.h:224
SqlUtil::AbstractFunction
COP_PREPEND
const COP_PREPEND
FreetdsSqlUtil::FreetdsUniqueConstraint::enabled
bool enabled
True if the constraint is enabled, False if not
Definition: FreetdsSqlUtil.qm.dox.h:368
COP_TRUNC_DATE
const COP_TRUNC_DATE
SqlUtil::AbstractView
FreetdsSqlUtil::get_database
FreetdsDatabase get_database(AbstractDatasource nds, *hash opts)
returns a FreetdsDatabase object corresponding to the arguments
FreetdsSqlUtil::FreetdsUniqueConstraintCommon::filegroup
*string filegroup
any filegroup for the unique key index
Definition: FreetdsSqlUtil.qm.dox.h:330
Int
const Int
COP_YEAR
const COP_YEAR
string
string string(softstring str, *string enc)
SqlUtil::AbstractTrigger
FreetdsSqlUtil::FreetdsTrigger
represents a FreeTDS-specific trigger
Definition: FreetdsSqlUtil.qm.dox.h:503
SqlUtil::AbstractColumn
COP_CAST
const COP_CAST
DT_MINUTE
const DT_MINUTE
DT_HOUR
const DT_HOUR
DefaultUopMap
const DefaultUopMap
FreetdsSqlUtil::FreetdsFunction
represents a FreeTDS-specific function
Definition: FreetdsSqlUtil.qm.dox.h:531
COP_YEAR_DAY
const COP_YEAR_DAY
FreetdsSqlUtil::FreetdsIndex::getCreateSql
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
FreetdsSqlUtil::get_table
FreetdsTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a FreetdsTable object corresponding to the arguments
DT_MONTH
const DT_MONTH
hash
hash hash(object obj)
COP_SUBSTR
const COP_SUBSTR
OP_SUBSTR
const OP_SUBSTR
SZ_OPT
const SZ_OPT
IOP_SEQ
const IOP_SEQ
SqlUtil::AbstractDatabase
DT_YEAR
const DT_YEAR
SqlUtil::AbstractIndex::getDropSql
string getDropSql(string table_name)
SqlUtil::AbstractPrimaryKey
join
string join(string str,...)
Number
const Number
FreetdsSqlUtil::FreetdsTable::filegroup
*string filegroup
filegroup name for the table, if known
Definition: FreetdsSqlUtil.qm.dox.h:1242
DefaultOpMap
const DefaultOpMap
SqlUtil::AbstractUniqueConstraint
DT_SECOND
const DT_SECOND
COP_APPEND
const COP_APPEND