Fivetrex.Models.Table (Fivetrex v0.2.1)

View Source

Represents a table within a schema configuration.

Tables contain the actual data being synced. Each table can have its own sync mode and column configuration.

Fields

  • :name_in_destination - The name used in the destination warehouse
  • :enabled - Whether this table is being synced
  • :sync_mode - How data changes are handled:
    • "SOFT_DELETE" - Deleted rows are marked with _fivetran_deleted
    • "HISTORY" - Historical tracking with _fivetran_start/_fivetran_end
    • "LIVE" - Real-time sync (deletes are hard deletes)
  • :supports_columns_config - Whether per-column configuration is supported
  • :enabled_patch_settings - Advanced patch settings
  • :columns - Map of column name to Fivetrex.Models.Column structs

Sync Modes

The sync mode determines how Fivetran handles data modifications:

ModeInsertsUpdatesDeletes
SOFT_DELETEAppendedIn-placeMarked with flag
HISTORYNew rowNew rowEnd timestamp set
LIVEAppendedIn-placeHard deleted

Examples

# Check sync mode
case table.sync_mode do
  "SOFT_DELETE" -> "Deleted rows are marked, not removed"
  "HISTORY" -> "Full history is preserved"
  "LIVE" -> "Deletes are permanent"
end

Summary

Types

t()

A Fivetran Table struct.

Functions

Converts a map (from JSON response) to a Table struct.

Types

t()

@type t() :: %Fivetrex.Models.Table{
  columns: %{required(String.t()) => Fivetrex.Models.Column.t()} | nil,
  enabled: boolean() | nil,
  enabled_patch_settings: map() | nil,
  name_in_destination: String.t() | nil,
  supports_columns_config: boolean() | nil,
  sync_mode: String.t() | nil
}

A Fivetran Table struct.

All fields may be nil if not provided in the API response.

Functions

from_map(map)

@spec from_map(map()) :: t()

Converts a map (from JSON response) to a Table struct.