Caravela.Schema.Entity (Caravela v0.13.2)

Copy Markdown View Source

A domain entity (table).

frontend selects the render transport for generated UI: :live (default) emits LiveView + WebSocket; :rest emits a controller + Inertia-style HTTP response via caravela_svelte.

realtime? opts the entity into SSE-driven live updates on top of :rest. Only valid when frontend: :rest — a :live entity already has LiveView's WebSocket for real-time. Generated controllers publish broadcast_patch/3 on create / update / delete when this flag is set.

Summary

Types

frontend()

@type frontend() :: :live | :rest

t()

@type t() :: %Caravela.Schema.Entity{
  auth: Caravela.Schema.AuthConfig.t() | nil,
  fields: [Caravela.Schema.Field.t()],
  frontend: frontend(),
  name: atom(),
  realtime?: boolean()
}