prisma-prefixed-ids 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.d.ts +1 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,11 @@ const prefixes: Partial<Record<ModelName, string>> = {
|
|
|
37
37
|
const extendedPrisma = extendPrismaClient(prisma, {
|
|
38
38
|
prefixes,
|
|
39
39
|
});
|
|
40
|
+
// NOTE: if typing is an issue, simply override the
|
|
41
|
+
// return type to be the original `PrismaClient`:
|
|
42
|
+
// const extendedPrisma = extendPrismaClient(prisma, {
|
|
43
|
+
// prefixes,
|
|
44
|
+
// }) as unknown as PrismaClient
|
|
40
45
|
|
|
41
46
|
// Use the extended client
|
|
42
47
|
const organization = await extendedPrisma.organization.create({
|
package/dist/index.d.ts
CHANGED
|
@@ -24,9 +24,7 @@ export declare function createPrefixedIdsExtension<ModelName extends string>(con
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
export declare function extendPrismaClient<ModelName extends string = string, Client extends
|
|
28
|
-
$extends: (extension: any) => any;
|
|
29
|
-
} = PrismaClient>(prisma: Client, config: PrefixConfig<ModelName>): ReturnType<Client["$extends"]>;
|
|
27
|
+
export declare function extendPrismaClient<ModelName extends string = string, Client extends PrismaClient = PrismaClient>(prisma: Client, config: PrefixConfig<ModelName>): Client;
|
|
30
28
|
export declare function getDMMF(clientOrContext: PrismaClient | any): any;
|
|
31
29
|
export declare function getModelNames(prismaClient: PrismaClient): string[];
|
|
32
30
|
export {};
|