zachdaniel

zachdaniel

Creator of Ash

Ash and AshPostgres generators/installers, built with igniter are available on main!
I’ll be very grateful to anyone willing to give them a shot and report back with there experience.

Keep in mind, things will absolutely break. Not only are these brand new generators, but they are an entirely new kind of generator. For more on igniter, see this thread: Igniter - A code generation and project patching framework

Commands to dive in with!

Install the archive

mix archive.install hex igniter_new

Create a new app and install dependencies into it

We use the github dependencies here so that you can use the new installers, which are only available on main currently.

mix igniter.new app_name \
  --install ash@github:ash-project/ash

Or install multiple dependencies at once. iterex in this example doesn’t have an installer (as it doesn’t need one), so it just gets added to the mix.exs file with no other changes

# as a csv
mix igniter.new app_name \
  --install iterex,ash@github:ash-project/ash,ash_postgres@github:ash-project/ash_postgres
# in multiple flags
mix igniter.new app_name \
  --install iterex \
  --install ash@github:ash-project/ash \
  --install ash_postgres@github:ash-project/ash_postgres

Or, modify an existing app!

first, add igniter to your mix.exs

defp deps do
  [
    {:igniter, "~> 0.2"}
  ]
end

Install dependencies

mix igniter.install ash@github:ash-project/ash

Install dependencies with example code!

mix igniter.install ash@github:ash-project/ash --example

Generate a resource

mix ash.gen.resource Twitter.Tweets.Tweet \
  --uuid-primary-key id \
  --attribute text:string:required:public

And generate another one, see how the domain is modified to reference the newly created resource?

mix ash.gen.resource Twitter.Tweets.Like \
  --uuid-primary-key id \
  --relationship belongs_to:tweet:Twitter.Tweets.Tweet:required:public

Generate a resource using a specific extension!

You will want to install ash_postgres first for this to work:

mix igniter.install ash_postgres@github:ash-project/ash_postgres
mix ash.gen.resource Twitter.Tweets.Tweet \
  --uuid-primary-key id \
  --attribute text:string:required:public
  --extend postgres

Modify an existing resource to use a new extension

swap its data layer to use ets

mix ash.extend Twitter.Tweets.Tweet ets

And swap it back to use postgres

mix ash.extend Twitter.Tweets.Tweet postgres

Or add a new extension

mix ash.extend Twitter.Tweets.Tweet Ash.Policy.Authorizer

There are a couple more generators you can play with like mix ash.gen.enum, but I think this is enough to get started.

Happy hacking :sunglasses:

Showing Posts 1 to 6

ghannam80

ghannam80

Got the below error while running :

mix igniter.new app_name \
  --install ash@github:ash-project/ash
  • Getting ash (GitHub - ash-project/ash: A declarative, extensible framework for building Elixir applications. · GitHub)
    remote: Enumerating objects: 44617, done.
    remote: Counting objects: 100% (1646/1646), done.
    remote: Compressing objects: 100% (1099/1099), done.
    remote: Total 44617 (delta 613), reused 1544 (delta 536), pack-reused 42971
    origin/HEAD set to main
    error: invalid path ‘documentation/dsls/DSL:-Ash.DataLayer.Ets.md’
    error: invalid path ‘documentation/dsls/DSL:-Ash.DataLayer.Mnesia.md’
    error: invalid path ‘documentation/dsls/DSL:-Ash.Domain.md’
    error: invalid path ‘documentation/dsls/DSL:-Ash.Notifier.PubSub.md’
    error: invalid path ‘documentation/dsls/DSL:-Ash.Policy.Authorizer.md’
    error: invalid path ‘documentation/dsls/DSL:-Ash.Reactor.md’
    error: invalid path ‘documentation/dsls/DSL:-Ash.Resource.md’
    ** (Mix) Command “git --git-dir=.git checkout --quiet origin/HEAD” failed
    mix deps.get returned exited with code: 1
zachdaniel

zachdaniel OP

Creator of Ash

Interesting…can you please open an issue on the igniter GH repo?

If anyone else is getting that same error please let me know as well.

EDIT: I’m unable to reproduce it. Are you on windows?

ghannam80

ghannam80

Yes , i am on Windows 11

zachdaniel

zachdaniel OP

Creator of Ash

Hmm…I think this issue is unrelated to igniter in that case. If you were to make a fresh project and point a mix dependency at github, you’d likely encounter this same issue. You’ll probably need to wait until we release proper hex version to try these out in that case, sorry about that :cry:

albin

albin

Congrats on the beta release

Tried using uuidv7 with --uuid-v7-primary-key id but noticed that it fails silently, and generates a resource without a primary key.

Then noticed that it also silently ignores any unknown/typo-ed parameters

Could you make it error out instead of silently ignoring unknown params in this case?

TIA

zachdaniel

zachdaniel OP

Creator of Ash

This is actually kind of a tough one because of the way that we pass arguments down into nested generators :thinking: I will see what I can do :slight_smile:

— All posts loaded —

Where Next? Top

Trending in News & Updates Top

Jskalc
LiveVue v1.0 released After four release candidates and a lot of community feedback, LiveVue 1.0 is stable :tada: I’ve built a dedicated...
New
bartblast
Hologram v0.12 is out! This one is for the big apps. Evo Store, Hologram’s Performance Sponsor, has an app with over 9,000 Elixir modules...
New
zachdaniel
Your standard application generally only tracks what is true right now. Updates overwrite previous data, and asking questions about the p...
New
woylie
<span class="hashtag-icon-placeholder"></span>let-me 3.0.4 has been released. Changed Log the policy module and the check module in the...
New
woylie
Flop Phoenix 0.27.0 has been released. Changed Require Flop 0.29.0, which turns Flop.Schema from a protocol into a behaviour. Determin...
New
kyroco
VitalAIze 0.3.0 is out. It puts your other machines on your team on the board, live. I changed the architecture and am using gRPC to stre...
New
woylie
Flop 0.29.0 has been released. Added Add Flop.allowed_fields/2, which returns the fields that may be filtered or sorted for the given ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews