Columns
Columns define the fields in your tables. Each column defines the structure and type of information that can be stored for every row (record) in the table.
Adding a column
Select a table, then click Add Column in the left panel (or press Ctrl+Enter / Cmd+Enter). The new column is added at the bottom of the table.
Properties
Each column row in the left panel shows four inline controls:
Name — column name
Data type — click the type field to search and select from available types for your database driver. Some types accept parameters shown in parentheses—like varchar(255) for length, or decimal(8,2) for precision and scale. PostgreSQL types can also have an array suffix (e.g., text[], int[][]).
Nullable — toggle the N button. Shows a "?" on the canvas when the column is nullable.
Key type — use the key dropdown to set Primary key, Unique, Index, or None.
Attributes
Click the more (...) button on a column to open the attributes panel. The available options depend on the selected data type and database driver.
Column default
Set the value the database assigns when no value is provided on insert. Available for all data types.
DrawSQL automatically infers the type, whether your default value is a SQL function, number, or string literal. As you type, a badge appears showing how the value will be interpreted:
Function — SQL expressions like now(), uuid_generate_v4(), or CURRENT_TIMESTAMP. These export without quotes.
Number — Numeric values like 123 or 0 for numeric/boolean columns. These export without quotes.
String — Text literals like pending or N/A. These export with quotes.
The allowed types depend on the DBMS: PostgreSQL allows any custom functions, while MySQL and SQL Server only recognize specific built-in functions. To force a function name or number to be treated as a string literal, wrap it in single quotes—'now()' becomes the string now() instead of the SQL function.
Auto increment
MySQL only. Automatically assigns incrementing numeric values—typically used for primary key columns. Only available for integer types (bigint, int, mediumint, smallint).
Auto Increment / Identity
For MySQL, enable the Auto increment checkbox on integer column types (bigint, int, smallint, tinyint). This exports as AUTO_INCREMENT in the generated DDL.
For SQL Server, the checkbox is labeled Identity and exports as IDENTITY. By default, the seed and increment are both 1. To customize them, click the (1,1) label next to the checkbox to configure seed and increment.
Unsigned
MySQL only. Restricts an integer column to positive values only, doubling the positive range. Only available for integer types.
Enum values
When the enum data type is selected, a textarea appears for defining the allowed values. Enter them as a comma-separated list.
Set values
MySQL only. Similar to enum, but allows storing multiple values simultaneously. Enter allowed values as a comma-separated list when the SET data type is selected.
Array type
PostgreSQL only. Marks a column as an array type, allowing it to store multiple values of the same type (e.g., text[], int[][]).
Comment
An optional description for the column. When present, a chat bubble icon appears next to the column on the canvas.
Reordering
Drag columns using the handle that appears on hover to reorder them within a table.
Notes
Deleting a column also removes its relationships and indexes.
Changing a data type automatically resets incompatible attributes (e.g., auto-increment is cleared for non-numeric types).