Tech TutorBangla Web Documentation
Portfolio
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • PrismaPostgres Documentation40টি অধ্যায়
প্রযুক্তি নির্বাচন
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • Prisma Intro
  • Prisma vs Raw SQL
  • Setup & Install
  • Schema Basics
  • Models
  • Relations
  • Migrations
  • Prisma Client
  • Create & Upsert
  • Read Queries
  • Update & Delete
  • Query Filters
  • Sort & Pagination
  • Select & Include
  • Nested Writes
  • Transactions
  • Aggregation
  • JSON Fields
  • Raw SQL
  • TechShop Schema
  • TechShop Seed
  • Relations Advanced
  • Env Config
  • Global Client
  • Next.js + Prisma
  • Express API
  • Error Handling
  • Performance
  • Connection Pool
  • Prisma Studio
  • Deploy Migrations
  • TechShop Indexes
  • TechShop Cart
  • TechShop Stats API
  • Schema Evolution
  • Debugging
  • Common Mistakes
  • Best Practices
  • Interview Questions
  • Recap & Next
  1. Docs
  2. PrismaPostgres
  3. create, createMany, upsert
PrismaPostgresIntermediate

create, createMany, upsert

insert একক বা বাল্ক — আর conflict-এ update।

4টি অংশবাংলা ভাষায়
await prisma.user.create({
  data: { email: "a@b.com", name: "Anamul" },
});

await prisma.product.createMany({
  data: [
    { name: "Mechanical Keyboard", price: 4200 },
    { name: "Wireless Mouse", price: 1800 },
  ],
});
upsertts
ts
await prisma.product.upsert({
  where: { name: "Wireless Mouse" },
  update: { qty: { increment: 5 } },
  create: { name: "Wireless Mouse", price: 1800, qty: 5 },
});

upsert — where-এ unique field; পেলে update, না পেলে create। increment — atomic relative update।

upsert কী

upsert-এ where-র key unique/NOT NULL হতে হবে — না হলে Prisma error (P2025)।

শেষ প্যারায় নিজে practice করুন — কোড কপি করে নিজের এডিটরে চালিয়ে দেখুন।
আগেরClient instantiate ও প্রথম queryপরেরfindUnique, findFirst, findMany
Tech Tutor

বাংলায় ওয়েব ডেভেলপমেন্ট ডকুমেন্টেশন শিখুন — ধাপে ধাপে।

Homeসব ডকুমেন্টেশনQuick Startআমার নোটস

© 2026 Tech Tutor. বাংলায় শিখুন, বাংলায় গড়ুন।

mdanamolhasan1998@gmail.com