获取动态数据库模型的静态类型(使用自动迁移)

I am wondering if there is a way using Golang or Java, to generate DB models from the DB itself, and also get static typing from those generated models.

For example, using the Loopback framework for Node.js, we can generate models (in the form of JSON files) from DB tables/structures, but I don't think you can get static typing for that, even with TypeScript.

I'd like a relational ORM that is more performant/sophisticated than Loopback and has static typing, but I can't seem to find that.

You can only do with gorm tool of gorilla webkit from code environment to generate db models so vice versa is not possible. I think that there is not framework like Loopback for Node.js specified for Golang.