[FeatureRequest] generate defineTable ts code with mammoth-cli
So we can include it in our build process.
And based on what should the defineTable() calls be generated? Your database schema or your migrations or what are you thinking?
> mammoth generate -c postgres://localhost/my_db -o src/tables.ts
# Now my_db should have a table 'migration' and with a migration record. And comes out two files 'migrations/001.sql' and 'src/tables.ts'
Well, in this use case, we don't need to include it in ci.
Right, so you want to generate all your defineTable() calls based your existing schema.
Question: when you introduce a new table, how do you do that? Do you not write your own defineTable call? Or do you only want to generate the defineTable calls once so you can more easily start using Mammoth?
There are just 2 development mode:
- Manage the database schema with other things. Use
mammoth generateand integrate with CI to help development; - Manage the database schema with
mammoth migrate. I think we can havemammoth test -c postgres://localhost/my_dbin CI to check if anyone modify database schema.