150 FreetdsTable
get_table(AbstractDatasource nds,
string nname, *
hash opts);
157 parse_schema_name(
string nname, reference schema, reference name);
171 constructor(
string n_name,
bool n_unique,
hash n_cols, *
string n_filegroup) ;
179 private bool equalImpl(AbstractIndex ix);
183 string getRenameSql(
string table_name,
string new_name);
192 constructor(
string n, Columns c, ForeignConstraintTarget t) ;
199 softlist
getRenameSql(
string table_name,
string new_name);
238 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs) ;
242 string getNativeTypeString();
253 softlist getAddColumnSql(AbstractTable t);
269 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *
hash opt);
287 private bool equalImpl(AbstractColumn c);
296 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, softint n_scale) ;
300 string getNativeTypeString();
319 *
string getTablespace();
323 setTablespace(*
string ts);
327 bool setIndexBase(
string ix);
335 getIndexSql(reference sql,
string name, *
hash opts);
339 abstract AbstractIterator keyIterator();
436 softlist
getRenameSql(
string table_name,
string new_name);
462 constructor(
string n_name,
string n_src, *
string n_schemaname) ;
491 private bool equalImpl(AbstractFunctionBase t);
495 softlist
getRenameSql(
string table_name,
string new_name);
520 private bool equalImpl(AbstractFunctionBase t);
528 setName(
string new_name);
541 const FreetdsSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions;
543 const FreeTDS_TempSavepoint =
"qore_freetds_tmp_savepoint";
546 const FreetdsReclaimSpaceOptions = ReclaimSpaceOptions;
553 private list featuresImpl();
559 private *AbstractSequence getSequenceImpl(
string name);
562 private *AbstractView getViewImpl(
string name);
571 private *AbstractFunction getFunctionImpl(
string name);
574 private AbstractFunction getProcedureImpl(
string name);
577 private list getDropSchemaSqlImpl(
hash schema_hash, *
hash opt);
580 private list getAlignSqlImpl(
hash schema_hash, *
hash opt);
584 private softlist listTablesImpl();
592 private list listFunctionsImpl();
598 private list listProceduresImpl();
601 private list listSequencesImpl();
604 private list listViewsImpl();
608 private string getCreateSqlImpl(
list l);
612 static bool isSybase(AbstractDatasource ds);
618 private hash getSchemaDescriptionOptions();
622 private hash getReclaimSpaceOptions();
626 private softint getNextSequenceValueImpl(
string name);
630 private softint getCurrentSequenceValueImpl(
string name);
634 private bool supportsSequencesImpl();
638 private bool supportsTypesImpl();
642 private bool supportsPackagesImpl();
646 private bool rebuildIndexImpl(
string name, *
hash options);
650 private computeStatisticsImpl(*
hash options);
654 private reclaimSpaceImpl(*
hash options);
658 private any tryExecArgsImpl(
string sql, *softlist args);
662 private any tryExecRawImpl(
string sql, *softlist args);
666 static any tryExecArgs(AbstractDatasource ds,
string sql, *softlist args);
669 static any tryExecRaw(AbstractDatasource ds,
string sql);
684 const FreetdsTypeMap = (
731 const QoreTypeMap = (
737 "binary":
"varbinary",
745 const FreetdsTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions;
747 const FreetdsColumnDescOptions = AbstractTable::ColumnDescOptions;
749 const FreetdsIndexOptions = AbstractTable::IndexOptions;
751 const FreetdsConstraintOptions = AbstractTable::ConstraintOptions + FreetdsIndexOptions;
753 const FreetdsTableCreationOptions = AbstractTable::TableCreationOptions + FreetdsConstraintOptions;
755 const FreetdsAlignTableOptions = AbstractTable::AlignTableOptions + FreetdsTableCreationOptions;
758 const FreetdsSelectOptions = AbstractTable::SelectOptions + (
759 "tablehint":
"softstringlist",
763 const MsSqlServerTableHints = (
764 "fastfirstrow":
True,
768 "readcommitted":
True,
770 "readuncommitted":
True,
771 "repeatableread":
True,
773 "serializable":
True,
789 return sprintf(
"substring(%s,%v,%v) = %v", cn);
798 string name = QoreTypeMap{args[0]} ?? args[0];
799 hash desc = FreetdsTypeMap{name};
800 string sql =
sprintf (
"cast (%s as %s", cve, name);
810 "code":
string (
string cve,
string arg) {
811 return sprintf(
"%s + %s", arg, cve);
817 "code":
string (
string cve,
string arg) {
818 return sprintf(
"%s + %s", cve, arg);
822 "code":
string (
string cve,
list args) {
824 return sprintf(
"substring(%s,%d,32767)", cve, args[0]);
825 return sprintf(
"substring(%s,%d,%d)", cve, args[0], args[1]);
831 "code":
string (*
string cve, *
string arg) {
832 string sql = cve +
" over (";
834 sql +=
sprintf(
"partition by %s", arg);
840 "code":
string (
string arg1, any arg) {
841 return sprintf(
"substring(convert(varchar, dt, 120), 1, 4)", arg1);
845 "code":
string (
string arg1, any arg) {
846 return sprintf(
"substring(convert(varchar, dt, 120), 1, 7)", arg1);
850 "code":
string (
string arg1, any arg) {
851 return sprintf(
"substring(convert(varchar, dt, 120), 1, 10)", arg1);
855 "code":
string (
string arg1, any arg) {
856 return sprintf(
"substring(convert(varchar, dt, 120), 1, 13)", arg1);
862 "code":
string (*
string cve,
hash arg, reference psch) {
863 string sql =
sprintf(
"next value for %s", arg.seq);
871 "code":
string (*
string cve,
hash arg) {
872 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support this operation", arg.seq);
881 "placeholder":
"next value for %v",
890 "code":
string (*
string cve,
string arg) {
891 return sprintf(
"next value for %s", arg);
896 "code":
string (*
string cve,
string arg) {
897 throw "SEQUENCE-ERROR",
sprintf(
"cannot select the current value of sequence %y because this database does not support this operation", arg);
920 string getSchemaName();
924 *
string getTablespaceName();
939 private string getFromIntern(
string from, *
hash qh);
942 private hash getTableCreationOptions();
945 private hash getTableDescriptionHashOptions();
948 private hash getColumnDescOptions();
951 private hash getIndexOptions();
954 private hash getConstraintOptions();
957 private hash getAlignTableOptions();
961 private hash getWhereOperatorMap();
965 private hash getColumnOperatorMap();
969 private hash getInsertOperatorMap();
973 private hash getRawUpdateOperatorMap();
977 private hash getSelectOptions();
980 private bool checkExistenceImpl();
983 private Columns describeImpl();
986 private Columns describeSybaseImpl();
989 private Columns describeMssqlImpl();
1001 private Indexes getIndexesImpl();
1004 private Indexes getIndexesSybaseImpl();
1007 private Indexes getIndexesMssqlImpl();
1010 private ForeignConstraints getForeignConstraintsImpl(*
hash opts);
1013 private ForeignConstraints getForeignConstraintsSybaseImpl();
1016 private ForeignConstraints getForeignConstraintsMssqlImpl();
1019 private Constraints getConstraintsImpl();
1022 private Constraints getConstraintsSybaseImpl();
1025 private Constraints getConstraintsMssqlImpl();
1028 private Triggers getTriggersImpl();
1032 private string getCreateTableSqlImpl(*
hash opt);
1035 private *
list getCreateMiscSqlImpl(*
hash opt,
bool cache);
1038 private *
list getAlignSqlImpl(AbstractTable table, *
hash opt);
1042 private string getCreateSqlImpl(
list l);
1045 private string getRenameSqlImpl(
string new_name);
1048 private AbstractColumn addColumnImpl(
string cname,
hash opt,
bool nullable =
True);
1051 private AbstractPrimaryKey addPrimaryKeyImpl(
string cname,
hash ch, *
hash opt);
1054 private AbstractIndex addIndexImpl(
string iname,
bool enabled,
hash ch, *
hash opt);
1057 private AbstractForeignConstraint addForeignConstraintImpl(
string cname,
hash ch,
string table,
hash tch, *
hash opt);
1060 private AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *
hash opt);
1063 private AbstractUniqueConstraint addUniqueConstraintImpl(
string cname,
hash ch, *
hash opt);
1066 private AbstractTrigger addTriggerImpl(
string tname,
string src, *
hash opt);
1069 private bool tryInsertImpl(
string sql,
hash row);
1072 private hash getQoreTypeMapImpl();
1075 private hash getTypeMapImpl();
1079 private *
string getSqlValueImpl(any v);
1082 private bool emptyImpl();
1086 private clearImpl();
1089 private setupTableImpl(
hash desc, *
hash opt);
1093 private bool constraintsLinkedToIndexesImpl();
1097 private bool uniqueIndexCreatesConstraintImpl();
1101 private bool supportsTablespacesImpl();
1105 private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *
hash qh);
1109 private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *
hash qh, *
hash jch, *
hash ch, *
hash psch,
list coll);
1113 private any tryExecArgsImpl(
string sql, *softlist args);
1117 private any tryExecRawImpl(
string sql, *softlist args);
1121 private copyImpl(AbstractTable old);
1124 private *
hash doReturningImpl(
hash opt, reference sql,
list args);
1127 private 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:678
string sprintf(string fmt,...)
private 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:292
class for FreeTDS sequences
Definition: FreetdsSqlUtil.qm.dox.h:441
string schema
schema name for the table
Definition: FreetdsSqlUtil.qm.dox.h:909
represents a FreeTDS-specific column
Definition: FreetdsSqlUtil.qm.dox.h:228
represents a FreeTDS-specific primary key constraint
Definition: FreetdsSqlUtil.qm.dox.h:397
bool is_sybase
sybase flag
Definition: FreetdsSqlUtil.qm.dox.h:538
common base class for unique constraints
Definition: FreetdsSqlUtil.qm.dox.h:305
number number(softnumber n)
int byte_size
byte size of the column
Definition: FreetdsSqlUtil.qm.dox.h:233
class modeling a unique constraint
Definition: FreetdsSqlUtil.qm.dox.h:343
*string filegroup
the tablespace (filegroup) name of the index
Definition: FreetdsSqlUtil.qm.dox.h:166
represents a FreeTDS-specific foreign constraint
Definition: FreetdsSqlUtil.qm.dox.h:188
the FreetdsSqlUtil namespace contains all the objects in the FreetdsSqlUtil module ...
Definition: FreetdsSqlUtil.qm.dox.h:148
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:912
provides the FreeTDS-specific implementation of the AbstractDatabase interface
Definition: FreetdsSqlUtil.qm.dox.h:533
represents a FreeTDS-specific index
Definition: FreetdsSqlUtil.qm.dox.h:161
represents a FreeTDS view
Definition: FreetdsSqlUtil.qm.dox.h:458
provides the FreeTDS-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: FreetdsSqlUtil.qm.dox.h:673
represents a FreeTDS-specific check constraint
Definition: FreetdsSqlUtil.qm.dox.h:208
bool enabled
True if the constraint is enabled, False if not
Definition: FreetdsSqlUtil.qm.dox.h:348
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:310
string string(softstring str, *string enc)
represents a FreeTDS-specific trigger
Definition: FreetdsSqlUtil.qm.dox.h:475
represents a FreeTDS-specific function
Definition: FreetdsSqlUtil.qm.dox.h:500
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:906