OptionaloptionsArg: Prisma.Subset<ClientOptions, Prisma.PrismaClientOptions>const prisma = new PrismaClient()
// Fetch zero or more Profiles
const profiles = await prisma.profile.findMany()
Read more in our docs.
prisma.adminCurrencySettings: Exposes CRUD operations for the AdminCurrencySettings model.
prisma.appointment: Exposes CRUD operations for the Appointment model.
prisma.cmsBanner: Exposes CRUD operations for the CmsBanner model.
prisma.cmsCategory: Exposes CRUD operations for the CmsCategory model.
prisma.cmsCategoryBanner: Exposes CRUD operations for the CmsCategoryBanner model.
prisma.cmsFeaturedItem: Exposes CRUD operations for the CmsFeaturedItem model.
prisma.cmsFooterContent: Exposes CRUD operations for the CmsFooterContent model.
prisma.cmsPageBanner: Exposes CRUD operations for the CmsPageBanner model.
prisma.cmsPages: Exposes CRUD operations for the CmsPages model.
prisma.cMSPartnerSection: Exposes CRUD operations for the CMSPartnerSection model.
prisma.cmsPopup: Exposes CRUD operations for the CmsPopup model.
prisma.cmsPromotionalCard: Exposes CRUD operations for the CmsPromotionalCard model.
prisma.cmsSettings: Exposes CRUD operations for the CmsSettings model.
prisma.cmsThemeSetting: Exposes CRUD operations for the CmsThemeSetting model.
prisma.commissionSettings: Exposes CRUD operations for the CommissionSettings model.
prisma.commissionTransaction: Exposes CRUD operations for the CommissionTransaction model.
prisma.liveSessionMessage: Exposes CRUD operations for the LiveSessionMessage model.
prisma.liveSessionParticipant: Exposes CRUD operations for the LiveSessionParticipant model.
prisma.liveSessionProduct: Exposes CRUD operations for the LiveSessionProduct model.
prisma.liveShoppingSession: Exposes CRUD operations for the LiveShoppingSession model.
prisma.manufacturerOrder: Exposes CRUD operations for the ManufacturerOrder model.
prisma.notification: Exposes CRUD operations for the Notification model.
prisma.onboardingRequirement: Exposes CRUD operations for the OnboardingRequirement model.
prisma.onboardingReview: Exposes CRUD operations for the OnboardingReview model.
prisma.onboardingSubmission: Exposes CRUD operations for the OnboardingSubmission model.
prisma.order: Exposes CRUD operations for the Order model.
prisma.orderItem: Exposes CRUD operations for the OrderItem model.
prisma.passwordResetRequest: Exposes CRUD operations for the PasswordResetRequest model.
prisma.payment: Exposes CRUD operations for the Payment model.
prisma.paymentMethod: Exposes CRUD operations for the PaymentMethod model.
prisma.paymentProviderSettings: Exposes CRUD operations for the PaymentProviderSettings model.
prisma.product: Exposes CRUD operations for the Product model.
prisma.productCategory: Exposes CRUD operations for the ProductCategory model.
prisma.profile: Exposes CRUD operations for the Profile model.
prisma.review: Exposes CRUD operations for the Review model.
prisma.roleAuditLog: Exposes CRUD operations for the RoleAuditLog model.
prisma.service: Exposes CRUD operations for the Service model.
prisma.serviceAppointment: Exposes CRUD operations for the ServiceAppointment model.
prisma.serviceCategory: Exposes CRUD operations for the ServiceCategory model.
prisma.serviceReview: Exposes CRUD operations for the ServiceReview model.
prisma.shipment: Exposes CRUD operations for the Shipment model.
prisma.shipmentStatusUpdate: Exposes CRUD operations for the ShipmentStatusUpdate model.
prisma.staff: Exposes CRUD operations for the Staff model.
prisma.staffAssignment: Exposes CRUD operations for the StaffAssignment model.
prisma.ticket: Exposes CRUD operations for the Ticket model.
prisma.ticketAuditLog: Exposes CRUD operations for the TicketAuditLog model.
prisma.ticketCategory: Exposes CRUD operations for the TicketCategory model.
prisma.ticketConversation: Exposes CRUD operations for the TicketConversation model.
prisma.ticketResponse: Exposes CRUD operations for the TicketResponse model.
prisma.vendorScheduleSlot: Exposes CRUD operations for the VendorScheduleSlot model.
prisma.wishlist: Exposes CRUD operations for the Wishlist 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?: 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