Import Customer CSV Data With Prisma Without Making Prisma Understand Spreadsheets

Prisma gives your application a typed way to work with your database.

That is exactly why your import flow should produce application-shaped data before Prisma receives it.

A customer's spreadsheet does not know about your Prisma model.

Bootstrapware Importer translates the spreadsheet-facing problem into normalized rows your application can reason about.

Spreadsheet schema and application schema are different things

Your Prisma model might contain firstName, lastName, email, company.

The customer's file might contain First, Family Name, Work Email, Organisation.

The mapping step reconciles those two schemas.

Validation then catches predictable problems before your API starts creating records.

Keep Prisma on the server

An importer running in the browser does not mean database logic belongs in the browser.

Browser: parse → map → validate → return normalized data
Server: authenticate → authorize → business rules → Prisma create / createMany / upsert → handle results

That separation keeps database credentials and privileged operations where they belong.

Example write

Align Importer field keys with Prisma model fields (or map explicitly in the Route Handler):

await prisma.contact.createMany({
  data: rows.map((row) => ({
    email: String(row.email),
    name: row.name == null ? null : String(row.name),
  })),
  skipDuplicates: true,
});

You still decide how records are written

Bootstrapware does not choose whether you should create every row, upsert on email, reject existing records, wrap inserts in a transaction, queue a background job, or process in batches.

Those are application decisions.

skipDuplicates is not a substitute for clear UI errors. Use duplicateKey and error export when you want customers to fix in-file duplicates before they hit Prisma.

The importer solves the part you otherwise have to expose to the customer: getting messy spreadsheet input into a predictable shape.

That is a smaller product on purpose.

Related: Importer · Fields · Duplicates · Postgres · Validate before insert