SelectoMix

Alpha software. Generation flows are usable but still evolving.

selecto_mix is the tooling package for setting up Selecto in an Elixir project.

Use it when you want to:

Installation

def deps do
  [
    {:selecto_mix, ">= 0.4.2 and < 0.5.0"},
    {:selecto, ">= 0.4.3 and < 0.5.0"},
    {:selecto_db_postgresql, ">= 0.4.2 and < 0.5.0"},
    {:postgrex, ">= 0.0.0"},
    {:ecto, "~> 3.10"}
  ]
end

Then run:

mix igniter.install selecto_mix
mix assets.build

For local multi-repo workspace development:

mix selecto.install --development-mode --source your-github-user

Quick Start

Generate a domain from one schema:

mix selecto.gen.domain MyApp.Catalog.Product

Generate domains for all schemas:

mix selecto.gen.domain --all

Generate a domain plus LiveView wiring:

mix selecto.gen.domain MyApp.Catalog.Product --live

Core Workflow

Recommended workflow:

  1. Generate the base domain from your Ecto schema.
  2. Keep schema-derived structure in the generated file.
  3. Put custom filters, columns, and named functions in overlays when possible.
  4. Re-run generation when schemas change.

That keeps generated structure and user-authored behavior separate.

Common Tasks

UDF Workflow

Generated domains now include a stable functions: %{} section.

Generated overlays include deffunction examples so named function registrations can live outside regenerated files.

Recommended UDF pattern:

  1. generate the domain
  2. keep structural metadata in the generated domain file
  3. add custom deffunction definitions in the overlay
  4. regenerate safely as schemas evolve

Status

Current 0.4.x scope:

Demos And Tutorials