M
M
Maga Izdaga2021-07-16 01:26:35
Backend
Maga Izdaga, 2021-07-16 01:26:35

Why should a backend be able to write database queries?

The main tool of any backend developer is a framework (not counting the programming language, of course), and almost every one of them has functions that themselves write a query to the database, I don’t remember what they are called. Say, instead of writing a request to select from all records according to some rule, for example in Django, you can simply write {model name}.objects.filter(parameters). So here the question emerges: why do you need to be able to write queries to the database in principle? Maybe I don't understand something?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DevMan, 2021-07-16
@MagaVTanke

yes, you don't understand.
The junk you don't remember is called ORM. and it is really enough for typical tasks.
problems arise when ORM capabilities are not enough. and/or you need to design a database from scratch and with tricky cascades.
a typical example: importing data that is needed exclusively for reading.
yes, you can make several hundred models for them and drive them into them.
or you can simply drive them into the database, process them raw, and use only the necessary data. That's what you need to know about queries.

I
Ilya, 2021-07-16
@sarapinit

In order not to remain in the eternal junas with a narrow specialization. There will come a time when the autogenerated query will run slowly or it will gobble up a lot of memory in a busy place. Do not call the senior developer every time at such moments.

D
dooMoob, 2021-07-16
@dooMoob

Well good luck writing something harder {model}.objects.filter(parameters) without the ability to write direct sql queries

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question