163 FreetdsTable
get_table(AbstractDatasource nds,
string nname, *
hash opts);
170 parse_schema_name(
string nname, reference<string> schema, reference<string> name);
184 constructor(
string n_name,
bool n_unique,
hash n_cols, *
string n_filegroup) ;
199 string getRenameSql(
string table_name,
string new_name);
208 constructor(
string n, Columns c, ForeignConstraintTarget t) ;
215 softlist
getRenameSql(
string table_name,
string new_name);
254 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs) ;
258 string getNativeTypeString();
269 softlist getAddColumnSql(AbstractTable t);
286 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *
hash opt);
316 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, softint n_scale) ;
320 string getNativeTypeString();
339 *
string getTablespace();
343 setTablespace(*
string ts);
347 bool setIndexBase(
string ix);
355 getIndexSql(reference<string> sql,
string name, *
hash opts);
359 abstract AbstractIterator keyIterator();
456 softlist
getRenameSql(
string table_name,
string new_name);
486 constructor(
string n_name,
string n_src, *
string n_schemaname) ;
526 softlist
getRenameSql(
string table_name,
string new_name);
567 setName(
string new_name);
580 const FreetdsSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions;
582 const FreeTDS_TempSavepoint =
"qore_freetds_tmp_savepoint";
585 const FreetdsReclaimSpaceOptions = ReclaimSpaceOptions;
588 const FreetdsReservedWords = (
596 "authorization":
True,
617 "containstable":
True,
623 "current_date":
True,
624 "current_time":
True,
625 "current_timestamp":
True,
626 "current_user":
True,
658 "freetexttable":
True,
668 "identity_insert":
True,
688 "nonclustered":
True,
697 "opendatasource":
True,
733 "securityaudit":
True,
735 "semantickeyphrasetable":
True,
736 "semanticsimilaritydetailstable":
True,
737 "semanticsimilaritytable":
True,
738 "session_user":
True,
772 "within group":
True,
795 *AbstractSequence getSequenceImpl(
string name);
801 *AbstractView getViewImpl(
string name);
819 *AbstractFunction getFunctionImpl(
string name);
825 AbstractFunction getProcedureImpl(
string name);
844 softlist listTablesImpl();
855 list listFunctionsImpl();
864 list listProceduresImpl();
870 list listSequencesImpl();
876 list listViewsImpl();
883 string getCreateSqlImpl(
list l);
888 static bool isSybase(AbstractDatasource ds);
896 hash getSchemaDescriptionOptions();
903 hash getReclaimSpaceOptions();
910 softint getNextSequenceValueImpl(
string name);
917 softint getCurrentSequenceValueImpl(
string name);
924 bool supportsSequencesImpl();
931 bool supportsTypesImpl();
938 bool supportsPackagesImpl();
945 bool rebuildIndexImpl(
string name, *
hash options);
952 computeStatisticsImpl(*
hash options);
959 reclaimSpaceImpl(*
hash options);
966 auto tryExecArgsImpl(
string sql, *softlist args);
973 auto tryExecRawImpl(
string sql, *softlist args);
978 static auto tryExecArgs(AbstractDatasource ds,
string sql, *softlist args);
981 static auto tryExecRaw(AbstractDatasource ds,
string sql);
996 const FreetdsTypeMap = (
1044 const QoreTypeMap = (
1045 "integer":
"bigint",
1047 "number":
"numeric",
1048 "string":
"varchar",
1050 "binary":
"varbinary",
1057 const MsQoreTypeMap = QoreTypeMap + (
1062 const SybaseQoreTypeMap = QoreTypeMap;
1065 const FreetdsTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions;
1067 const FreetdsColumnDescOptions = AbstractTable::ColumnDescOptions;
1069 const FreetdsIndexOptions = AbstractTable::IndexOptions;
1071 const FreetdsConstraintOptions = AbstractTable::ConstraintOptions + FreetdsIndexOptions;
1073 const FreetdsTableCreationOptions = AbstractTable::TableCreationOptions + FreetdsConstraintOptions;
1075 const FreetdsAlignTableOptions = AbstractTable::AlignTableOptions + FreetdsTableCreationOptions;
1078 const FreetdsSelectOptions = AbstractTable::SelectOptions + (
1079 "tablehint":
"softstringlist",
1083 const MsSqlServerTableHints = (
1084 "fastfirstrow":
True,
1088 "readcommitted":
True,
1090 "readuncommitted":
True,
1091 "repeatableread":
True,
1093 "serializable":
True,
1109 return sprintf(
"substring(%s,%v,%v) = %v", cn);
1115 const FreetdsCopMap = (
1118 string name = QoreTypeMap{args[0]} ?? args[0];
1119 hash desc = FreetdsTypeMap{name};
1120 string sql =
sprintf (
"cast (%s as %s", cve, name);
1130 "code":
string (
string cve,
string arg) {
1131 return sprintf(
"%s + %s", arg, cve);
1137 "code":
string (
string cve,
string arg) {
1138 return sprintf(
"%s + %s", cve, arg);
1142 "code":
string (
string cve,
list args) {
1144 return sprintf(
"substring(%s,%d,32767)", cve, args[0]);
1145 return sprintf(
"substring(%s,%d,%d)", cve, args[0], args[1]);
1149 "code":
string (
string arg1,
auto arg) {
1150 return sprintf(
"substring(convert(varchar, dt, 120), 1, 4)", arg1);
1154 "code":
string (
string arg1,
auto arg) {
1155 return sprintf(
"substring(convert(varchar, dt, 120), 1, 7)", arg1);
1159 "code":
string (
string arg1,
auto arg) {
1160 return sprintf(
"substring(convert(varchar, dt, 120), 1, 10)", arg1);
1164 "code":
string (
string arg1,
auto arg) {
1165 return sprintf(
"substring(convert(varchar, dt, 120), 1, 13)", arg1);
1171 "code":
string (*
string cve,
hash arg, reference<hash> psch) {
1172 string sql =
sprintf(
"next value for %s", arg.seq);
1180 "code":
string (*
string cve,
hash arg) {
1181 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support this operation", arg.seq);
1185 "code":
string (
string cve,
auto arg) {
1186 return sprintf(
"len(%s)", cve);
1190 "code":
string sub(
string arg1,
auto arg) {
1191 if (!FreetdsTruncDate.hasKey(arg));
1193 string cmd = FreetdsTruncDate{arg};
1194 return replace(cmd,
"%s", arg1);
1204 const FreetdsTruncDate = (
1205 DT_YEAR :
"datetimefromparts(datepart(year, %s), 1, 1, 0, 0, 0, 0)",
1206 DT_MONTH :
"datetimefromparts(datepart(year, %s), datepart(month, %s), 1, 0, 0, 0, 0)",
1207 DT_DAY :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), 0, 0, 0, 0)",
1208 DT_HOUR :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), 0, 0, 0)",
1209 DT_MINUTE :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), datepart(minute, %s), 0, 0)",
1210 DT_SECOND :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), datepart(minute, %s), datepart(second, %s), 0)",
1217 "placeholder":
"next value for %v",
1226 "code":
string (*
string cve,
string arg) {
1227 return sprintf(
"next value for %s", arg);
1232 "code":
string (*
string cve,
string arg) {
1233 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support this operation", arg);
1256 string getSchemaName();
1260 *
string getTablespaceName();
1268 bool hasArrayBind();
1272 string getSqlName();
1277 string getFromIntern(
string from, *
hash qh);
1283 hash getTableCreationOptions();
1289 hash getTableDescriptionHashOptions();
1295 hash getColumnDescOptions();
1301 hash getIndexOptions();
1307 hash getConstraintOptions();
1313 hash getAlignTableOptions();
1320 hash getWhereOperatorMap();
1327 hash getColumnOperatorMapImpl();
1334 hash getInsertOperatorMap();
1341 hash getRawUpdateOperatorMap();
1348 hash getSelectOptions();
1354 bool checkExistenceImpl();
1360 Columns describeImpl();
1366 Columns describeSybaseImpl();
1372 Columns describeMssqlImpl();
1396 Indexes getIndexesImpl();
1402 Indexes getIndexesSybaseImpl();
1408 Indexes getIndexesMssqlImpl();
1414 ForeignConstraints getForeignConstraintsImpl(*
hash opts);
1420 ForeignConstraints getForeignConstraintsSybaseImpl();
1426 ForeignConstraints getForeignConstraintsMssqlImpl();
1432 Constraints getConstraintsImpl();
1438 Constraints getConstraintsSybaseImpl();
1444 Constraints getConstraintsMssqlImpl();
1450 Triggers getTriggersImpl();
1457 string getCreateTableSqlImpl(*
hash opt);
1463 *
list getCreateMiscSqlImpl(*
hash opt,
bool cache);
1469 *
list getAlignSqlImpl(AbstractTable table, *
hash opt);
1476 string getCreateSqlImpl(
list l);
1482 string getRenameSqlImpl(
string new_name);
1488 AbstractColumn addColumnImpl(
string cname,
hash opt,
bool nullable =
True);
1494 AbstractPrimaryKey addPrimaryKeyImpl(
string cname,
hash ch, *
hash opt);
1500 AbstractIndex addIndexImpl(
string iname,
bool enabled,
hash ch, *
hash opt);
1506 AbstractForeignConstraint addForeignConstraintImpl(
string cname,
hash ch,
string table,
hash tch, *
hash opt);
1512 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *
hash opt);
1518 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname,
hash ch, *
hash opt);
1524 AbstractTrigger addTriggerImpl(
string tname,
string src, *
hash opt);
1530 bool tryInsertImpl(
string sql,
hash row);
1536 hash getQoreTypeMapImpl();
1542 hash getTypeMapImpl();
1549 *
string getSqlValueImpl(
auto v);
1554 string getColumnSqlName(
string col);
1558 list getColumnSqlNames(softlist cols);
1576 setupTableImpl(
hash desc, *
hash opt);
1583 bool constraintsLinkedToIndexesImpl();
1590 bool uniqueIndexCreatesConstraintImpl();
1597 bool supportsTablespacesImpl();
1604 doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list> args, *
hash qh);
1611 doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list> args, *
hash qh, *
hash jch, *
hash ch, *
hash psch,
list coll);
1618 auto tryExecArgsImpl(
string sql, *softlist args);
1625 auto tryExecRawImpl(
string sql, *softlist args);
1632 copyImpl(AbstractTable old);
1638 *
hash doReturningImpl(
hash opt, reference<string> sql,
list args);
1644 softbool tryUpdate(
string sql,
hash row, Columns cols,
list updc);
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
bool is_sybase
sybase flag
Definition: FreetdsSqlUtil.qm.dox.h:990
string sprintf(string fmt,...)
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
represents a FreeTDS-specific numeric column
Definition: FreetdsSqlUtil.qm.dox.h:312
class for FreeTDS sequences
Definition: FreetdsSqlUtil.qm.dox.h:461
string schema
schema name for the table
Definition: FreetdsSqlUtil.qm.dox.h:1245
represents a FreeTDS-specific column
Definition: FreetdsSqlUtil.qm.dox.h:244
represents a FreeTDS-specific primary key constraint
Definition: FreetdsSqlUtil.qm.dox.h:417
bool is_sybase
sybase flag
Definition: FreetdsSqlUtil.qm.dox.h:577
common base class for unique constraints
Definition: FreetdsSqlUtil.qm.dox.h:325
number number(softnumber n)
int byte_size
byte size of the column
Definition: FreetdsSqlUtil.qm.dox.h:249
class modeling a unique constraint
Definition: FreetdsSqlUtil.qm.dox.h:363
*string filegroup
the tablespace (filegroup) name of the index
Definition: FreetdsSqlUtil.qm.dox.h:179
represents a FreeTDS-specific foreign constraint
Definition: FreetdsSqlUtil.qm.dox.h:204
string replace(string str, string source, string target, int start=0, int end=-1)
the FreetdsSqlUtil namespace contains all the objects in the FreetdsSqlUtil module ...
Definition: FreetdsSqlUtil.qm.dox.h:161
constructor(string n_name, bool n_unique, hash n_cols, *string n_filegroup)
creates the object from the arguments
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: FreetdsSqlUtil.qm.dox.h:1248
provides the FreeTDS-specific implementation of the AbstractDatabase interface
Definition: FreetdsSqlUtil.qm.dox.h:572
represents a FreeTDS-specific index
Definition: FreetdsSqlUtil.qm.dox.h:174
represents a FreeTDS view
Definition: FreetdsSqlUtil.qm.dox.h:482
provides the FreeTDS-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: FreetdsSqlUtil.qm.dox.h:985
represents a FreeTDS-specific check constraint
Definition: FreetdsSqlUtil.qm.dox.h:224
bool enabled
True if the constraint is enabled, False if not
Definition: FreetdsSqlUtil.qm.dox.h:368
FreetdsDatabase get_database(AbstractDatasource nds, *hash opts)
returns a FreetdsDatabase object corresponding to the arguments
*string filegroup
any filegroup for the unique key index
Definition: FreetdsSqlUtil.qm.dox.h:330
string string(softstring str, *string enc)
represents a FreeTDS-specific trigger
Definition: FreetdsSqlUtil.qm.dox.h:503
represents a FreeTDS-specific function
Definition: FreetdsSqlUtil.qm.dox.h:531
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
FreetdsTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a FreetdsTable object corresponding to the arguments
string getDropSql(string table_name)
string join(string str,...)
*string filegroup
filegroup name for the table, if known
Definition: FreetdsSqlUtil.qm.dox.h:1242