Skip to content

PrismaService

Defined in: packages/database/src/prisma.service.ts:55

Profile-aware Prisma client.

Boot semantics:

  • profile=lite: the client is built, and $connect() is invoked on first DB op (lazy). The profile expects Postgres to be reachable at runtime, so the constructor does not throw when DATABASE_URL is missing — it is validated lazily on first use.
  • profile=standard (default): eager $connect() so misconfigured deployments fail loudly at startup.

The eager/lazy toggle is driven entirely by the DEPLOYMENT_PROFILE env var so callers do not need to know about the toggle; the service just does the right thing.

  • PrismaClient
  • OnModuleInit
  • OnModuleDestroy

[K: symbol]: object

new PrismaService(): PrismaService

Defined in: packages/database/src/prisma.service.ts:60

PrismaService

PrismaClient.constructor

$extends: ExtendsHook<"extends", TypeMapCb<PrismaClientOptions>, DefaultArgs, TypeMap<InternalArgs & DefaultArgs, { }>>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:228

PrismaClient.$extends

get apiKey(): ApiKeyDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:270

prisma.apiKey: Exposes CRUD operations for the ApiKey model.

  • Example usage:
  • // Fetch zero or more ApiKeys
  • const apiKeys = await prisma.apiKey.findMany()

ApiKeyDelegate<ExtArgs, ClientOptions>

PrismaClient.apiKey


get authKvEntry(): AuthKvEntryDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:330

prisma.authKvEntry: Exposes CRUD operations for the AuthKvEntry model.

  • Example usage:
  • // Fetch zero or more AuthKvEntries
  • const authKvEntries = await prisma.authKvEntry.findMany()

AuthKvEntryDelegate<ExtArgs, ClientOptions>

PrismaClient.authKvEntry


get membership(): MembershipDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:250

prisma.membership: Exposes CRUD operations for the Membership model.

  • Example usage:
  • // Fetch zero or more Memberships
  • const memberships = await prisma.membership.findMany()

MembershipDelegate<ExtArgs, ClientOptions>

PrismaClient.membership


get memory(): MemoryDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:280

prisma.memory: Exposes CRUD operations for the Memory model.

  • Example usage:
  • // Fetch zero or more Memories
  • const memories = await prisma.memory.findMany()

MemoryDelegate<ExtArgs, ClientOptions>

PrismaClient.memory


get memoryAudit(): MemoryAuditDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:290

prisma.memoryAudit: Exposes CRUD operations for the MemoryAudit model.

  • Example usage:
  • // Fetch zero or more MemoryAudits
  • const memoryAudits = await prisma.memoryAudit.findMany()

MemoryAuditDelegate<ExtArgs, ClientOptions>

PrismaClient.memoryAudit


get memoryImportSource(): MemoryImportSourceDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:310

prisma.memoryImportSource: Exposes CRUD operations for the MemoryImportSource model.

  • Example usage:
  • // Fetch zero or more MemoryImportSources
  • const memoryImportSources = await prisma.memoryImportSource.findMany()

MemoryImportSourceDelegate<ExtArgs, ClientOptions>

PrismaClient.memoryImportSource


get memoryLink(): MemoryLinkDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:300

prisma.memoryLink: Exposes CRUD operations for the MemoryLink model.

  • Example usage:
  • // Fetch zero or more MemoryLinks
  • const memoryLinks = await prisma.memoryLink.findMany()

MemoryLinkDelegate<ExtArgs, ClientOptions>

PrismaClient.memoryLink


get migrationCheckpoint(): MigrationCheckpointDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:320

prisma.migrationCheckpoint: Exposes CRUD operations for the MigrationCheckpoint model.

  • Example usage:
  • // Fetch zero or more MigrationCheckpoints
  • const migrationCheckpoints = await prisma.migrationCheckpoint.findMany()

MigrationCheckpointDelegate<ExtArgs, ClientOptions>

PrismaClient.migrationCheckpoint


get organization(): OrganizationDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:240

prisma.organization: Exposes CRUD operations for the Organization model.

  • Example usage:
  • // Fetch zero or more Organizations
  • const organizations = await prisma.organization.findMany()

