Skip to content

Issue on docs: Incorrect argument type for PrismaLibSQL constructor in code example #295

@erogemy

Description

@erogemy

Path: /sdk/ts/orm/prisma

import { PrismaClient } from "@prisma/client";
import { PrismaLibSQL } from "@prisma/adapter-libsql";
import { createClient } from "@libsql/client";

const libsql = createClient({
  url: process.env.TURSO_DATABASE_URL,
  authToken: process.env.TURSO_AUTH_TOKEN,
});

const adapter = new PrismaLibSQL(libsql);
const prisma = new PrismaClient({ adapter });

The createClient function returns an object of type Client. However, the PrismaLibSQL constructor expects an object of type Config. This causes a type mismatch and the build fails.

The argument passed to the PrismaLibSQL constructor should be the configuration object itself, not the client instance returned by createClient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions