Data Types

All SQL data types available for table fields in Datasquirel.

Overview

Every field in a Datasquirel table has a data type that defines what kind of values the column can store. Datasquirel is built on MariaDB, so all standard MariaDB column types are supported.

Choosing the right data type matters for:

  • Storage efficiency — smaller types use less disk space
  • Query performance — properly typed columns are faster to index and compare
  • Data integrity — the database enforces type constraints automatically

Text Types

TypeDescription
VARCHAR(n)Variable-length string up to n characters. Use for short text like names, slugs, email addresses. Maximum n is 65,535.
TEXTUnlimited-length text. Use for longer content like descriptions or comments.
LONGTEXTVery large text (up to 4 GB). Use for HTML, Markdown, or JSON stored as a string.
CHAR(n)Fixed-length string of exactly n characters. Padded with spaces if shorter.
ENUM(...)A value from a predefined list (e.g. ENUM('draft', 'published', 'archived')).

Numeric Types

TypeDescription
INT32-bit signed integer. Range: –2,147,483,648 to 2,147,483,647.
BIGINT64-bit signed integer. Use for IDs that may exceed 2 billion or for large counts.
TINYINT8-bit integer. Range: –128 to 127. Commonly used for boolean-like flags.
SMALLINT16-bit integer. Range: –32,768 to 32,767.
FLOATSingle-precision floating-point number.
DOUBLEDouble-precision floating-point number.
DECIMAL(p, s)Exact decimal with p total digits and s decimal places. Use for money values.

Date and Time Types

TypeDescription
DATETIMEA date and time value (e.g. 2024-03-15 14:30:00).
DATEA date without time (e.g. 2024-03-15).
TIMEA time without date (e.g. 14:30:00).
TIMESTAMPA Unix timestamp. Automatically updates to the current time on row modification when configured.

Boolean

MariaDB does not have a native BOOLEAN type. Datasquirel uses TINYINT(1) for boolean fields — 1 for true, 0 for false.

Structured Data

TypeDescription
JSONNative JSON column. MariaDB validates and stores the value as structured JSON.
LONGTEXTStore JSON, Markdown, or HTML as plain text when native JSON validation is not needed.