DisBot
    Preparing search index...

    Class PrismaClient<ClientOptions, U, ExtArgs>

    Type-safe database client for TypeScript & Node.js

    const prisma = new PrismaClient()
    // Fetch zero or more Guilds
    const guilds = await prisma.guilds.findMany()

    Read more in our docs.

    Type Parameters

    Indexable

    • [K: symbol]: {
          types: {
              operations: {
                  $executeRaw: {
                      args: [query: TemplateStringsArray | Sql, ...values: any[]];
                      result: any;
                  };
                  $executeRawUnsafe: {
                      args: [query: string, ...values: any[]];
                      result: any;
                  };
                  $queryRaw: {
                      args: [query: TemplateStringsArray | Sql, ...values: any[]];
                      result: any;
                  };
                  $queryRawUnsafe: { args: [query: string, ...values: any[]]; result: any };
              };
              payload: any;
          };
      }
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    $extends: ExtendsHook<
        "extends",
        TypeMapCb<ClientOptions>,
        ExtArgs,
        TypeMap<
            InternalArgs & ExtArgs,
            ClientOptions extends { omit: OmitOptions } ? OmitOptions : {},
        >,
    >

    Accessors

    Methods

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

      Type Parameters

      • T = unknown

      Parameters

      • query: TemplateStringsArray | Sql
      • ...values: any[]

      Returns Prisma.PrismaPromise<number>

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

      Read more in our docs.

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

      Type Parameters

      • T = unknown

      Parameters

      • query: string
      • ...values: any[]

      Returns Prisma.PrismaPromise<number>

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

      Read more in our docs.

    • Performs a prepared raw query and returns the SELECT data.

      Type Parameters

      • T = unknown

      Parameters

      • query: TemplateStringsArray | Sql
      • ...values: any[]

      Returns Prisma.PrismaPromise<T>

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

      Read more in our docs.

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

      Type Parameters

      • T = unknown

      Parameters

      • query: string
      • ...values: any[]

      Returns Prisma.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.

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

      Type Parameters

      Parameters

      Returns 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.

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

      Type Parameters

      • R

      Parameters

      Returns 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.