sezaru
I have a resource that has an atom attribute that can’t be nil:
attribute :cbsa_category, :atom do
allow_nil? false
constraints one_of: [:metropolitan, :micropolitan, :unknown]
end
Here is that resource create action:
create :create_in_temp do
change fn changeset, _ ->
Ash.Changeset.set_context(changeset, %{data_layer: %{schema: "temp"}})
end
end
When i try to insert a bunch of rows to that resource using bulk_create and one of the data contains a nil cbsa_category field, the query itself will rollback, but Ash will return no error:
Pacman.Markets.bulk_create(a, Pacman.Markets.CBSABuyBox, :create_in_temp, return_records?: false, return_errors?: true)
[debug] QUERY OK db=0.3ms idle=1450.9ms
begin []
[debug] QUERY ERROR source="cbsa_buy_boxes" db=0.9ms
INSERT INTO "temp"."cbsa_buy_boxes" ("id","inserted_at","updated_at","entity_id","cbsa_code","cbsa_category","cbsa_name","financing_types","maximum_buy_price","maximum_property_bathrooms","maximum_property_bedrooms","maximum_property_building_area","maximum_property_lot_square_feet","maximum_property_year_built","maximum_sell_price","minimum_buy_price","minimum_property_bathrooms","minimum_property_bedrooms","minimum_property_building_area","minimum_property_lot_square_feet","minimum_property_year_built","minimum_sell_price","property_types","strategies","transactions_ids") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25),($26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50),($51,$52,$53,$54,$55,$56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70,$71,$72,$73,$74,$75),($76,$77,$78,$79,$80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100),($101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114,$115,$116,$117,$118,$119,$120,$121,$122,$123,$124,$125),($126,$127,$128,$129,$130,$131,$132,$133,$134,$135,$136,$137,$138,$139,$140,$141,$142,$143,$144,$145,$146,$147,$148,$149,$150) [...]
%Ash.BulkResult{
status: :success,
errors: [],
records: nil,
notifications: [],
error_count: 0
}
[debug] QUERY OK db=0.3ms
rollback []
I’m using Ash version 2.20.3 and ash_postgres version 1.5.22
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
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
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
Hmm…that is definitely strange…it must be the rollback case? Can you open an issue on
ash_postgres? Will look into it soon.sezaru
Done: Ash.bulk_create returns success when the insert fails and rollback · Issue #226 · ash-project/ash_postgres · GitHub
sezaru
Hey @zachdaniel , I know you are very busy right now with the Ash 3.0 RC, but did you took a look into this issue? Since it is a silent issue, I believe this could be affecting other people besides me but they are not even realizing it since there will be no error being triggered.
zachdaniel
Yes, I actually started looking into it about 30 minutes ago. Should have a fix soon.
zachdaniel
Should be fixed in Ash
2.21.3