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 // minimum required Qore version
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 getAddColumnSql(AbstractTable t);
215 
216 
218  string getCreateSql(AbstractTable t);
219 
220 
222 
234  softlist getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
235 
236 
238 
248  string getRenameSql(AbstractTable t, string new_name);
249 
250 
252  private bool equalImpl(AbstractColumn c);
253 
254  };
255 
258 
259 public:
260  public :
261  bool unsigned;
262  bool auto_increment;
263  // auto-incrememnt columns must be either "unique" or "primary key" in mysql
264  bool pk = False;
265 
266 public:
267 
268  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);
269 
270 
271  string getNativeTypeString();
272 
273 
275  private bool equalImpl(AbstractColumn c);
276 
277  };
278 
279 class MysqlUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
280 
281 public:
282  constructor();
283 
284 
285  bool setIndexBase(string ix);
286 
287 
289  clearIndex();
290 
291 
292  abstract AbstractIterator keyIterator();
293 
295  getIndexSql(reference sql, string name, *hash opts);
296 
297  };
298 
299 class MysqlUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public MysqlUniqueConstraintCommon {
300 
301 public:
302  constructor(string n, hash n_cols);
303 
304 
306 
321  MysqlColumn memberGate(string k);
322 
323 
324  string getCreateSql(string table_name, *hash opts);
325 
326 
327  list getRenameSql(string table_name, string new_name);
328 
329 
330  string getCreateSql(string name, string table_name, *hash opts);
331 
332 
334  string getDropSql(string table_name);
335 
336  };
337 
339 class MysqlPrimaryKey : public SqlUtil::AbstractPrimaryKey,public MysqlUniqueConstraintCommon {
340 
341 public:
342  constructor();
343 
344 
345  constructor(*hash c);
346 
347 
349 
364  MysqlColumn memberGate(string k);
365 
366 
367  string getCreateSql(string table_name, *hash opts);
368 
369 
371  softlist getRenameSql(string table_name, string new_name);
372 
373 
375  string getDropSql(string table_name);
376 
377 
379  bool supportsName();
380 
381  };
382 
385 
386 public:
388  constructor(string n, string n_src);
389 
390 
392  softlist getCreateSql(string table_name, *hash opt);
393 
394 
396  softlist getDropSql(string table_name);
397 
398 
400  private bool equalImpl(AbstractFunctionBase t);
401 
402 
404  softlist getRenameSql(string table_name, string new_name);
405 
406  };
407 
410 
411 public:
412  constructor(string n, string n_src);
413 
414 
416  softlist getCreateSql(*hash opt);
417 
418 
420  string getDropSql();
421 
422 
424  private bool equalImpl(AbstractFunctionBase t);
425 
426 
428  softlist getRenameSql(string new_name);
429 
430  };
431 
434 
435 public:
436  private :
437  string table_name;
438 
439 public:
440 
442  constructor(string n_table_name, string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end);
443 
444 
446  string getCreateSql(*hash opt);
447 
448 
450  string getRenameSql(string new_name);
451 
452 
454  string getDropSql();
455 
456  };
457 
460 
461 public:
462 
463  public :
465  *string tablecatalog;
467  *string checkoption;
469  *string definer;
471  *string securitytype;
472 
473 public:
474 
476  constructor(string n_name, string n_src, *string n_tablecatalog,
477  *string n_schema,
478  *string n_checkoption, *string n_definer,
479  *string n_securitytype, bool n_updatable)
480 ;
481 
482 
484  string getCreateSql(*hash opt);
485 
486 
488  softlist getRenameSql(string new_name);
489 
490  };
491 
494 
495 public:
496  public :
498  const MysqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
499  "sequence_table": Type::String,
500  "sequence_function": Type::String,
501  );
502 
503 
506  "columns": (
507  "name": (
508  "qore_type": SqlUtil::VARCHAR,
509  "size": 40,
510  "notnull": True,
511  ),
512  "id": (
513  "qore_type": Type::Number,
514  "size": 14,
515  "notnull": True,
516  ),
517  ),
518  );
519 
521  const MyusqlCreationOptions = AbstractDatabase::CreationOptions;
522 
524  const MysqlSequenceFunction = "%s(seq_name varchar(40)) returns decimal(14)
525 begin
526  update %s set id = last_insert_id(id + 1) where name = seq_name;
527  return last_insert_id();
528 end";
529 
530 public:
531 
532  private :
533  string schema;
534 
536  Datasource seqds;
537 
538  string sequence_table = "sqlutil_sequences";
539  string sequence_function = "sqlutil_nextval";
540 
541 public:
542 
543  constructor(AbstractDatasource nds, *hash opts);
544 
545 
546  private list featuresImpl();
547 
548 
549  string getSchemaName();
550 
551 
552  private AbstractSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
553 
554 
555  private *AbstractSequence getSequenceImpl(string name);
556 
557 
558  private *AbstractView getViewImpl(string name);
559 
560 
561  private MysqlFunction makeFunctionImpl(string name, string src, *hash opts);
562 
563 
564  private MysqlFunction makeProcedureImpl(string name, string src, *hash opts);
565 
566 
567  private *AbstractFunction getFunctionImpl(string name);
568 
569 
570 
571 private:
572  static string makeParameter(hash row);
573 public:
574 
575 
576  private AbstractFunction getProcedureImpl(string name);
577 
578 
579  private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
580 
581 
582  private list getAlignSqlImpl(hash schema_hash, *hash opt);
583 
584 
586  private list listTablesImpl();
587 
588 
590 
594  private list listFunctionsImpl();
595 
596 
598 
602  private list listProceduresImpl();
603 
604 
605  private list listSequencesImpl();
606 
607 
608  private list listViewsImpl();
609 
610 
611  private string getCreateSqlImpl(list l);
612 
613 
614  static string getCreateSql(list l);
615 
618 
619 
621  private softint getNextSequenceValueImpl(string name);
622 
623 
625  private bool supportsSequencesImpl();
626 
627 
629  private bool supportsTypesImpl();
630 
631 
633  private bool supportsPackagesImpl();
634 
635  };
636 
639 
640 public:
641  public :
643  const MysqlTypeMap = (
644  "decimal": ("qore": Type::Number, "size": SZ_NUM,),
645  "tinyint": ("qore": Type::Int, "ai": True,),
646  "smallint": ("qore": Type::Int, "ai": True,),
647  "mediumint": ("qore": Type::Int, "ai": True,),
648  "int": ("qore": Type::Int, "ai": True,),
649  "bigint": ("qore": Type::Int, "ai": True,),
650  "float": ("qore": Type::Float, "ai": True,),
651  "double": ("qore": Type::Float, "ai": True,),
652 
653  "date": ("qore": Type::Date,),
654  "datetime": ("qore": Type::Date,),
655  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
656  "time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
657  "year": ("qore": Type::Int,),
658 
659  "char": ("qore": Type::String, "size": SZ_MAND,),
660  "varchar": ("qore": Type::String, "size": SZ_MAND,),
661 
662  "binary": ("qore": Type::Binary,),
663  "varbinary": ("qore": Type::Binary,),
664 
665  "tinytext": ("qore": Type::String,),
666  "text": ("qore": Type::String,),
667  "mediumtext": ("qore": Type::String,),
668  "longtext": ("qore": Type::String,),
669 
670  "tinyblob": ("qore": Type::Binary,),
671  "blob": ("qore": Type::Binary,),
672  "mediumblob": ("qore": Type::Binary,),
673  "longblob": ("qore": Type::Binary,),
674 
675  "bit": ("qore": Type::Int,),
676  );
677 
679  const QoreTypeMap = (
680  "integer": "bigint",
681  "float": "double",
682  "number": "decimal",
683  "string": "varchar",
684  "date": "datetime",
685  "binary": "varbinary",
686  "bool": "tinyint",
687  SqlUtil::CHAR: "char",
688  SqlUtil::CLOB: "mediumtext",
689  SqlUtil::BLOB: "mediumblob",
690  );
691 
693  const MysqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
694  "engine": Type::String,
695  );
696 
698 
703  const MysqlColumnDescOptions = AbstractTable::ColumnDescOptions + (
704  "unsigned": Type::Boolean,
705  "auto_increment": Type::Boolean,
706  "pk": Type::Boolean,
707  );
708 
709  const MysqlIndexOptions = AbstractTable::IndexOptions;
710 
711  const MysqlConstraintOptions = AbstractTable::ConstraintOptions + MysqlIndexOptions + (
712  "index": Type::String,
713  );
714 
715  const MysqlTableCreationOptions = AbstractTable::TableCreationOptions + MysqlConstraintOptions;
716 
717  const MysqlAlignTableOptions = AbstractTable::AlignTableOptions + MysqlTableCreationOptions;
718 
721  COP_PREPEND: (
722  "arg": Type::String,
723  "sqlvalue": True,
724  "code": string (string cve, string arg) {
725  return sprintf("concat(%s,%s)", arg, cve);
726  },
727  ),
728  COP_APPEND: (
729  "arg": Type::String,
730  "sqlvalue": True,
731  "code": string (string cve, string arg) {
732  return sprintf("concat(%s,%s)", cve, arg);
733  },
734  ),
735  COP_YEAR: (
736  "code": string (string arg1, any arg) {
737  return sprintf("date_format(%s, '%%Y')", arg1);
738  }
739  ),
740  COP_YEAR_MONTH: (
741  "code": string (string arg1, any arg) {
742  return sprintf("date_format(%s, '%%Y-%%m')", arg1);
743  }
744  ),
745  COP_YEAR_DAY: (
746  "code": string (string arg1, any arg) {
747  return sprintf("date_format(%s, '%%Y-%%m-%%e')", arg1);
748  }
749  ),
750  COP_YEAR_HOUR: (
751  "code": string (string arg1, any arg) {
752  return sprintf("date_format(%s, '%%Y-%%m-%%e %%k')", arg1);
753  }
754  ),
755  );
756 
757 public:
758 
759  private :
760  string schema;
761  string engine = "innodb";
762 
763 public:
764 
765  constructor(AbstractDatasource nds, string nname, *hash opts);
766 
767 
769  string getSqlName();
770 
771 
772  private hash getTableCreationOptions();
773 
774 
775  private hash getTableDescriptionHashOptions();
776 
777 
778  private hash getColumnDescOptions();
779 
780 
781  private hash getIndexOptions();
782 
783 
784  private hash getConstraintOptions();
785 
786 
787  private hash getAlignTableOptions();
788 
789 
791  private hash getColumnOperatorMap();
792 
793 
794  private bool checkExistenceImpl();
795 
796 
797  private Columns describeImpl();
798 
799 
800  private *string getCreatePrimaryKeySqlUnlocked(*hash opt, bool cache = True);
801 
802 
803  private MysqlPrimaryKey getPrimaryKeyImpl();
804 
805 
806  private Indexes getIndexesImpl();
807 
808 
809  private ForeignConstraints getForeignConstraintsImpl(*hash opts);
810 
811 
812  private Constraints getConstraintsImpl();
813 
814 
815  private Triggers getTriggersImpl();
816 
817 
818  string getCreateTableSqlImpl(*hash opt);
819 
820 
821  private *list getCreateMiscSqlImpl(*hash opt, bool cache);
822 
823 
824  private *list getAlignSqlImpl(AbstractTable table, *hash opt);
825 
826 
827  private string getCreateSqlImpl(list l);
828 
829 
830  private string getRenameSqlImpl(string new_name);
831 
832 
833  private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
834 
835 
836  private setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
837 
838 
839  private addColumnToTableUnlocked(AbstractColumn c);
840 
841 
842  private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
843 
844 
845  private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
846 
847 
848  private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
849 
850 
851  private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
852 
853 
854  private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
855 
856 
857  private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
858 
859 
860  private bool tryInsertImpl(string sql, hash row);
861 
862 
863  private hash getQoreTypeMapImpl();
864 
865 
866  private hash getTypeMapImpl();
867 
868 
870  private *string getSqlValueImpl(any v);
871 
872 
874 
875 private:
876  static *string getSqlValueIntern(any v);
877 public:
878 
879 
881 
892  static *string getSqlValue(any v);
893 
894  private bool emptyImpl();
895 
896 
897  private preSetupTableImpl(reference desc, *hash opt);
898 
899 
900  private setupTableImpl(hash desc, *hash opt);
901 
902 
904  private bool constraintsLinkedToIndexesImpl();
905 
906 
908  private bool uniqueIndexCreatesConstraintImpl();
909 
910 
912  private bool supportsTablespacesImpl();
913 
914 
916  private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
917 
918 
920  private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
921 
922 
924  private copyImpl(AbstractTable old);
925 
926  };
927 };
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
softlist getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table ...
const MysqlColumnDescOptions
extends SqlUtil::AbstractTable::ColumnDescOptions with MySQL-specific values
Definition: MysqlSqlUtil.qm.dox.h:703
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:643
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:493
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:720
represents a MySQL view
Definition: MysqlSqlUtil.qm.dox.h:459
const MysqlSequenceTable
MySQL sequence emulation table.
Definition: MysqlSqlUtil.qm.dox.h:505
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:471
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...
string getCreateSql(AbstractTable t)
returns an sql string that can be used to add the column to a table
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:467
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:524
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:693
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:409
private copyImpl(AbstractTable old)
db-specific copy actions
provides the MySQL-specific implementation of the AbstractTable interface
Definition: MysqlSqlUtil.qm.dox.h:638
represents a MySQL-specific primary key constraint
Definition: MysqlSqlUtil.qm.dox.h:339
const COP_YEAR_MONTH
const MyusqlCreationOptions
MySQL creation options.
Definition: MysqlSqlUtil.qm.dox.h:521
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:384
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:469
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:536
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:433
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:257
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:498
*string tablecatalog
table catalog value
Definition: MysqlSqlUtil.qm.dox.h:465
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:679
const COP_APPEND