RS
Size: a a a
RS
IB
Repo.insert(..., foo_id: 123)
У меня на этот foo_id есть not null констрейнт, нужный foo с таким id в базе существуетIB
foo_id
должно быть не в opts кейвордом, а в struct/changeset, который идет первым аргументомIB
Ecto.build_assoc(foo, :relation) |> Relation.changeset(params) |> Repo.insert()
%Relation{} |> Relation.changeset(%{ foo_id: 123, ...}) |> Repo.insert()
IB
cast/4
в Relation.changeset/2
МБ
Base.decode64("AAAAAEgFyxVMX7hw5Oo3Bw")
:error
RS
RS
RS
IB
NP
Ecto.build_assoc(foo, :relation) |> Relation.changeset(params) |> Repo.insert()
%Relation{} |> Relation.changeset(%{ foo_id: 123, ...}) |> Repo.insert()
NP
NP
MY
h Kernel.spawn
NP
MY
NP
NP
Foo |> Repo.all() |> Repo.preload(bar: :baz)
AB
m
stream(queryable :: Ecto.Queryable.t(), opts :: Keyword.t()) :: Enum.t()