it depends on the language. On C# (entity framework) the tool Microsoft.EntityFrameworkCore.Tools allow "scaffold" the code
In Java, IntelliJ Ideas allows generating the classes from the database.
Netbeans and Eclipse also have plugins that do this job.
In PHP (Laravel) there are model generators from the database.
Python Django has inspectdb that also does the job.