Skip to content

Commit

Permalink
Merge branch 'main' into docs-restructure-links-check
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasburk committed Nov 28, 2023
2 parents fdfffed + d97c5bd commit 701465d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The SQLite connector maps the [scalar types](/concepts/components/prisma-schema/

> Alternatively, see [Prisma schema reference](/reference/api-reference/prisma-schema-reference#model-field-scalar-types) for type mappings organized by Prisma type.
### Native type mapping from Prisma to MySQL
### Native type mapping from Prisma to SQLite

| Prisma | SQLite |
| ---------- | ------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ const prismaClientSingleton = () => {
return new PrismaClient()
}

type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>

const globalForPrisma = globalThis as unknown as {
prisma: PrismaClientSingleton | undefined
declare global {
var prisma: undefined | ReturnType<typeof prismaClientSingleton>
}

const prisma = globalForPrisma.prisma ?? prismaClientSingleton()
const prisma = globalThis.prisma ?? prismaClientSingleton()

export default prisma

if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma
```

You can extend Prisma Client using a Prisma Client extension by appending the `$extends` client method when instantiating Prisma Client as follows:
Expand Down

0 comments on commit 701465d

Please sign in to comment.