|
| 1 | +=================== |
| 2 | +Database Types List |
| 3 | +=================== |
| 4 | + |
| 5 | +Introduction |
| 6 | +============ |
| 7 | + |
| 8 | +The purpose of the Database Type Map is to simplify the process of creating installations for multiple database systems. |
| 9 | +Instead of writing specific installation instructions for each individual database system, you can create a single set of |
| 10 | +instructions and use the Database Type Map to modify any supported database system with just one command. This makes it |
| 11 | +easier and more efficient to work with multiple database systems, as you don't need to write and maintain separate |
| 12 | +instructions for each one. |
| 13 | + |
| 14 | +.. note:: |
| 15 | + |
| 16 | + With some commands you may enter the `Zerofill <https://www.tutorialspoint.com/what-is-the-benefit-of-zerofill-in-mysql>`_, |
| 17 | + example ``INT:11``, if the field is a numeric one. With some you may enter the length of the field, example ``VARCHAR:255``, |
| 18 | + which will make a varchar(255) column in MySQL. In all of the fields supporting this, they will have a colon followed by ``%d`` |
| 19 | + meaning any number may fill the space of the ``%d``. |
| 20 | + |
| 21 | +Numeric |
| 22 | +======= |
| 23 | + |
| 24 | +.. list-table:: |
| 25 | + :widths: 20 20 60 |
| 26 | + :header-rows: 1 |
| 27 | + |
| 28 | + * - Command |
| 29 | + - MySQL Equivalent |
| 30 | + - Storage Range (on MySQL) |
| 31 | + * - TINT:%d |
| 32 | + - tinyint(%d) |
| 33 | + - -128 to 127 |
| 34 | + * - INT:%d |
| 35 | + - int(%d) |
| 36 | + - -2,147,483,648 to 2,147,483,648 |
| 37 | + * - BINT |
| 38 | + - bigint(20) |
| 39 | + - -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808 |
| 40 | + * - USINT |
| 41 | + - smallint(4) UNSIGNED |
| 42 | + - 0 to 65,535 |
| 43 | + * - UINT |
| 44 | + - mediumint(8) UNSIGNED |
| 45 | + - 0 to 16,777,215 |
| 46 | + * - UINT:%d |
| 47 | + - int(%d) UNSIGNED |
| 48 | + - 0 to 4,294,967,295 |
| 49 | + * - ULINT |
| 50 | + - int(10) UNSIGNED |
| 51 | + - 0 to 4,294,967,295 |
| 52 | + |
| 53 | +Decimal |
| 54 | +======= |
| 55 | + |
| 56 | +.. list-table:: |
| 57 | + :widths: 20 20 60 |
| 58 | + :header-rows: 1 |
| 59 | + |
| 60 | + * - Command |
| 61 | + - MySQL Equivalent |
| 62 | + - Storage Range (on MySQL) |
| 63 | + * - DECIMAL |
| 64 | + - decimal(5,2) |
| 65 | + - -999.99 to 999.99 |
| 66 | + * - DECIMAL:%d |
| 67 | + - decimal(%d, 2) |
| 68 | + - -(%d - 2 digits to the left of the decimal).99 to (%d - 2 digits to the left of the decimal).99 |
| 69 | + * - PDECIMAL |
| 70 | + - decimal(6,3) |
| 71 | + - -999.999 to 999.999 |
| 72 | + * - PDECIMAL:%d |
| 73 | + - decimal(%d,3) |
| 74 | + - -(%d - 3 digits to the left of the decimal).999 to (%d - 3 digits to the left of the decimal).999 |
| 75 | + |
| 76 | +Text |
| 77 | +==== |
| 78 | + |
| 79 | +These should only be used for ASCII characters. If you plan to use it for something like message text read the Unicode Text section |
| 80 | + |
| 81 | +.. list-table:: |
| 82 | + :widths: 20 20 60 |
| 83 | + :header-rows: 1 |
| 84 | + |
| 85 | + * - Command |
| 86 | + - MySQL Equivalent |
| 87 | + - Explain |
| 88 | + * - VCHAR |
| 89 | + - varchar(255) |
| 90 | + - text for storing 255 characters (normal input field with a max of 255 chars) |
| 91 | + * - VCHAR:%d |
| 92 | + - varchar(%d) |
| 93 | + - text for storing %d characters (normal input field with a max of %d chars) |
| 94 | + * - CHAR:%d |
| 95 | + - char(%d) |
| 96 | + - text for storing up to 30 characters (normal input field with a max of 30 chars) |
| 97 | + * - XSTEXT |
| 98 | + - text |
| 99 | + - text for storing 100 characters |
| 100 | + * - STEXT |
| 101 | + - text |
| 102 | + - text for storing 255 characters |
| 103 | + * - TEXT |
| 104 | + - text |
| 105 | + - text for storing 3000 characters |
| 106 | + * - MTEXT |
| 107 | + - mediumtext |
| 108 | + - (post text, large text) |
| 109 | + |
| 110 | +Unicode Text |
| 111 | +============ |
| 112 | + |
| 113 | +.. list-table:: |
| 114 | + :widths: 20 20 60 |
| 115 | + :header-rows: 1 |
| 116 | + |
| 117 | + * - Command |
| 118 | + - MySQL Equivalent |
| 119 | + - Explain |
| 120 | + * - VCHAR_UNI |
| 121 | + - varchar(255) |
| 122 | + - text for storing 255 characters (normal input field with a max of 255 single-byte chars) |
| 123 | + * - VCHAR_UNI:%d |
| 124 | + - varchar(%d) |
| 125 | + - text for storing %d characters (normal input field with a max of %d single-byte chars) |
| 126 | + * - XSTEXT_UNI |
| 127 | + - varchar(100) |
| 128 | + - text for storing 100 characters (topic_title for example) |
| 129 | + * - STEXT_UNI |
| 130 | + - varchar(255) |
| 131 | + - text for storing 255 characters (normal input field with a max of 255 single-byte chars) |
| 132 | + * - TEXT_UNI |
| 133 | + - text |
| 134 | + - text for storing 3000 characters (short text, descriptions, comments, etc.) |
| 135 | + * - MTEXT_UNI |
| 136 | + - mediumtext |
| 137 | + - (post text, large text) |
| 138 | + |
| 139 | +Miscellaneous |
| 140 | +============= |
| 141 | + |
| 142 | +.. list-table:: |
| 143 | + :widths: 20 20 60 |
| 144 | + :header-rows: 1 |
| 145 | + |
| 146 | + * - Command |
| 147 | + - MySQL Equivalent |
| 148 | + - Explain |
| 149 | + * - BOOL |
| 150 | + - tinyint(1) UNSIGNED |
| 151 | + - Storing boolean values (true/false) |
| 152 | + * - TIMESTAMP |
| 153 | + - int(11) UNSIGNED |
| 154 | + - For storing UNIX timestamps |
| 155 | + * - VCHAR_CI |
| 156 | + - varchar(255) |
| 157 | + - varchar_ci for postgresql, others VCHAR |
| 158 | + * - VARBINARY |
| 159 | + - varbinary(255) |
| 160 | + - Binary storage |
0 commit comments