-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Why
InjectionToken<T>
is a way to make string/symbol based injection to be typesafe. So, instead of making:
export const DRIZZLE_TOKEN = 'DRIZZLE'
I want to do this:
import type { InjectionToken } from "@nestjs/common";
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
export const DRIZZLE_PROVIDER_TOKEN: InjectionToken<NodePgDatabase<any>> = "DRIZZLE";
So, then if I inject this token with module.get(DRIZZLE_PROVIDER_TOKEN)
I get at least somewhat proper interface and not just any
What
Currently InjectDrizzle(tag: string)
accepts only string, the same as DrizzlePGModule.registerAsync
. Both must accept typesafe InjectionToken
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request