Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Prisma · Function

prisma.create

create() inserts one new database record through a generated Prisma Client model delegate. Supply the record values under data; nested writes can create related records in the same operation.

How it works

Call the generated model delegate's create method with a data object containing the values for the new record. Prisma inserts the record and resolves the call with the created record; nested create values can add related records in the same operation.

Syntax

prisma.<model>.create({ data: { ... } })

Parameters

NameTypeDescription
argsUserCreateArgs (model-specific)Object containing the values for the new record, including optional nested relation writes and query options documented for the model delegate.
dataUserCreateInput | UserUncheckedCreateInputValues to insert for the selected model; required and optional fields are determined by the Prisma schema.

Returns

A promise resolving to the newly created record, shaped by the selected model and any select/include options.

Key points

  • The model delegate's create method inserts a new record.
  • Nested create is supported under both parent creation and parent update operations.
  • A minimal call supplies the model's required values inside the data property.

Example: Create a user

import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

const user = await prisma.user.create({
  data: {
    email: "alice@prisma.io",
    name: "Alice",
  },
});

console.log(user);

Creates one User record and returns the created object.

When to use it

Create a single record

Insert one model instance when the application has collected the required field values.

Create related records

Create a parent and associated child records in one nested write.

Nest creation in an update

Add related records while modifying an existing parent.

Interview questions

QWhat does Prisma Client's create() method do?

create() inserts one new database record. It receives arguments such as data, and the returned promise resolves to the created record.

Follow-up: How can one operation create related records? Use a nested create inside the parent operation, which can add a related record or set of records.

QWhich fields must be supplied to create()?

The required fields come from the Prisma schema, while generated fields such as an id can be assigned automatically. The create call therefore only needs to provide fields that the schema requires from the caller.

Follow-up: How would you create several related records? Use nested create or nested createMany; use nested createMany when its supported options, such as duplicate skipping, are needed.

QWhen is nested create useful?

A nested create can be used when creating a new parent or updating an existing parent. It adds related records as part of that parent write.

Follow-up: What limitation distinguishes nested createMany? Relations cannot be accessed in a createMany query, so it cannot create multiple users and multiple posts as one nested write.

  • createMany()
  • update()
  • include
  • select
  • connect

Source: Prisma Client API (Prisma ORM v7). Checked 2026-10-16.