Closed ebebbington closed 2 years ago
Happy to work on a pr should you agree
Hi @ebebbington ! For the first part: Do you mean that we should have a way to automatically generate seed files for the migrations we create? For the second part: we could add an optional property to the config object for auto adding the deps file, and I am happy to review PRs!
Hi @ebebbington ! For the first part: Do you mean that we should have a way to automatically generate seed files for the migrations we create? For the second part: we could add an optional property to the config object for auto adding the deps file, and I am happy to review PRs!
Yeah, kinda, it applies to both seeders and migrations i guess, it's a matter of being able to specify the 'skeleton sql query' in the run()
method, so nessie would try get the type of query and table name from the path, eg create_users_table
may result in this.client.queryArray('CREATE table users')
but after thinking about it, is this really worth it?
To be honest, i think it's better to auto adding to deps.ts be the default, because im sure the high majority of people dont use imports from urls in a file other than deps.ts
@ebebbington Finally a weekend where I have time to look over issues 😅
I will have some more time coming up to review PR's and issues, but I won't be adding any more code for the time being (except for deps version updates), so feel free to submit a PR!
@ebebbington Custom migration and seed templates are now available in Nessie 2.0.4. Let me know if this is sufficient for this issue 😄
The Idea
I think it would be nice to add some more foundation into these files when they are created, just to save the developer a bit more time, eg creating a migration would result in
Also it'd be nice for the imports to use a local deps.ts, most people use a
deps.ts
at root level so i think it'll be safe to doimport { ... } from "../../deps.ts"
, this does shave off some time for the user and makes it's that bit more faster to create a migration or seed