colType

Specify an alternate column type. This is possibly specific to the database engine. By default the engine picks the type based on the field type. This only has any bearing when creating tables.

This does NOT affect parameter types, and should still be something that properly serializes to/from the given D type. For example, a string field could be adjusted to be VARCHAR(10) instead of TEXT. Use a specialized type to convert between different D types.

struct colType {}

Members

Variables

type
string type;
Undocumented in source.

Examples

import sqlbuilder.uda;
import sqlbuilder.dialect.mysql;
static struct table
{
    @colType("VARCHAR(10)") string name;
}

assert(createTableSql!table ==
       "CREATE TABLE `table` (`name` VARCHAR(10) NOT NULL)");

Meta