OptionaloptionsArg: Subset<ClientOptions, Prisma.PrismaClientOptions>const prisma = new PrismaClient()
// Fetch zero or more Guilds
const guilds = await prisma.guilds.findMany()
Read more in our docs.
prisma.apis: Exposes CRUD operations for the Apis model.
prisma.buildInCommands: Exposes CRUD operations for the BuildInCommands model.
prisma.disBot: Exposes CRUD operations for the DisBot model.
prisma.discordGuildAddon: Exposes CRUD operations for the DiscordGuildAddon model.
prisma.giveaways: Exposes CRUD operations for the Giveaways model.
prisma.guildAutoDeletes: Exposes CRUD operations for the GuildAutoDeletes model.
prisma.guildAutoPublish: Exposes CRUD operations for the GuildAutoPublish model.
prisma.guildAutoReacts: Exposes CRUD operations for the GuildAutoReacts model.
prisma.guildAutoRoles: Exposes CRUD operations for the GuildAutoRoles model.
prisma.guildBackups: Exposes CRUD operations for the GuildBackups model.
prisma.guildChannelLinks: Exposes CRUD operations for the GuildChannelLinks model.
prisma.guildCommandManger: Exposes CRUD operations for the GuildCommandManger model.
prisma.guildComponentManager: Exposes CRUD operations for the GuildComponentManager model.
prisma.guildDisBotAutoModeration: Exposes CRUD operations for the GuildDisBotAutoModeration model.
prisma.guildDisBotAutoModerationAttachments: Exposes CRUD operations for the GuildDisBotAutoModerationAttachments model.
prisma.guildDisBotAutoModerationBlockedWords: Exposes CRUD operations for the GuildDisBotAutoModerationBlockedWords model.
prisma.guildDisBotAutoModerationBlockInvites: Exposes CRUD operations for the GuildDisBotAutoModerationBlockInvites model.
prisma.guildDisBotAutoModerationBlockLinks: Exposes CRUD operations for the GuildDisBotAutoModerationBlockLinks model.
prisma.guildDisBotAutoModerationEmojis: Exposes CRUD operations for the GuildDisBotAutoModerationEmojis model.
prisma.guildDisBotAutoModerationMentions: Exposes CRUD operations for the GuildDisBotAutoModerationMentions model.
prisma.guildDisBotAutoModerationMessages: Exposes CRUD operations for the GuildDisBotAutoModerationMessages model.
prisma.guildFeatureToggles: Exposes CRUD operations for the GuildFeatureToggles model.
prisma.guildInteractionPermissions: Exposes CRUD operations for the GuildInteractionPermissions model.
prisma.guildLeaveSetup: Exposes CRUD operations for the GuildLeaveSetup model.
prisma.guildLogging: Exposes CRUD operations for the GuildLogging model.
prisma.guildLogs: Exposes CRUD operations for the GuildLogs model.
prisma.guildModeration: Exposes CRUD operations for the GuildModeration model.
prisma.guilds: Exposes CRUD operations for the Guilds model.
prisma.guildSecurity: Exposes CRUD operations for the GuildSecurity model.
prisma.guildSpotifyNotifications: Exposes CRUD operations for the GuildSpotifyNotifications model.
prisma.guildTwitchNotifications: Exposes CRUD operations for the GuildTwitchNotifications model.
prisma.guildUserModeration: Exposes CRUD operations for the GuildUserModeration model.
prisma.guildUserModerationSettingBan: Exposes CRUD operations for the GuildUserModerationSettingBan model.
prisma.guildUserModerationSettingMute: Exposes CRUD operations for the GuildUserModerationSettingMute model.
prisma.guildUserModerationSettingUnban: Exposes CRUD operations for the GuildUserModerationSettingUnban model.
prisma.guildUserModerationSettingUnmute: Exposes CRUD operations for the GuildUserModerationSettingUnmute model.
prisma.guildUserModerationSettingUnwarn: Exposes CRUD operations for the GuildUserModerationSettingUnwarn model.
prisma.guildUserModerationSettingWarn: Exposes CRUD operations for the GuildUserModerationSettingWarn model.
prisma.guildUserModerationSettinKick: Exposes CRUD operations for the GuildUserModerationSettinKick model.
prisma.guildWelcomeSetup: Exposes CRUD operations for the GuildWelcomeSetup model.
prisma.guildYoutubeNotifications: Exposes CRUD operations for the GuildYoutubeNotifications model.
prisma.leaveImageData: Exposes CRUD operations for the LeaveImageData model.
prisma.levelRoles: Exposes CRUD operations for the LevelRoles model.
prisma.levels: Exposes CRUD operations for the Levels model.
prisma.levelSettings: Exposes CRUD operations for the LevelSettings model.
prisma.messageTemplates: Exposes CRUD operations for the MessageTemplates model.
prisma.moderationScout: Exposes CRUD operations for the ModerationScout model.
prisma.moderationScoutCases: Exposes CRUD operations for the ModerationScoutCases model.
prisma.moderationScoutForms: Exposes CRUD operations for the ModerationScoutForms model.
prisma.moderationScoutFormsData: Exposes CRUD operations for the ModerationScoutFormsData model.
prisma.moderationScoutReportModalData: Exposes CRUD operations for the ModerationScoutReportModalData model.
prisma.moderationScoutReports: Exposes CRUD operations for the ModerationScoutReports model.
prisma.moderationScoutUserAppeals: Exposes CRUD operations for the ModerationScoutUserAppeals model.
prisma.pollAnswers: Exposes CRUD operations for the PollAnswers model.
prisma.pollOptions: Exposes CRUD operations for the PollOptions model.
prisma.polls: Exposes CRUD operations for the Polls model.
prisma.syncedChannelLinkMessages: Exposes CRUD operations for the SyncedChannelLinkMessages model.
prisma.tempVoiceChannels: Exposes CRUD operations for the TempVoiceChannels model.
prisma.tempVoices: Exposes CRUD operations for the TempVoices model.
prisma.ticketFeedback: Exposes CRUD operations for the TicketFeedback model.
prisma.ticketModalData: Exposes CRUD operations for the TicketModalData model.
prisma.ticketPermissions: Exposes CRUD operations for the TicketPermissions model.
prisma.tickets: Exposes CRUD operations for the Tickets model.
prisma.ticketSetups: Exposes CRUD operations for the TicketSetups model.
prisma.users: Exposes CRUD operations for the Users model.
prisma.vanityAnalytic: Exposes CRUD operations for the VanityAnalytic model.
prisma.vanityAnalyticsLatest30Day: Exposes CRUD operations for the VanityAnalyticsLatest30Day model.
prisma.vanityEmbed: Exposes CRUD operations for the VanityEmbed model.
prisma.vanityEmbedAuthor: Exposes CRUD operations for the VanityEmbedAuthor model.
prisma.vanitys: Exposes CRUD operations for the Vanitys model.
prisma.verificationGates: Exposes CRUD operations for the VerificationGates model.
prisma.verificationGatesPermission: Exposes CRUD operations for the VerificationGatesPermission model.
prisma.welcomeImageData: Exposes CRUD operations for the WelcomeImageData model.
prisma.xPDrops: Exposes CRUD operations for the XPDrops model.
prisma.xPStreaks: Exposes CRUD operations for the XPStreaks model.
Connect with the database
Disconnect from the database
Executes a prepared raw query and returns the number of affected rows.
const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
Read more in our docs.
Executes a raw query and returns the number of affected rows. Susceptible to SQL injections, see documentation.
const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
Read more in our docs.
Performs a prepared raw query and returns the SELECT data.
const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
Read more in our docs.
Performs a raw query and returns the SELECT data.
Susceptible to SQL injections, see documentation.
const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
Read more in our docs.
Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
Optionaloptions: { isolationLevel?: Prisma.TransactionIsolationLevel }const [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])
Read more in our docs.
Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
Optionaloptions: {const [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])
Read more in our docs.
Prisma Client ʲˢ
Type-safe database client for TypeScript & Node.js
Example
Read more in our docs.