Skip to main content

Foundations: Data Types

The Data Types tab is your type library — a catalog of data types that carry business meaning beyond basic storage types like "string" or "integer."

metrics-definition

Why Semantic Data Types?

Every database has basic types: strings, integers, dates, booleans. But these don't tell you what the data means. A "string" column could be an email address, a phone number, a country code, or a product name — all of which have very different rules and behaviors.

Semantic data types add that business context:

Basic TypeSemantic TypeWhat It Adds
stringEmailMust be a valid email format
stringPhoneNumberPhone number formatting and validation
decimalCurrencyMonetary value with currency awareness
stringURLMust be a valid URL format
stringUUIDUniversally unique identifier format
dateBirthDateA date that represents someone's date of birth

When you assign a semantic type to an attribute in your Object Types, the platform automatically knows how to validate, display, and handle that data.

Built-in Types

Datalinx comes with two categories of built-in types:

Base Types

The fundamental storage types that match your database:

  • string, text — text values
  • integer, bigint — whole numbers
  • float, double, decimal — decimal numbers
  • boolean — true/false
  • date, datetime, timestamp, time — temporal values
  • json — structured JSON data
  • uuid — universally unique identifiers

Semantic Types

Pre-built types with business meaning:

  • Email — validated email addresses
  • PhoneNumber — phone numbers with format awareness
  • Amount / Currency — monetary values
  • URL — web addresses
  • Percentage — values representing percentages
  • Country / Region — geographic identifiers

(The exact list depends on your Datalinx configuration.)

Custom Data Types

You can create your own semantic types for domain-specific needs.

Creating a Custom Type

  1. Click Add Data Type
  2. Choose a parent type to inherit from (a base type or an existing semantic type)
  3. Give it a name and description
  4. Add optional constraints:
    • Allowed values — a specific list of acceptable values (e.g., a status field that must be "active", "inactive", or "suspended")
    • Pattern — a regex pattern the value must match
    • Min / Max — numeric boundaries

Examples of Custom Types

Custom TypeInherits FromConstraints
OrderStatusstringAllowed values: pending, confirmed, shipped, delivered, cancelled
SubscriptionTierstringAllowed values: free, basic, premium, enterprise
ConfidenceScoredecimalMin: 0, Max: 1
USZipCodestringPattern: ^\d{5}(-\d{4})?$

Using Data Types

Once defined, data types are used when creating attributes in your Object Types:

  1. Go to the Object Types tab
  2. Add or edit an attribute
  3. Select a data type from the dropdown — you'll see both base types and semantic types
  4. The selected type determines validation and display behavior

Tips

  • Prefer semantic types over base types whenever possible — they make your data model self-documenting
  • Create custom types for domain-specific values (like status codes, tier levels, or region codes) — this enforces consistency across your entire data model
  • Good data types reduce errors downstream — if an attribute is typed as Email, you'll catch invalid values early
  • The Foundations Agent can suggest appropriate data types: "What type should I use for a customer loyalty score that ranges from 0 to 100?"