Module mysql

Imports all of mysql-native.

MySQL to D Type Mappings

MySQL D
NULL typeof(null)
BIT bool
TINY (u)byte
SHORT (u)short
INT24 (u)int
INT (u)int
LONGLONG (u)long
FLOAT float
DOUBLE double

MySQL D
TIMESTAMP DateTime
TIME TimeOfDay
YEAR ushort
DATE Date
DATETIME DateTime

MySQL D
VARCHAR, ENUM, SET, VARSTRING, STRING, NEWDECIMAL string
TINYBLOB, MEDIUMBLOB, BLOB, LONGBLOB ubyte[]
TINYTEXT, MEDIUMTEXT, TEXT, LONGTEXT string
other unsupported (throws)

D to MySQL Type Mappings

D MySQL
typeof(null) NULL
bool BIT
(u)byte (UNSIGNED) TINY
(u)short (UNSIGNED) SHORT
(u)int (UNSIGNED) INT
(u)long (UNSIGNED) LONGLONG
float (UNSIGNED) FLOAT
double (UNSIGNED) DOUBLE
Date DATE
TimeOfDay TIME
Time TIME
DateTime DATETIME
Timestamp TIMESTAMP
string VARCHAR
char[] VARCHAR
(u)byte[] SIGNED TINYBLOB
other unsupported with Variant (throws) or MySQLVal (compiler error)

Note

This by default imports the unsafe version of the MySQL API. Please switch to the safe version (import mysql.safe) as this will be the default in the future. If you would prefer to use the unsafe version, it is advised to use the import mysql.unsafe, as this will be supported for at least one more major version, albeit deprecated.

See the Safe Migration document for more details.