mammoth-cli
mammoth-cli copied to clipboard
Define tables via codegen
Hi, saw you on Twitter
https://github.com/SweetIQ/schemats but for defineTables
would be nice
Hi! Great to hear. Where on Twitter was that?
There is something coming to quickly get you started if you have an existing database schema already. Basically to generate your define table calls from an SQL dump. I was thinking of a command named mammoth setup
. What do you think?
The goal will never be to continuously generate define table calls while you update your sql schema—but only once as a sort of one-time setup. Mammoth's goal is to create a type safe query builder as close to SQL as possible without a build step. We believe this will give the best developer experience.
https://twitter.com/JavaScriptDaily/status/1325212187477090311 @martijndeh 100 likes already, nice 👏
Our current setup is db-migrate
knex
schemats
As you can imagine the flow is kind of meh
- Write
db-migrate
migration - Run
schemats
to generate new db types - Fix
knex
calls due to type errors and pray that something didn't fuck up because it's hard to type knex completely, andpg
is just one of the adapters
mammoth setup
is nice, but also having the ability to run it multiple types would be appriecated, because rewrite to mammoth
in our cause would happen over time, not in one PR
Right, invoking it multiple times for the sake of gradually adopting Mammoth sounds ok. There is a similar request at https://github.com/Ff00ff/mammoth/issues/191.