C
C
calculator2122021-01-23 11:24:34
go
calculator212, 2021-01-23 11:24:34

What approach to use when writing code for crud in a database with a lot of tables?

Most examples of working with a database show working with 1-2 tables, and I thought about how to write
code correctly for cases when you need to change data in 10-20 or 100-200 tables, it is unlikely that for each of the 200 tables they
write several functions for adding/removing records. If possible, then throw off an example project from github for example.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Mamonov, 2021-01-23
@calculator212

I am using a custom code generator.
First, I describe the data model, run the console command, and at the output I get a ready-made set of functions for working with the table.
There are many ready-made generators, you can look on the Internet and choose which one you like best.
Here is a good article with examples
https://medium.com/@zaurio/generator-the-client-to...

D
d-stream, 2021-01-23
@d-stream

You can use an additional level - implement CRUD within sp subd and operate at this level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question