thojanssens1

thojanssens1 OP

Thank you, great example.

Actually I think now that insert_all should not accept Schemas, because this leads to brittle code; its usage seems limited.

Imagine you change the source of a field like your example above, or imagine you change the types of timestamps, … changes required may be forgotten or hard to find. What do you think?

It then seems that insert_all & co seem more fit for scripts.

0
Post #11
LostKobrakai

LostKobrakai

Actually I think now that insert_all should not accept Schemas, because this leads to brittle code; its usage seems limited.

Imagine you change the source of a field like your example above, or imagine you change the types of timestamps, … changes required may be forgotten or hard to find. What do you think?

That’s exactly the reason, why Repo.insert does only accept schema structs and not plain maps.

It then seems that insert_all & co seem more fit for scripts.

Not necessarily, but it’s for sure more low level.

2
Post #12
— All posts loaded —