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 - 2014 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 
135  parse_schema_name(string nname, reference schema, reference name);
136 
137 
140 
141 public:
142  public :
143  string type;
144 
145 public:
146 
148  constructor(string n_name, bool n_unique, hash n_cols, string n_type = "BTREE");
149 
150 
152  string getCreateSql(string table_name, *hash opt);
153 
154 
156  private bool equalImpl(AbstractIndex ix);
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  private bool equalImpl(AbstractColumn c);
249 
250  };
251 
254 
255 public:
256  public :
257  bool unsigned;
258  bool auto_increment;
259  // auto-incrememnt columns must be either "unique" or "primary key" in mysql
260  bool pk = False;
261 
262 public:
263 
264  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);
265 
266 
267  string getNativeTypeString();
268 
269 
271  private bool equalImpl(AbstractColumn c);
272 
273  };
274 
275 class MysqlUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
276 
277 public:
278  constructor();
279 
280 
281  bool setIndexBase(string ix);
282 
283 
285  clearIndex();
286 
287 
288  abstract AbstractIterator keyIterator();
289 
291  getIndexSql(reference sql, string name, *hash opts);
292 
293  };
294 
295 class MysqlUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public MysqlUniqueConstraintCommon {
296 
297 public:
298  constructor(string n, hash n_cols);
299 
300 
302 
317  MysqlColumn memberGate(string k);
318 
319 
320  string getCreateSql(string table_name, *hash opts);
321 
322 
323  list getRenameSql(string table_name, string new_name);
324 
325 
326  string getCreateSql(string name, string table_name, *hash opts);
327 
328 
330  string getDropSql(string table_name);
331 
332  };
333 
335 class MysqlPrimaryKey : public SqlUtil::AbstractPrimaryKey,public MysqlUniqueConstraintCommon {
336 
337 public:
338  constructor();
339 
340 
341  constructor(*hash c);
342 
343 
345 
360  MysqlColumn memberGate(string k);
361 
362 
363  string getCreateSql(string table_name, *hash opts);
364 
365 
367  softlist getRenameSql(string table_name, string new_name);
368 
369 
371  string getDropSql(string table_name);
372 
373 
375  bool supportsName();
376 
377  };
378 
381 
382 public:
384  constructor(string n, string n_src);
385 
386 
388  softlist getCreateSql(string table_name, *hash opt);
389 
390 
392  softlist getDropSql(string table_name);
393 
394 
396  private bool equalImpl(AbstractFunctionBase t);
397 
398 
400  softlist getRenameSql(string table_name, string new_name);
401 
402  };
403 
406 
407 public:
408  constructor(string n, string n_src);
409 
410 
412  softlist getCreateSql(*hash opt);
413 
414 
416  string getDropSql();
417 
418 
420  private bool equalImpl(AbstractFunctionBase t);
421 
422 
424  softlist getRenameSql(string new_name);
425 
426  };
427 
430 
431 public:
432  private :
433  string table_name;
434 
435 public:
436 
438  constructor(string n_table_name, string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end);
439 
440 
442  string getCreateSql(*hash opt);
443 
444 
446  string getRenameSql(string new_name);
447 
448 
450  string getDropSql();
451 
452  };
453 
456 
457 public:
458 
459  public :
461  *string tablecatalog;
463  *string checkoption;
465  *string definer;
467  *string securitytype;
468 
469 public:
470 
472  constructor(string n_name, string n_src, *string n_tablecatalog,
473  *string n_schema,
474  *string n_checkoption, *string n_definer,
475  *string n_securitytype, bool n_updatable)
476 ;
477 
478 
480  string getCreateSql(*hash opt);
481 
482 
484  softlist getRenameSql(string new_name);
485 
486  };
487 
490 
491 public:
492  public :
494  const MysqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
495  "sequence_table": Type::String,
496  "sequence_function": Type::String,
497  );
498 
499 
502  "columns": (
503  "name": (
504  "qore_type": SqlUtil::VARCHAR,
505  "size": 40,
506  "notnull": True,
507  ),
508  "id": (
509  "qore_type": Type::Number,
510  "size": 14,
511  "notnull": True,
512  ),
513  ),
514  );
515 
517  const MysqlSequenceFunction = "%s(seq_name varchar(40)) returns decimal(14)
518 begin
519  update %s set id = last_insert_id(id + 1) where name = seq_name;
520  return last_insert_id();
521 end";
522 
523 public:
524 
525  private :
526  string schema;
527 
529  Datasource seqds;
530 
531  string sequence_table = "sqlutil_sequences";
532  string sequence_function = "sqlutil_nextval";
533 
534 public:
535 
536  constructor(AbstractDatasource nds, *hash opts);
537 
538 
539  private list featuresImpl();
540 
541 
542  string getSchemaName();
543 
544 
545  private AbstractSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
546 
547 
548  private *AbstractSequence getSequenceImpl(string name);
549 
550 
551  private *AbstractView getViewImpl(string name);
552 
553 
554  private MysqlFunction makeFunctionImpl(string name, string src, *hash opts);
555 
556 
557  private MysqlFunction makeProcedureImpl(string name, string src, *hash opts);
558 
559 
560  private *AbstractFunction getFunctionImpl(string name);
561 
562 
563 
564 private:
565  static string makeParameter(hash row);
566 public:
567 
568 
569  private AbstractFunction getProcedureImpl(string name);
570 
571 
572  private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
573 
574 
575  private list getAlignSqlImpl(hash schema_hash, *hash opt);
576 
577 
579  private list listTablesImpl();
580 
581 
583 
587  private list listFunctionsImpl();
588 
589 
591 
595  private list listProceduresImpl();
596 
597 
598  private list listSequencesImpl();
599 
600 
601  private list listViewsImpl();
602 
603 
604  private string getCreateSqlImpl(list l);
605 
606 
607  static string getCreateSql(list l);
608 
611 
612 
614  private softint getNextSequenceValueImpl(string name);
615 
616 
618  private bool supportsSequencesImpl();
619 
620 
622  private bool supportsTypesImpl();
623 
624 
626  private bool supportsPackagesImpl();
627 
628  };
629 
632 
633 public:
634  public :
636  const MysqlTypeMap = (
637  "decimal": ("qore": Type::Number, "size": SZ_NUM,),
638  "tinyint": ("qore": Type::Int, "ai": True,),
639  "smallint": ("qore": Type::Int, "ai": True,),
640  "mediumint": ("qore": Type::Int, "ai": True,),
641  "int": ("qore": Type::Int, "ai": True,),
642  "bigint": ("qore": Type::Int, "ai": True,),
643  "float": ("qore": Type::Float, "ai": True,),
644  "double": ("qore": Type::Float, "ai": True,),
645 
646  "date": ("qore": Type::Date,),
647  "datetime": ("qore": Type::Date,),
648  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
649  "time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
650  "year": ("qore": Type::Int,),
651 
652  "char": ("qore": Type::String, "size": SZ_MAND,),
653  "varchar": ("qore": Type::String, "size": SZ_MAND,),
654 
655  "binary": ("qore": Type::Binary,),
656  "varbinary": ("qore": Type::Binary,),
657 
658  "tinytext": ("qore": Type::String,),
659  "text": ("qore": Type::String,),
660  "mediumtext": ("qore": Type::String,),
661  "longtext": ("qore": Type::String,),
662 
663  "tinyblob": ("qore": Type::Binary,),
664  "blob": ("qore": Type::Binary,),
665  "mediumblob": ("qore": Type::Binary,),
666  "longblob": ("qore": Type::Binary,),
667 
668  "bit": ("qore": Type::Int,),
669  );
670 
672  const QoreTypeMap = (
673  "integer": "bigint",
674  "float": "double",
675  "number": "decimal",
676  "string": "varchar",
677  "date": "datetime",
678  "binary": "varbinary",
679  "bool": "tinyint",
680  SqlUtil::CHAR: "char",
681  SqlUtil::CLOB: "mediumtext",
682  SqlUtil::BLOB: "mediumblob",
683  );
684 
686  const MysqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
687  "engine": Type::String,
688  );
689 
691 
696  const MysqlColumnDescOptions = AbstractTable::ColumnDescOptions + (
697  "unsigned": Type::Boolean,
698  "auto_increment": Type::Boolean,
699  "pk": Type::Boolean,
700  );
701 
702  const MysqlIndexOptions = AbstractTable::IndexOptions;
703 
704  const MysqlConstraintOptions = AbstractTable::ConstraintOptions + MysqlIndexOptions + (
705  "index": Type::String,
706  );
707 
708  const MysqlTableCreationOptions = AbstractTable::TableCreationOptions + MysqlConstraintOptions;
709 
710  const MysqlAlignTableOptions = AbstractTable::AlignTableOptions + MysqlTableCreationOptions;
711 
714  COP_PREPEND: (
715  "arg": Type::String,
716  "sqlvalue": True,
717  "code": string (string cve, string arg) {
718  return sprintf("concat(%s,%s)", arg, cve);
719  },
720  ),
721  COP_APPEND: (
722  "arg": Type::String,
723  "sqlvalue": True,
724  "code": string (string cve, string arg) {
725  return sprintf("concat(%s,%s)", cve, arg);
726  },
727  ),
728  COP_YEAR: (
729  "code": string (string arg1, any arg) {
730  return sprintf("date_format(%s, '%%Y')", arg1);
731  }
732  ),
733  COP_YEAR_MONTH: (
734  "code": string (string arg1, any arg) {
735  return sprintf("date_format(%s, '%%Y-%%m')", arg1);
736  }
737  ),
738  COP_YEAR_DAY: (
739  "code": string (string arg1, any arg) {
740  return sprintf("date_format(%s, '%%Y-%%m-%%e')", arg1);
741  }
742  ),
743  COP_YEAR_HOUR: (
744  "code": string (string arg1, any arg) {
745  return sprintf("date_format(%s, '%%Y-%%m-%%e %%k')", arg1);
746  }
747  ),
748  );
749 
750 public:
751 
752  private :
753  string schema;
754  string engine = "innodb";
755 
756 public:
757 
758  constructor(AbstractDatasource nds, string nname, *hash opts);
759 
760 
762  string getSqlName();
763 
764 
765  private hash getTableCreationOptions();
766 
767 
768  private hash getTableDescriptionHashOptions();
769 
770 
771  private hash getColumnDescOptions();
772 
773 
774  private hash getIndexOptions();
775 
776 
777  private hash getConstraintOptions();
778 
779 
780  private hash getAlignTableOptions();
781 
782 
784  private hash getColumnOperatorMap();
785 
786 
787  private bool checkExistenceImpl();
788 
789 
790  private Columns describeImpl();
791 
792 
793  private *string getCreatePrimaryKeySqlUnlocked(*hash opt, bool cache = True);
794 
795 
796  private MysqlPrimaryKey getPrimaryKeyImpl();
797 
798 
799  private Indexes getIndexesImpl();
800 
801 
802  private ForeignConstraints getForeignConstraintsImpl(*hash opts);
803 
804 
805  private Constraints getConstraintsImpl();
806 
807 
808  private Triggers getTriggersImpl();
809 
810 
811  string getCreateTableSqlImpl(*hash opt);
812 
813 
814  *list getCreateMiscSqlImpl(*hash opt, bool cache);
815 
816 
817  private *list getAlignSqlImpl(AbstractTable table, *hash opt);
818 
819 
820  private string getCreateSqlImpl(list l);
821 
822 
823  private string getRenameSqlImpl(string new_name);
824 
825 
826  private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
827 
828 
829  private setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
830 
831 
832  private addColumnToTableUnlocked(AbstractColumn c);
833 
834 
835  private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
836 
837 
838  private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
839 
840 
841  private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
842 
843 
844  private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
845 
846 
847  private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
848 
849 
850  private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
851 
852 
853  private bool tryInsertImpl(string sql, hash row);
854 
855 
856  private hash getQoreTypeMapImpl();
857 
858 
859  private hash getTypeMapImpl();
860 
861 
863  private *string getSqlValueImpl(any v);
864 
865 
867 
868 private:
869  static *string getSqlValueIntern(any v);
870 public:
871 
872 
874 
885  static *string getSqlValue(any v);
886 
887  private bool emptyImpl();
888 
889 
890  private preSetupTableImpl(reference desc, *hash opt);
891 
892 
893  private setupTableImpl(hash desc, *hash opt);
894 
895 
897  private bool constraintsLinkedToIndexesImpl();
898 
899 
901  private bool uniqueIndexCreatesConstraintImpl();
902 
903 
905  private bool supportsTablespacesImpl();
906 
907 
909  private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
910 
911 
913  private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
914 
915 
917  private copyImpl(AbstractTable old);
918 
919  };
920 };
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
const MysqlColumnDescOptions
extends SqlUtil::AbstractTable::ColumnDescOptions with MySQL-specific values
Definition: MysqlSqlUtil.qm.dox.h:696
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:636
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
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
string getDropSql()
returns a string that can be used to drop the sequence from the database
string sprintf(string fmt,...)
const DefaultCopMap
const VARCHAR
private bool supportsSequencesImpl()
returns True since we have a workaround implementation for sequences in MySQL
provides the MySQL-specific implementation of the AbstractDatabase interface
Definition: MysqlSqlUtil.qm.dox.h:489
private bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
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:713
represents a MySQL view
Definition: MysqlSqlUtil.qm.dox.h:455
const MysqlSequenceTable
MySQL sequence emulation table.
Definition: MysqlSqlUtil.qm.dox.h:501
private bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
MysqlDatabase get_database(AbstractDatasource nds, *hash opts)
returns a MysqlDatabase object corresponding to the arguments
private 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...
*string securitytype
security type value
Definition: MysqlSqlUtil.qm.dox.h:467
private bool supportsPackagesImpl()
returns True if the database supports packages
const True
private bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
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
private bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
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...
const False
softlist getRenameSql(string new_name)
returns a string that can be used to rename the view in the database
*string checkoption
checkoption clause
Definition: MysqlSqlUtil.qm.dox.h:463
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
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
private *string getSqlValueImpl(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const Boolean
const SZ_NUM
private bool supportsTablespacesImpl()
returns True if the database support tablespaces
const MysqlSequenceFunction
MySQL sequence function.
Definition: MysqlSqlUtil.qm.dox.h:517
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:686
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:405
private copyImpl(AbstractTable old)
db-specific copy actions
provides the MySQL-specific implementation of the AbstractTable interface
Definition: MysqlSqlUtil.qm.dox.h:631
represents a MySQL-specific primary key constraint
Definition: MysqlSqlUtil.qm.dox.h:335
const COP_YEAR_MONTH
private 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
represents a MySQL-specific trigger
Definition: MysqlSqlUtil.qm.dox.h:380
const BLOB
const CLOB
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema, etc)
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)
private list listFunctionsImpl()
returns a list of string function names in the database
*string definer
dafiner clause
Definition: MysqlSqlUtil.qm.dox.h:465
private list listTablesImpl()
returns a list of string table names in the database
const COP_PREPEND
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:529
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
constructor(string n_name, string n_src, *string n_tablecatalog, *string n_schema, *string n_checkoption, *string n_definer, *string n_securitytype, bool n_updatable)
creates the object from the arguments
private hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
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:429
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
represents a MySQL-specific numeric column
Definition: MysqlSqlUtil.qm.dox.h:253
private bool supportsTypesImpl()
returns True if the database supports named types
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:494
*string tablecatalog
table catalog value
Definition: MysqlSqlUtil.qm.dox.h:461
private bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
private list listProceduresImpl()
returns a list of string procedure names in the database
represents a MySQL-specific index
Definition: MysqlSqlUtil.qm.dox.h:139
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
private hash getColumnOperatorMap()
returns the column operator map for this object
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...
const Number
private softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
constructor(string n_name, bool n_unique, hash n_cols, string n_type="BTREE")
creates the object from the arguments
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
const QoreTypeMap
maps qore type names to postgresql type names
Definition: MysqlSqlUtil.qm.dox.h:672
const COP_APPEND