Fivetrex.Models.SchemaConfig (Fivetrex v0.2.1)

View Source

Represents the schema configuration for a Fivetran connector.

Schema configuration controls which schemas, tables, and columns are synced from your data source to your destination. This struct contains the hierarchical configuration of all database objects.

Structure

The configuration follows a nested hierarchy:

SchemaConfig
   schemas (map of Schema by name)
         tables (map of Table by name)
               columns (map of Column by name)

Fields

  • :enable_new_by_default - Whether newly discovered schemas/tables are enabled by default
  • :schema_change_handling - How to handle schema changes:
    • "ALLOW_ALL" - All new schemas/tables/columns are included
    • "ALLOW_COLUMNS" - New schemas/tables excluded, new columns included
    • "BLOCK_ALL" - All new items excluded from syncs
  • :schemas - Map of schema name to Fivetrex.Models.Schema structs

Examples

Working with schema configuration:

{:ok, config} = Fivetrex.Connectors.get_schema_config(client, "connector_id")

# Iterate through enabled schemas
for {name, schema} <- config.schemas, schema.enabled do
  IO.puts("Schema: #{name}")

  for {table_name, table} <- schema.tables, table.enabled do
    IO.puts("  Table: #{table_name}")
  end
end

See Also

Summary

Types

t()

A Fivetran Schema Configuration struct.

Functions

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

Types

t()

@type t() :: %Fivetrex.Models.SchemaConfig{
  enable_new_by_default: boolean() | nil,
  schema_change_handling: String.t() | nil,
  schemas: %{required(String.t()) => Fivetrex.Models.Schema.t()} | nil
}

A Fivetran Schema Configuration 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 SchemaConfig struct.

Recursively parses nested schemas, tables, and columns.

Parameters

  • map - A map with string keys from a decoded JSON response

Returns

A %Fivetrex.Models.SchemaConfig{} struct with nested Schema structs.