OrganizationDelegate<ExtArgs, ClientOptions>

PrismaClient.organization


get rateLimitCounter(): RateLimitCounterDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:340

prisma.rateLimitCounter: Exposes CRUD operations for the RateLimitCounter model.

  • Example usage:
  • // Fetch zero or more RateLimitCounters
  • const rateLimitCounters = await prisma.rateLimitCounter.findMany()

RateLimitCounterDelegate<ExtArgs, ClientOptions>

PrismaClient.rateLimitCounter


get reindexJob(): ReindexJobDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:350

prisma.reindexJob: Exposes CRUD operations for the ReindexJob model.

  • Example usage:
  • // Fetch zero or more ReindexJobs
  • const reindexJobs = await prisma.reindexJob.findMany()

ReindexJobDelegate<ExtArgs, ClientOptions>

PrismaClient.reindexJob


get user(): UserDelegate<ExtArgs, ClientOptions>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:260

prisma.user: Exposes CRUD operations for the User model.

  • Example usage:
  • // Fetch zero or more Users
  • const users = await prisma.user.findMany()

UserDelegate<ExtArgs, ClientOptions>

PrismaClient.user

$connect(): Promise<void>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:157

Connect with the database

Promise<void>

PrismaClient.$connect


$disconnect(): Promise<void>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:162

Disconnect from the database

Promise<void>

PrismaClient.$disconnect


$executeRaw<T>(query, …values): PrismaPromise<number>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:173

Executes a prepared raw query and returns the number of affected rows.

T = unknown

TemplateStringsArray | Sql

any[]

PrismaPromise<number>

const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`

Read more in our docs.

PrismaClient.$executeRaw


$executeRawUnsafe<T>(query, …values): PrismaPromise<number>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:185

Executes a raw query and returns the number of affected rows. Susceptible to SQL injections, see documentation.

T = unknown

string

any[]

PrismaPromise<number>

const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')

Read more in our docs.

PrismaClient.$executeRawUnsafe


$on<V>(eventType, callback): PrismaClient

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:152

V extends never

V

(event) => void

PrismaClient

PrismaClient.$on


$queryRaw<T>(query, …values): PrismaPromise<T>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:196

Performs a prepared raw query and returns the SELECT data.

T = unknown

TemplateStringsArray | Sql

any[]

PrismaPromise<T>

const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`

Read more in our docs.

PrismaClient.$queryRaw


$queryRawUnsafe<T>(query, …values): PrismaPromise<T>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:208

Performs a raw query and returns the SELECT data. Susceptible to SQL injections, see documentation.

T = unknown

string

any[]

PrismaPromise<T>

const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')

Read more in our docs.

PrismaClient.$queryRawUnsafe


$transaction<P>(arg, options?): Promise<UnwrapTuple<P>>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:224

Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.

P extends PrismaPromise<any>[]

[...P[]]

TransactionIsolationLevel

number

number

Promise<UnwrapTuple<P>>

const [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])

Read more in our docs.

PrismaClient.$transaction

$transaction<R>(fn, options?): Promise<R>

Defined in: node_modules/.pnpm/@prisma+client@7.8.0_prisma@7.8.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+_ae629fb0908e65aad556d2cdbb07f041/node_modules/.prisma/client/index.d.ts:226

Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.

R

(prisma) => Promise<R>

TransactionIsolationLevel

number

number

Promise<R>

const [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])

Read more in our docs.

PrismaClient.$transaction


ensureConnected(): Promise<void>

Defined in: packages/database/src/prisma.service.ts:117

Optional pre-flight check: verifies DB connectivity before a batch operation. In profile=lite Prisma lazy-connects on the first query, so calling this is not required for correctness but lets callers fail-fast before a long operation.

Promise<void>


onModuleDestroy(): Promise<void>

Defined in: packages/database/src/prisma.service.ts:105

Promise<void>

OnModuleDestroy.onModuleDestroy


onModuleInit(): Promise<void>

Defined in: packages/database/src/prisma.service.ts:95

Module init: connect eagerly on profile-standard, defer on lite.

Promise<void>

OnModuleInit.onModuleInit