API ReferenceAdapters
adapter-prisma
Prisma Storage adapter with explicit delegate mappings.
prismaStorage(options)
function prismaStorage(options: PrismaStorageOptions): Storage;options.models is required. Each enabled framework model needs a delegate and logical-field mapping.
import { prismaStorage, type PrismaDelegate } from "@djs-commands/adapter-prisma";
import { GuildPrefixModel } from "@djs-commands/core";
prismaStorage({
models: {
[GuildPrefixModel]: {
delegate: prisma.guildPrefix as PrismaDelegate,
fields: { guild_id: "guildId", prefix: "prefix" },
},
},
});interface PrismaStorageOptions {
models: Partial<Record<FrameworkStorageModel, PrismaModelMapping>>;
}
interface PrismaModelMapping {
delegate: PrismaDelegate;
fields: Record<string, string>;
}Constructor validates required logical fields. It does not query the database.
Last updated on
