Why doesn’t Prisma automatically default to either...
# orm-help
k
Why doesn’t Prisma automatically default to either
TABLE
or
INLINE
for relation (whatever was the default behaviour before the syntax change)?
m
Hey @kitze 👋 , in the old Datamodel we used to have only one setting behind the scenes. It was always
TABLE
. In the new Datamodel we are applying a default based on the arity of the Relation for our SQL connectors. These are the defaults: - default to
TABLE
for many-to-many relations - default to
INLINE
on the right side for one-to-many relations - no default for one-to-one relations since both sides equally make sense PS: I assume you are talking about our SQL connectors.
Does that answer your question? 🙂
k
@marcus I understand that, what I don’t understand and why am I forced to choose one now when the defaults worked fine for me
it’s just bloating the datamodel
and it’s not letting me deploy if I don’t specify table or inline
m
@kitze: so your specific concern is about one-to-one relations where we don’t have a default at the moment?
And just to explain our reasoning behind that change: Very often we got the feedback that our approach to always use relation tables for everything was not desirable for performance reasons. We do not default to
TABLE
because changing that setting later on to
INLINE
will result in data loss. What would be your perfect solution? Should there be a global setting to always default to the
TABLE
setting?
k
@marcus Makes sense. A global setting would be great
👍 2
m
Persisted in a feature request: https://github.com/prisma/prisma/issues/4456 We are currently discussing internally how we could implement this.