I have never seen an ORM in my life that didn't reduce the total amount of code written. Not even the Java monstrosities increased the SLOC.
IMO:
.where('column_a', '=', 'value1')
.and(q => q.isNull('column_b').orWhere('column_b', '=', 'value2')))
is a lot less readable than: WHERE
column_a = 'value1'
AND (column_b IS NULL OR column_b = 'value2')And obviously you can use whatever indentations you like.
- No keyword arguments
- No operator overloading (so you can't override | to get the nice "or" syntax)
In JS, theoretically you could design an API like
.where({column_a: 1}, Q(column_b__isnull=True).or({column_b: 2}))
Which really isn't bad IMO
filter( Q(column_b__isnull=True)|Q(column_b='value2'),
column_a='value1',
)
Or just turn it into another Q .filter(Q(column_a='value1'), Q(column_b__isnull=True)|Q(column_b='value2')) .filter(Q(column_a='value1') & (Q(column_b__isnull=True) | Q(column_b='value2')))