Prisma Client 跨語言和資料庫無縫運作。透過減少 SQL 程式碼來加速交付。使用專為您的應用程式量身打造的完全型別安全 API,避免錯誤。
Prisma Client
從簡單的讀取到複雜的巢狀寫入,Prisma Client 支援廣泛的操作,協助您充分利用資料。
1// Find all posts2const allPosts: Post[] = await prisma.post.findMany()
1// Find a user by ID2const userById: User | null = await prisma.user.findUnique({3 where: {4 id: 2,5 },6})
1// Find a user by email2const userByEmail = await prisma.user.findUnique({3 where: {4 email: 'ada@prisma.io',5 },6})
1// Find the first user that contains Ada2const userByName = await prisma.user.findFirst({3 where: {4 name: {5 contains: 'Ada',6 },7 },8})
1// Select specific fields2const userName = await prisma.user.findUnique({3 where: {4 email: 'ada@prisma.io',5 },6 select: {7 name: true,8 email: true,9 },10})
最好的程式碼是能夠自我編寫的程式碼。Prisma Client 為您提供絕佳的自動完成體驗,讓您可以快速行動,並確保您不會寫出無效的查詢。我們對型別安全的執著意味著您可以安心地確保您的程式碼每次都能如預期般運作。
5 分鐘開始使用直接對您的資料庫執行 SQL 查詢,而不會失去 Prisma 的型別檢查和自動完成的好處。TypedSQL 利用 Prisma Client 的功能來編寫在編譯時進行型別檢查的原始 SQL 查詢。
深入了解 TypedSQLPrisma studio
Prisma Studio 是探索和操作 Prisma 專案中資料的最簡單方法。透過瀏覽表格、篩選、分頁、遍歷關聯以及安全地編輯資料來了解您的資料。
深入了解 Prisma StudioPrisma migrate
Prisma Migrate 從您的 Prisma Schema 自動產生 SQL 遷移。這些遷移檔案是完全可自訂的,讓您從本機開發到生產環境都能完全掌控和極致的靈活性。
探索 Prisma Migrate