RaisFastRaisFast
Content Types

Field Types

17 field types, common options, type-specific configuration, and validation rules.

Content Types support 17 field types. Each field is defined as [[fields]] with a field_type and optional constraints.

Field Type Reference

TypeSQLiteMySQLPostgreSQLUse For
textTEXTVARCHAR(255)VARCHAR(255)Short text — titles, names, URLs
richtextTEXTTEXTTEXTLong-form content — HTML, Markdown
integerINTEGERINTINTEGER32-bit whole numbers
bigintINTEGERBIGINTBIGINT64-bit whole numbers
decimalTEXTDECIMAL(16,4)NUMERIC(16,4)Precise decimals — prices, amounts
floatREALDOUBLEDOUBLE PRECISIONFloating-point numbers
booleanBOOLEANTINYINT(1)BOOLEANTrue / false flags
dateTEXTDATEDATEDate values (ISO 8601)
datetimeTEXTDATETIMETIMESTAMPTZ(0)Timestamps (ISO 8601)
timeTEXTTIMETIMETZTime values (ISO 8601)
emailTEXTVARCHAR(255)VARCHAR(255)Email addresses (format-validated)
passwordTEXTVARCHAR(255)VARCHAR(255)Password strings
enumTEXTVARCHAR(255)VARCHAR(255)Fixed value list
uidTEXTVARCHAR(255)VARCHAR(255)Auto-generated slug / UID
jsonTEXTJSONJSONBArbitrary structured data
mediaTEXTVARCHAR(255)VARCHAR(255)File / image uploads
relationINTEGERBIGINTBIGINTRelated record reference

Common Options

All field types share these options:

[[fields]]
name = "title"
field_type = "text"
required = true
unique = true
default = "Untitled"
private = false
immutable = false
label = "Title"
description = "The display title"
max_length = 200
min = 0
max = 100
pattern = "^[A-Z]"
OptionTypeDefaultDescription
requiredboolfalseMust be provided on create
uniqueboolfalseDatabase uniqueness constraint
defaultanyDefault value (string, number, bool, null)
privateboolfalseHidden from public API, visible in admin API
immutableboolfalseCannot be changed after creation
labelstringDisplay label for admin UI
descriptionstringField description
max_lengthintMaximum string length
minfloatMinimum numeric value
maxfloatMaximum numeric value
patternstringRegex validation pattern

Type-Specific Options

enum

Must provide enum_values:

[[fields]]
name = "priority"
field_type = "enum"
enum_values = ["low", "medium", "high"]
default = "medium"

uid

Auto-generates a URL-safe slug from another field:

[[fields]]
name = "slug"
field_type = "uid"
target_field = "title"
unique = true

media

Control accepted file types and count:

[[fields]]
name = "cover"
field_type = "media"
media_config = { accept = ["image/*"], max_count = 1 }
OptionDescription
acceptArray of MIME type patterns (e.g. ["image/*", "application/pdf"])
max_countMaximum number of files (default: 1)

relation

See Relations for the full guide.

[[fields]]
name = "author"
field_type = "relation"
relation = { relation_type = "many_to_one", target = "users" }

Validation Rules

The system validates input automatically on every create and update:

CheckWhenHow
requiredCreateField must exist and be non-null / non-empty
immutableUpdateField must not be present in the update payload
type checkCreate / UpdateValue type must match field type
enum_valuesCreate / UpdateValue must be in the allowed list
max_lengthCreate / UpdateString length must not exceed limit
min / maxCreate / UpdateNumeric range validation
patternCreate / UpdateValue must match the regex
uniqueCreate / UpdateDB uniqueness check (excludes self on update)

Validation errors return 422 Unprocessable Entity with field-level details:

{
  "error": "Validation failed",
  "details": {
    "email": "must be a valid email address",
    "age": "must be greater than or equal to 18"
  }
}

Indexes

Define database indexes separately from fields:

[[indexes]]
fields = ["slug"]
unique = true

[[indexes]]
fields = ["status", "created_at"]
OptionTypeDescription
fieldsstring[]Column names to index
uniqueboolWhether the index is unique (default: false)

On this page