Data Types
All SQL data types available for table fields in Datasquirel.
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
| Type | Description |
|---|
VARCHAR(n) | Variable-length string up to n characters. Use for short text like names, slugs, email addresses. Maximum n is 65,535. |
TEXT | Unlimited-length text. Use for longer content like descriptions or comments. |
LONGTEXT | Very 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')). |
| Type | Description |
|---|
INT | 32-bit signed integer. Range: –2,147,483,648 to 2,147,483,647. |
BIGINT | 64-bit signed integer. Use for IDs that may exceed 2 billion or for large counts. |
TINYINT | 8-bit integer. Range: –128 to 127. Commonly used for boolean-like flags. |
SMALLINT | 16-bit integer. Range: –32,768 to 32,767. |
FLOAT | Single-precision floating-point number. |
DOUBLE | Double-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
| Type | Description |
|---|
DATETIME | A date and time value (e.g. 2024-03-15 14:30:00). |
DATE | A date without time (e.g. 2024-03-15). |
TIME | A time without date (e.g. 14:30:00). |
TIMESTAMP | A Unix timestamp. Automatically updates to the current time on row modification when configured. |
MariaDB does not have a native BOOLEAN type. Datasquirel uses TINYINT(1) for boolean fields — 1 for true, 0 for false.
| Type | Description |
|---|
JSON | Native JSON column. MariaDB validates and stores the value as structured JSON. |
LONGTEXT | Store JSON, Markdown, or HTML as plain text when native JSON validation is not needed. |