Menu

Post image 1
Post image 2
1 / 2
0

I Got Tired of Writing CRUD by Hand, So I Built a Go Code Generator from a Database

DEV Community·alexey.zh·23 days ago
#YASnx6R3
#why#database#go#rest#table#products
Reading 0:00
15s threshold

Writing business logic can be interesting. Writing yet another REST wrapper around a table is not. Never. Ever. This is not software development; it is digital sock knitting. Except the socks then need to be covered with tests, documented, wrapped into DTOs, passed through a service, a repository, a handler, a mapper, a payload, and, preferably, completed without crying in the process. Imagine a very ordinary situation. A DBA adds a new table to the database. From the SQL side, everything is beautiful: a clean schema, proper indexes, relationships, constraints, the whole package. The DBA is happy. The database is happy. Somewhere far away, a tiny bird is singing. Meanwhile, the backend developer realizes two things: They now need to create a controller, service, repository, interfaces, CRUD implementation, entity, DTO, payload, mappers, documentation, and probably something else, because “that is how we do things here.” They urgently need to reconsider their career path. Maybe become a painter. Or a baker.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More