:wave: I'm just getting started with Prisma, and t...
# prisma-client
d
👋 I'm just getting started with Prisma, and trying to write a seed script. When I try the following, I receive an error that
createMany
does not exist. Anyone know what might be the issue there?
Copy code
const providers = await prisma.provider.createMany({
  data: [
    { name: "Twitter" },
    { name: "Github" },
    { name: "YouTube" }
  ]
});
My model (sqlite db):
Copy code
model Provider {
  id            Int        @id @default(autoincrement())
  name          String
  activities    Activity[]
}
Client ver: 3.11.0
Copy code
Running seed command `ts-node --compiler-options {"module":"CommonJS"} prisma/seed.ts` ...
/Users/dmarr/code/personal-site/node_modules/ts-node/src/index.ts:820
    return new TSError(diagnosticText, diagnosticCodes);
           ^
TSError: ⨯ Unable to compile TypeScript:
prisma/seed.ts:5:43 - error TS2339: Property 'createMany' does not exist on type 'ProviderDelegate<RejectOnNotFound | RejectPerOperation | undefined>'.

5   const providers = await prisma.provider.createMany({
                                            ~~~~~~~~~~
And if I convert things to JS:
Copy code
TypeError: prisma.provider.createMany is not a function
c
What’s the type of prisma.provider when you click into it?
d
get provider(): Prisma.ProviderDelegate<GlobalReject>;
c
What’s in your ProviderDelegate?
d
The
ProviderDelegate
interface does not have
createMany
Is this a sqlite3 limitation maybe?
c
Oh nvm
yeah it is
•
createMany
is not supported by SQLite.
d
ugh! haha
I totally missed that. And I was reading the docs
Thank you for pointing it out Casey
c
ofc!