Hi guys, I switched from pure Xandra to Trition ORM and I really enjoy to work with it so far.
But now I’m facing the following problem:
when I want to execute batch analogically as in docs
Docs
[
User |> update(username: "username1") |> where(user_id: 1),
User |> update(username: "username2") |> where(user_id: 2),
User |> update(username: "username3") |> where(user_id: 3),
User |> update(username: "username4") |> where(user_id: 4)
] |> User.batch_execute
My batch
[
Schema.Tables.UserByEmail
|> prepared(
email: payload.email,
type: @email_primary,
user_id: user_id
)
|> insert(
email: :email,
type: :type,
user_id: :user_id
)
]
|> Triton.Executor.batch_execute
I’m getting this error:
(FunctionClauseError) no function clause matching in Xandra.Batch.add/3
Althoug the params passing to the function are:
Xandra.Batch.add(#Xandra.Batch<[type: :logged, queries: []]>, {:ok, #Xandra.Prepared<"INSERT INTO user_by_email (email, type, user_id) VALUES (:email, :type, :user_id)">}, [email: "some@email", type: "SOME_TYPE", user_id: "some_user_id"])
Can please someone help? :))
Thanks in advance