160 FreetdsTable
get_table(AbstractDatasource nds,
string nname, *
hash opts);
167 parse_schema_name(
string nname, reference<string> schema, reference<string> name);
181 constructor(
string n_name,
bool n_unique,
hash n_cols, *
string n_filegroup) ;
196 string getRenameSql(
string table_name,
string new_name);
205 constructor(
string n, Columns c, ForeignConstraintTarget t) ;
212 softlist
getRenameSql(
string table_name,
string new_name);
251 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs) ;
255 string getNativeTypeString();
266 softlist getAddColumnSql(AbstractTable t);
283 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *
hash opt);
313 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, softint n_scale) ;
317 string getNativeTypeString();
336 *
string getTablespace();
340 setTablespace(*
string ts);
344 bool setIndexBase(
string ix);
352 getIndexSql(reference<string> sql,
string name, *
hash opts);
356 abstract AbstractIterator keyIterator();
453 softlist
getRenameSql(
string table_name,
string new_name);
483 constructor(
string n_name,
string n_src, *
string n_schemaname) ;
523 softlist
getRenameSql(
string table_name,
string new_name);
564 setName(
string new_name);
577 const FreetdsSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions;
579 const FreeTDS_TempSavepoint =
"qore_freetds_tmp_savepoint";
582 const FreetdsReclaimSpaceOptions = ReclaimSpaceOptions;
585 const FreetdsReservedWords = (
593 "authorization":
True,
614 "containstable":
True,
620 "current_date":
True,
621 "current_time":
True,
622 "current_timestamp":
True,
623 "current_user":
True,
655 "freetexttable":
True,
665 "identity_insert":
True,
685 "nonclustered":
True,
694 "opendatasource":
True,
730 "securityaudit":
True,
732 "semantickeyphrasetable":
True,
733 "semanticsimilaritydetailstable":
True,
734 "semanticsimilaritytable":
True,
735 "session_user":
True,
769 "within group":
True,
792 *AbstractSequence getSequenceImpl(
string name);
798 *AbstractView getViewImpl(
string name);
816 *AbstractFunction getFunctionImpl(
string name);
822 AbstractFunction getProcedureImpl(
string name);
841 softlist listTablesImpl();
852 list listFunctionsImpl();
861 list listProceduresImpl();
867 list listSequencesImpl();
873 list listViewsImpl();
880 string getCreateSqlImpl(
list l);
885 static bool isSybase(AbstractDatasource ds);
893 hash getSchemaDescriptionOptions();
900 hash getReclaimSpaceOptions();
907 softint getNextSequenceValueImpl(
string name);
914 softint getCurrentSequenceValueImpl(
string name);
921 bool supportsSequencesImpl();
928 bool supportsTypesImpl();
935 bool supportsPackagesImpl();
942 bool rebuildIndexImpl(
string name, *
hash options);
949 computeStatisticsImpl(*
hash options);
956 reclaimSpaceImpl(*
hash options);
963 auto tryExecArgsImpl(
string sql, *softlist args);
970 auto tryExecRawImpl(
string sql, *softlist args);
975 static auto tryExecArgs(AbstractDatasource ds,
string sql, *softlist args);
978 static auto tryExecRaw(AbstractDatasource ds,
string sql);
993 const FreetdsTypeMap = (
1041 const QoreTypeMap = (
1042 "integer":
"bigint",
1044 "number":
"numeric",
1045 "string":
"varchar",
1047 "binary":
"varbinary",
1054 const MsQoreTypeMap = QoreTypeMap + (
1059 const SybaseQoreTypeMap = QoreTypeMap;
1062 const FreetdsTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions;
1064 const FreetdsColumnDescOptions = AbstractTable::ColumnDescOptions;
1066 const FreetdsIndexOptions = AbstractTable::IndexOptions;
1068 const FreetdsConstraintOptions = AbstractTable::ConstraintOptions + FreetdsIndexOptions;
1070 const FreetdsTableCreationOptions = AbstractTable::TableCreationOptions + FreetdsConstraintOptions;
1072 const FreetdsAlignTableOptions = AbstractTable::AlignTableOptions + FreetdsTableCreationOptions;
1075 const FreetdsSelectOptions = AbstractTable::SelectOptions + (
1076 "tablehint":
"softstringlist",
1080 const MsSqlServerTableHints = (
1081 "fastfirstrow":
True,
1085 "readcommitted":
True,
1087 "readuncommitted":
True,
1088 "repeatableread":
True,
1090 "serializable":
True,
1106 return sprintf(
"substring(%s,%v,%v) = %v", cn);
1115 string name = QoreTypeMap{args[0]} ?? args[0];
1116 hash desc = FreetdsTypeMap{name};
1117 string sql =
sprintf (
"cast (%s as %s", cve, name);
1127 "code":
string (
string cve,
string arg) {
1128 return sprintf(
"%s + %s", arg, cve);
1134 "code":
string (
string cve,
string arg) {
1135 return sprintf(
"%s + %s", cve, arg);
1139 "code":
string (
string cve,
list args) {
1141 return sprintf(
"substring(%s,%d,32767)", cve, args[0]);
1142 return sprintf(
"substring(%s,%d,%d)", cve, args[0], args[1]);
1146 "code":
string (
string arg1,
auto arg) {
1147 return sprintf(
"substring(convert(varchar, dt, 120), 1, 4)", arg1);
1151 "code":
string (
string arg1,
auto arg) {
1152 return sprintf(
"substring(convert(varchar, dt, 120), 1, 7)", arg1);
1156 "code":
string (
string arg1,
auto arg) {
1157 return sprintf(
"substring(convert(varchar, dt, 120), 1, 10)", arg1);
1161 "code":
string (
string arg1,
auto arg) {
1162 return sprintf(
"substring(convert(varchar, dt, 120), 1, 13)", arg1);
1168 "code":
string (*
string cve,
hash arg, reference<hash> psch) {
1169 string sql =
sprintf(
"next value for %s", arg.seq);
1177 "code":
string (*
string cve,
hash arg) {
1178 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support this operation", arg.seq);
1182 "code":
string (
string cve,
auto arg) {
1183 return sprintf(
"len(%s)", cve);
1187 "code":
string sub(
string arg1,
auto arg) {
1188 if (!FreetdsTruncDate.hasKey(arg));
1190 string cmd = FreetdsTruncDate{arg};
1191 return replace(cmd,
"%s", arg1);
1201 const FreetdsTruncDate = (
1202 DT_YEAR :
"datetimefromparts(datepart(year, %s), 1, 1, 0, 0, 0, 0)",
1203 DT_MONTH :
"datetimefromparts(datepart(year, %s), datepart(month, %s), 1, 0, 0, 0, 0)",
1204 DT_DAY :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), 0, 0, 0, 0)",
1205 DT_HOUR :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), 0, 0, 0)",
1206 DT_MINUTE :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), datepart(minute, %s), 0, 0)",
1207 DT_SECOND :
"datetimefromparts(datepart(year, %s), datepart(month, %s), datepart(day, %s), datepart(hour, %s), datepart(minute, %s), datepart(second, %s), 0)",
1214 "placeholder":
"next value for %v",
1223 "code":
string (*
string cve,
string arg) {
1224 return sprintf(
"next value for %s", arg);
1229 "code":
string (*
string cve,
string arg) {
1230 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support this operation", arg);
1253 string getSchemaName();
1257 *
string getTablespaceName();
1265 bool hasArrayBind();
1269 string getSqlName();
1274 string getFromIntern(
string from, *
hash qh);
1280 hash getTableCreationOptions();
1286 hash getTableDescriptionHashOptions();
1292 hash getColumnDescOptions();
1298 hash getIndexOptions();
1304 hash getConstraintOptions();
1310 hash getAlignTableOptions();
1317 hash getWhereOperatorMap();
1324 hash getColumnOperatorMap();
1331 hash getInsertOperatorMap();
1338 hash getRawUpdateOperatorMap();
1345 hash getSelectOptions();
1351 bool checkExistenceImpl();
1357 Columns describeImpl();
1363 Columns describeSybaseImpl();
1369 Columns describeMssqlImpl();
1393 Indexes getIndexesImpl();
1399 Indexes getIndexesSybaseImpl();
1405 Indexes getIndexesMssqlImpl();
1411 ForeignConstraints getForeignConstraintsImpl(*
hash opts);
1417 ForeignConstraints getForeignConstraintsSybaseImpl();
1423 ForeignConstraints getForeignConstraintsMssqlImpl();
1429 Constraints getConstraintsImpl();
1435 Constraints getConstraintsSybaseImpl();
1441 Constraints getConstraintsMssqlImpl();
1447 Triggers getTriggersImpl();
1454 string getCreateTableSqlImpl(*
hash opt);
1460 *
list getCreateMiscSqlImpl(*
hash opt,
bool cache);
1466 *
list getAlignSqlImpl(AbstractTable table, *
hash opt);
1473 string getCreateSqlImpl(
list l);
1479 string getRenameSqlImpl(
string new_name);
1485 AbstractColumn addColumnImpl(
string cname,
hash opt,
bool nullable =
True);
1491 AbstractPrimaryKey addPrimaryKeyImpl(
string cname,
hash ch, *
hash opt);
1497 AbstractIndex addIndexImpl(
string iname,
bool enabled,
hash ch, *
hash opt);
1503 AbstractForeignConstraint addForeignConstraintImpl(
string cname,
hash ch,
string table,
hash tch, *
hash opt);
1509 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *
hash opt);
1515 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname,
hash ch, *
hash opt);
1521 AbstractTrigger addTriggerImpl(
string tname,
string src, *
hash opt);
1527 bool tryInsertImpl(
string sql,
hash row);
1533 hash getQoreTypeMapImpl();
1539 hash getTypeMapImpl();
1546 *
string getSqlValueImpl(
auto v);
1551 string getColumnSqlName(
string col);
1555 list getColumnSqlNames(softlist cols);
1573 setupTableImpl(
hash desc, *
hash opt);
1580 bool constraintsLinkedToIndexesImpl();
1587 bool uniqueIndexCreatesConstraintImpl();
1594 bool supportsTablespacesImpl();
1601 doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list> args, *
hash qh);
1608 doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list> args, *
hash qh, *
hash jch, *
hash ch, *
hash psch,
list coll);
1615 auto tryExecArgsImpl(
string sql, *softlist args);
1622 auto tryExecRawImpl(
string sql, *softlist args);
1629 copyImpl(AbstractTable old);
1635 *
hash doReturningImpl(
hash opt, reference<string> sql,
list args);
1641 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:987
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:309
class for FreeTDS sequences
Definition: FreetdsSqlUtil.qm.dox.h:458
string schema
schema name for the table
Definition: FreetdsSqlUtil.qm.dox.h:1242
represents a FreeTDS-specific column
Definition: FreetdsSqlUtil.qm.dox.h:241
represents a FreeTDS-specific primary key constraint
Definition: FreetdsSqlUtil.qm.dox.h:414
bool is_sybase
sybase flag
Definition: FreetdsSqlUtil.qm.dox.h:574
common base class for unique constraints
Definition: FreetdsSqlUtil.qm.dox.h:322
number number(softnumber n)
int byte_size
byte size of the column
Definition: FreetdsSqlUtil.qm.dox.h:246
class modeling a unique constraint
Definition: FreetdsSqlUtil.qm.dox.h:360
*string filegroup
the tablespace (filegroup) name of the index
Definition: FreetdsSqlUtil.qm.dox.h:176
represents a FreeTDS-specific foreign constraint
Definition: FreetdsSqlUtil.qm.dox.h:201
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:158
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:1245
provides the FreeTDS-specific implementation of the AbstractDatabase interface
Definition: FreetdsSqlUtil.qm.dox.h:569
represents a FreeTDS-specific index
Definition: FreetdsSqlUtil.qm.dox.h:171
represents a FreeTDS view
Definition: FreetdsSqlUtil.qm.dox.h:479
provides the FreeTDS-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: FreetdsSqlUtil.qm.dox.h:982
represents a FreeTDS-specific check constraint
Definition: FreetdsSqlUtil.qm.dox.h:221
bool enabled
True if the constraint is enabled, False if not
Definition: FreetdsSqlUtil.qm.dox.h:365
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:327
string string(softstring str, *string enc)
represents a FreeTDS-specific trigger
Definition: FreetdsSqlUtil.qm.dox.h:500
represents a FreeTDS-specific function
Definition: FreetdsSqlUtil.qm.dox.h:528
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:1239