Qore MysqlSqlUtil Module Reference  1.0
 All Classes Namespaces Functions Variables Groups Pages
MysqlSqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file MysqlSqlUtil.qm Qore user module for working with MySQL SQL data
3 
4 /* MysqlSqlUtil.qm Copyright 2013 Qore Technologies, sro
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // this module requires Qore 0.8.8 or better
26 
27 // requires the SqlUtil module
28 
29 // don't use "$" signs for variables and class members, assume local variable scope
30 
31 // require type definitions everywhere
32 
33 // enable all warnings
34 
35 
36 /* Version History
37  * 2013-10-04 v1.0: David Nichols <david@qore.org>
38  + the initial version of the MysqlSqlUtil module
39 */
40 
125 namespace MysqlSqlUtil {
128  MysqlTable get_table(AbstractDatasource nds, string nname, *hash opts);
129 
130 
132  MysqlDatabase get_database(AbstractDatasource nds, *hash opts);
133 
134 
137 
138 public:
139  public :
140  string type;
141 
142 public:
143 
145  constructor(string n_name, bool n_unique, hash n_cols, string n_type = "BTREE");
146 
147 
149  string getCreateSql(string table_name, *hash opt);
150 
151 
153 
154 private:
155  bool equalImpl(AbstractIndex ix);
156 public:
157 
158 
160  string getRenameSql(string table_name, string new_name);
161 
162 
164  string getDropSql(string table_name);
165 
166  };
167 
170 
171 public:
172  constructor(string n, Columns c, ForeignConstraintTarget t);
173 
174 
175  string getCreateSql(string table_name, *hash opt);
176 
177 
179  softlist getRenameSql(string table_name, string new_name);
180 
181 
182  string getCreateSql(string name, string table_name, *hash opt);
183 
184 
185  string getAddSql(string name, string table_name, *hash opt);
186 
187 
189  string getDropSql(string table_name);
190 
191  };
192 
195 
196 public:
197  public :
200 
201 public:
202 
203  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs);
204 
205 
207 
214  softlist getCreateSql(AbstractTable t);
215 
216 
218 
230  softlist getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
231 
232 
234 
244  string getRenameSql(AbstractTable t, string new_name);
245 
246 
248 
249 private:
250  bool equalImpl(AbstractColumn c);
251 public:
252 
253  };
254 
257 
258 public:
259  public :
260  bool unsigned;
261  bool auto_increment;
262  // auto-incrememnt columns must be either "unique" or "primary key" in mysql
263  bool pk = False;
264 
265 public:
266 
267  constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint n_scale, bool n_unsigned = False, bool n_auto_increment = False, bool n_pk = False);
268 
269 
270  string getNativeTypeString();
271 
272 
274 
275 private:
276  bool equalImpl(AbstractColumn c);
277 public:
278 
279  };
280 
281 class MysqlUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
282 
283 public:
284  constructor();
285 
286 
287  bool setIndexBase(string ix);
288 
289 
291  clearIndex();
292 
293 
294  abstract AbstractIterator keyIterator();
295 
297  getIndexSql(reference sql, string name, *hash opts);
298 
299  };
300 
301 class MysqlUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public MysqlUniqueConstraintCommon {
302 
303 public:
304  constructor(string n, hash n_cols);
305 
306 
308 
323  MysqlColumn memberGate(string k);
324 
325 
326  string getCreateSql(string table_name, *hash opts);
327 
328 
329  list getRenameSql(string table_name, string new_name);
330 
331 
332  string getCreateSql(string name, string table_name, *hash opts);
333 
334 
336  string getDropSql(string table_name);
337 
338  };
339 
341 class MysqlPrimaryKey : public SqlUtil::AbstractPrimaryKey,public MysqlUniqueConstraintCommon {
342 
343 public:
344  constructor();
345 
346 
347  constructor(*hash c);
348 
349 
351 
366  MysqlColumn memberGate(string k);
367 
368 
369  string getCreateSql(string table_name, *hash opts);
370 
371 
373  softlist getRenameSql(string table_name, string new_name);
374 
375 
377  string getDropSql(string table_name);
378 
379 
381  bool supportsName();
382 
383  };
384 
387 
388 public:
390  constructor(string n, string n_src);
391 
392 
394  softlist getCreateSql(string table_name, *hash opt);
395 
396 
398  softlist getDropSql(string table_name);
399 
400 
402 
403 private:
404  bool equalImpl(AbstractFunctionBase t);
405 public:
406 
407 
409  softlist getRenameSql(string table_name, string new_name);
410 
411  };
412 
415 
416 public:
417  constructor(string n, string n_src);
418 
419 
421  softlist getCreateSql(*hash opt);
422 
423 
425  string getDropSql();
426 
427 
429 
430 private:
431  bool equalImpl(AbstractFunctionBase t);
432 public:
433 
434 
436  softlist getRenameSql(string new_name);
437 
438  };
439 
442 
443 public:
444  private :
445  string table_name;
446 
447 public:
448 
450  constructor(string n_table_name, string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end);
451 
452 
454  string getCreateSql(*hash opt);
455 
456 
458  string getRenameSql(string new_name);
459 
460 
462  string getDropSql();
463 
464  };
465 
468 
469 public:
470  public :
472  const MysqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
473  "sequence_table": Type::String,
474  "sequence_function": Type::String,
475  );
476 
477 
480  "columns": (
481  "name": (
482  "qore_type": SqlUtil::VARCHAR,
483  "size": 40,
484  "notnull": True,
485  ),
486  "id": (
487  "qore_type": Type::Number,
488  "size": 14,
489  "notnull": True,
490  ),
491  ),
492  );
493 
495  const MysqlSequenceFunction = "%s(seq_name varchar(40)) returns decimal(14)
496 begin
497  update %s set id = last_insert_id(id + 1) where name = seq_name;
498  return last_insert_id();
499 end";
500 
501 public:
502 
503  private :
504  string schema;
505 
507  Datasource seqds;
508 
509  string sequence_table = "sqlutil_sequences";
510  string sequence_function = "sqlutil_nextval";
511 
512 public:
513 
514  constructor(AbstractDatasource nds, *hash opts);
515 
516 
517 
518 private:
519  list featuresImpl();
520 public:
521 
522 
523  string getSchemaName();
524 
525 
526 
527 private:
528  AbstractSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
529 public:
530 
531 
532 
533 private:
534  *AbstractSequence getSequenceImpl(string name);
535 public:
536 
537 
538 
539 private:
540  MysqlFunction makeFunctionImpl(string name, string src, *hash opts);
541 public:
542 
543 
544 
545 private:
546  MysqlFunction makeProcedureImpl(string name, string src, *hash opts);
547 public:
548 
549 
550 
551 private:
552  *AbstractFunction getFunctionImpl(string name);
553 public:
554 
555 
556 
557 private:
558  static string makeParameter(hash row);
559 public:
560 
561 
562 
563 private:
564  AbstractFunction getProcedureImpl(string name);
565 public:
566 
567 
568 
569 private:
570  list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
571 public:
572 
573 
574 
575 private:
576  list getAlignSqlImpl(hash schema_hash, *hash opt);
577 public:
578 
579 
581 
582 private:
584 public:
585 
586 
588 
593 private:
595 public:
596 
597 
599 
604 private:
606 public:
607 
608 
609 
610 private:
611  list listSequencesImpl();
612 public:
613 
614 
615 
616 private:
617  list listViewsImpl();
618 public:
619 
620 
621 
622 private:
623  string getCreateSqlImpl(list l);
624 public:
625 
626 
627  static string getCreateSql(list l);
628 
630 
631 private:
633 public:
634 
635 
637 
638 private:
639  softint getNextSequenceValueImpl(string name);
640 public:
641 
642 
644 
645 private:
646  bool supportsSequencesImpl();
647 public:
648 
649 
651 
652 private:
653  bool supportsTypesImpl();
654 public:
655 
656 
658 
659 private:
660  bool supportsPackagesImpl();
661 public:
662 
663  };
664 
667 
668 public:
669  public :
671  const MysqlTypeMap = (
672  "decimal": ("qore": Type::Number, "size": SZ_NUM,),
673  "tinyint": ("qore": Type::Int, "ai": True,),
674  "smallint": ("qore": Type::Int, "ai": True,),
675  "mediumint": ("qore": Type::Int, "ai": True,),
676  "int": ("qore": Type::Int, "ai": True,),
677  "bigint": ("qore": Type::Int, "ai": True,),
678  "float": ("qore": Type::Float, "ai": True,),
679  "double": ("qore": Type::Float, "ai": True,),
680 
681  "date": ("qore": Type::Date,),
682  "datetime": ("qore": Type::Date,),
683  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
684  "time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
685  "year": ("qore": Type::Int,),
686 
687  "char": ("qore": Type::String, "size": SZ_MAND,),
688  "varchar": ("qore": Type::String, "size": SZ_MAND,),
689 
690  "binary": ("qore": Type::Binary,),
691  "varbinary": ("qore": Type::Binary,),
692 
693  "tinytext": ("qore": Type::String,),
694  "text": ("qore": Type::String,),
695  "mediumtext": ("qore": Type::String,),
696  "longtext": ("qore": Type::String,),
697 
698  "tinyblob": ("qore": Type::Binary,),
699  "blob": ("qore": Type::Binary,),
700  "mediumblob": ("qore": Type::Binary,),
701  "longblob": ("qore": Type::Binary,),
702 
703  "bit": ("qore": Type::Int,),
704  );
705 
707  const QoreTypeMap = (
708  "integer": "bigint",
709  "float": "double",
710  "number": "decimal",
711  "string": "varchar",
712  "date": "datetime",
713  "binary": "varbinary",
714  "bool": "tinyint",
715  SqlUtil::CHAR: "char",
716  SqlUtil::CLOB: "mediumtext",
717  SqlUtil::BLOB: "mediumblob",
718  );
719 
721  const MysqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
722  "engine": Type::String,
723  );
724 
726 
731  const MysqlColumnDescOptions = AbstractTable::ColumnDescOptions + (
732  "unsigned": Type::Boolean,
733  "auto_increment": Type::Boolean,
734  "pk": Type::Boolean,
735  );
736 
737  const MysqlIndexOptions = AbstractTable::IndexOptions;
738 
739  const MysqlConstraintOptions = AbstractTable::ConstraintOptions + MysqlIndexOptions + (
740  "index": Type::String,
741  );
742 
743  const MysqlTableCreationOptions = AbstractTable::TableCreationOptions + MysqlConstraintOptions;
744 
745  const MysqlAlignTableOptions = AbstractTable::AlignTableOptions + MysqlTableCreationOptions;
746 
749  COP_PREPEND: (
750  "arg": Type::String,
751  "sqlvalue": True,
752  "code": string (string cve, string arg) {
753  return sprintf("concat(%s,%s)", arg, cve);
754 
755 public:
756  ),
757  COP_APPEND: (
758  "arg": Type::String,
759  "sqlvalue": True,
760  "code": string (string cve, string arg) {
761  return sprintf("concat(%s,%s)", cve, arg);
762  },
763  ),
764  COP_YEAR: (
765  "code": string (string arg1, any arg) {
766  return sprintf("date_format(%s, '%%Y')", arg1);
767  }
768  ),
769  COP_YEAR_MONTH: (
770  "code": string (string arg1, any arg) {
771  return sprintf("date_format(%s, '%%Y-%%m')", arg1);
772  }
773  ),
774  COP_YEAR_DAY: (
775  "code": string (string arg1, any arg) {
776  return sprintf("date_format(%s, '%%Y-%%m-%%e')", arg1);
777  }
778  ),
779  COP_YEAR_HOUR: (
780  "code": string (string arg1, any arg) {
781  return sprintf("date_format(%s, '%%Y-%%m-%%e %%k')", arg1);
782  }
783  ),
784  );
785  }
786 
787  private :
788  string schema;
789  string engine = "innodb";
790 
791 public:
792 
793  constructor(AbstractDatasource nds, string nname, *hash opts);
794 
795 
797  string getSqlName();
798 
799 
800 
801 private:
802  hash getTableCreationOptions();
803 public:
804 
805 
806 
807 private:
808  hash getTableDescriptionHashOptions();
809 public:
810 
811 
812 
813 private:
814  hash getColumnDescOptions();
815 public:
816 
817 
818 
819 private:
820  hash getIndexOptions();
821 public:
822 
823 
824 
825 private:
826  hash getConstraintOptions();
827 public:
828 
829 
830 
831 private:
832  hash getAlignTableOptions();
833 public:
834 
835 
837 
838 private:
840 public:
841 
842 
843 
844 private:
845  bool checkExistenceImpl();
846 public:
847 
848 
849 
850 private:
851  Columns describeImpl();
852 public:
853 
854 
855 
856 private:
857  *string getCreatePrimaryKeySqlUnlocked(*hash opt, bool cache = True);
858 public:
859 
860 
861 
862 private:
863  MysqlPrimaryKey getPrimaryKeyImpl();
864 public:
865 
866 
867 
868 private:
869  Indexes getIndexesImpl();
870 public:
871 
872 
873 
874 private:
875  ForeignConstraints getForeignConstraintsImpl(*hash opts);
876 public:
877 
878 
879 
880 private:
881  Constraints getConstraintsImpl();
882 public:
883 
884 
885 
886 private:
887  Triggers getTriggersImpl();
888 public:
889 
890 
891  string getCreateTableSqlImpl(*hash opt);
892 
893 
894  *list getCreateMiscSqlImpl(*hash opt, bool cache);
895 
896 
897 
898 private:
899  *list getAlignSqlImpl(AbstractTable table, *hash opt);
900 public:
901 
902 
903 
904 private:
905  string getCreateSqlImpl(list l);
906 public:
907 
908 
909 
910 private:
911  string getRenameSqlImpl(string new_name);
912 public:
913 
914 
915 
916 private:
917  AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
918 public:
919 
920 
921 
922 private:
923  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
924 public:
925 
926 
927 
928 private:
929  addColumnToTableUnlocked(AbstractColumn c);
930 public:
931 
932 
933 
934 private:
935  AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
936 public:
937 
938 
939 
940 private:
941  AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
942 public:
943 
944 
945 
946 private:
947  AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
948 public:
949 
950 
951 
952 private:
953  AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
954 public:
955 
956 
957 
958 private:
959  AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
960 public:
961 
962 
963 
964 private:
965  AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
966 public:
967 
968 
969 
970 private:
971  bool tryInsertImpl(string sql, hash row);
972 public:
973 
974 
975 
976 private:
977  hash getQoreTypeMapImpl();
978 public:
979 
980 
981 
982 private:
983  hash getTypeMapImpl();
984 public:
985 
986 
988 
989 private:
990  *string getSqlValueImpl(any v);
991 public:
992 
993 
995 
996 private:
997  static *string getSqlValueIntern(any v);
998 public:
999 
1000 
1002 
1013  static *string getSqlValue(any v);
1014 
1015 
1016 private:
1017  bool emptyImpl();
1018 public:
1019 
1020 
1021 
1022 private:
1023  preSetupTableImpl(reference desc, *hash opt);
1024 public:
1025 
1026 
1027 
1028 private:
1029  setupTableImpl(hash desc, *hash opt);
1030 public:
1031 
1032 
1034 
1035 private:
1037 public:
1038 
1039 
1041 
1042 private:
1044 public:
1045 
1046 
1048 
1049 private:
1050  bool supportsTablespacesImpl();
1051 public:
1052 
1053 
1055 
1056 private:
1057  doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
1058 public:
1059 
1060 
1062 
1063 private:
1064  doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
1065 public:
1066 
1067 
1069 
1070 private:
1071  copyImpl(AbstractTable old);
1072 public:
1073 
1074  };
1075 };
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
const MysqlColumnDescOptions
extends SqlUtil::AbstractTable::ColumnDescOptions with MySQL-specific values
Definition: MysqlSqlUtil.qm.dox.h:731
const Date
int byte_size
byte size of the column
Definition: MysqlSqlUtil.qm.dox.h:199
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
const MysqlTypeMap
maps mysql type names to type configurations
Definition: MysqlSqlUtil.qm.dox.h:671
const String
string getDropSql()
returns a string that can be used to drop the function from the database
represents a MySQL-specific foreign constraint
Definition: MysqlSqlUtil.qm.dox.h:169
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
string getDropSql()
returns a string that can be used to drop the sequence from the database
string sprintf(string fmt,...)
const DefaultCopMap
const VARCHAR
provides the MySQL-specific implementation of the AbstractDatabase interface
Definition: MysqlSqlUtil.qm.dox.h:467
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
MysqlTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a MysqlTable object corresponding to the arguments
const MysqlCopMap
column operator specializations for MySQL
Definition: MysqlSqlUtil.qm.dox.h:748
bool supportsSequencesImpl()
returns True since we have a workaround implementation for sequences in MySQL
const MysqlSequenceTable
MySQL sequence emulation table.
Definition: MysqlSqlUtil.qm.dox.h:479
MysqlDatabase get_database(AbstractDatasource nds, *hash opts)
returns a MysqlDatabase object corresponding to the arguments
const True
const SZ_MAND
const CHAR
softlist getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt)
returns a list of sql strings that can be used to modify the column to the new definition; if the col...
softlist getRenameSql(string new_name)
returns a string that can be used to rename the function in the database
number number(softnumber n)
const COP_YEAR_HOUR
softlist getRenameSql(string table_name, string new_name)
returns a string that drops the constraint and re-adds it, since MySQL does not support renaming cons...
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
hash getColumnOperatorMap()
returns the column operator map for this object
const False
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
list list(...)
const Float
bool supportsPackagesImpl()
returns True if the database supports packages
*string getSqlValueImpl(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
list listFunctionsImpl()
returns a list of string function names in the database
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
string getDropSql(string table_name)
returns a string that can be used to drop the foreign constraint from the database ...
string getRenameSql(string new_name)
returns a string that can be used to rename the sequence in the database
list listProceduresImpl()
returns a list of string procedure names in the database
const Boolean
const SZ_NUM
const MysqlSequenceFunction
MySQL sequence function.
Definition: MysqlSqlUtil.qm.dox.h:495
string getDropSql(string table_name)
returns a string that can be used to drop the index from the table
const Binary
MysqlColumn memberGate(string k)
returns the MysqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception ...
const MysqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with &quot;engine&quot; for the DB engine behind th...
Definition: MysqlSqlUtil.qm.dox.h:721
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
represents a MySQL-specific function
Definition: MysqlSqlUtil.qm.dox.h:414
list listTablesImpl()
returns a list of string table names in the database
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
provides the MySQL-specific implementation of the AbstractTable interface
Definition: MysqlSqlUtil.qm.dox.h:666
represents a MySQL-specific primary key constraint
Definition: MysqlSqlUtil.qm.dox.h:341
const COP_YEAR_MONTH
represents a MySQL-specific trigger
Definition: MysqlSqlUtil.qm.dox.h:386
const BLOB
const CLOB
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema, etc)
bool supportsTablespacesImpl()
returns True if the database support tablespaces
softlist getRenameSql(string table_name, string new_name)
primary keys have no name in MySQL so this method returns an empty list
string string(softstring str)
const COP_PREPEND
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
static *string getSqlValueIntern(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
Datasource seqds
separate datasource dedicated for extern sequence implementation with autonomous transactions ...
Definition: MysqlSqlUtil.qm.dox.h:507
const Int
constructor(string n_table_name, string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
const COP_YEAR
bool supportsTypesImpl()
returns True if the database supports named types
copyImpl(AbstractTable old)
db-specific copy actions
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
class for MySQL sequences based on a sequence table and autonomous transactions
Definition: MysqlSqlUtil.qm.dox.h:441
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
represents a MySQL-specific numeric column
Definition: MysqlSqlUtil.qm.dox.h:256
represents a MySQL-specific column
Definition: MysqlSqlUtil.qm.dox.h:194
const COP_YEAR_DAY
const MysqlSchemaDescriptionOptions
MySQL-specific schema description keys.
Definition: MysqlSqlUtil.qm.dox.h:472
doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh)
processes a string for use in SQL select statements when there is a &quot;limit&quot; argument, but no &quot;orderby&quot; or &quot;offset&quot; arguments
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
represents a MySQL-specific index
Definition: MysqlSqlUtil.qm.dox.h:136
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
bool supportsName()
returns False since primary key constraints in MySQL have no name
hash hash(object obj)
const SZ_OPT
static *string getSqlValue(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument ...
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database; hwoever mysql does not support...
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
const Number
constructor(string n_name, bool n_unique, hash n_cols, string n_type="BTREE")
creates the object from the arguments
doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch)
processes a string for use in SQL select statements when there is an &quot;order by&quot; and &quot;offset&quot; argument...
const QoreTypeMap
maps qore type names to postgresql type names
Definition: MysqlSqlUtil.qm.dox.h:707
const COP_APPEND