Selecto.ViewPublisher (Selecto v0.4.3)

Validates Selecto-authored published view specs before any DDL generation.

This keeps publication constraints separate from ordinary runtime query validation so domains can register stable SQL view contracts explicitly.

Link to this section Summary

Link to this section Types

Link to this type

publish_result()

@type publish_result() ::
  {:ok,
   %{
     sql: String.t(),
     ddl: String.t(),
     kind: atom(),
     database_name: String.t(),
     index_statements: [String.t()]
   }}
  | {:error, [String.t()]}
Link to this type

refresh_result()

@type refresh_result() :: :ok | {:error, term()}
Link to this type

validation_result()

@type validation_result() :: :ok | {:error, [String.t()]}

Link to this section Functions

Link to this function

build_sql(domain, spec)

@spec build_sql(Selecto.Types.domain(), map()) :: publish_result()
Link to this function

ddl_for(atom, database_name, sql)

@spec ddl_for(atom(), String.t(), String.t()) :: String.t()
Link to this function

index_statements(spec)

@spec index_statements(map()) :: [String.t()]
Link to this function

refresh(domain, spec, adapter, connection, opts \\ [])

@spec refresh(Selecto.Types.domain(), map(), module(), term(), keyword()) ::
  refresh_result()
Link to this function

refresh_sql(database_name, opts \\ [])

@spec refresh_sql(
  String.t(),
  keyword()
) :: String.t()
Link to this function

validate(domain, spec)

@spec validate(Selecto.Types.domain(), map()) :: validation_result()