You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make config more forgiving. We oftentimes import wathog-decorated model classes in external independent data loaders, and it's a bit awkward to set WARTHOG_* env variables just to be able to use the classes (as config() is picked up through the decorators and throws an error if the warthog env variables are not set). It would be nice (but not strictly necessary) to be able to pack the model classes into a lightweight dependency with only typeorm decorators
In 3.0 I've changed the metadata pipeline to instead write the metadata properties onto the class and then subsequently read them when I'm doing codegen:
import { User } from '01-simple-model/dist/user.model'
import { getManager } from 'typeorm'
async function createUser() {
const u = new User()
await getManager().save<User>(u)
}
createUser().catch((e) => console.error(e)).then(() => console.log('Done'))
The code above should work without WARTHOG_* variables being set (but the db with the typeorm defaults should be accepting connections)
Make config more forgiving. We oftentimes import wathog-decorated model classes in external independent data loaders, and it's a bit awkward to set WARTHOG_* env variables just to be able to use the classes (as config() is picked up through the decorators and throws an error if the warthog env variables are not set). It would be nice (but not strictly necessary) to be able to pack the model classes into a lightweight dependency with only typeorm decorators
CC @dzhelezov
The text was updated successfully, but these errors were encountered: