PrismaP
Prisma3mo ago
5 replies
identity

How to use LibSql with Prisma 7.0.0?

this is how I used to do it but now that adapter and studio configs are deprecated and datasource doesn't allow me to set DATABASE_TOKEN, how should i do it?

export default defineConfig({
  experimental: {
    adapter: true,
    studio: true,
  },
  schema: './prisma',
  migrations: {
    path: 'prisma/migrations',
    seed: 'tsx ./prisma/seed.ts',
  },
  typedSql: {
    path: 'prisma/sql',
  },
  studio: {
    async adapter() {
      return new PrismaLibSql({
        url: env("DATABASE_URL"),
        authToken: env("DATABASE_TOKEN"),
      })
    },
  },
  async adapter() {
      return new PrismaLibSql({
        url: env("DATABASE_URL"),
        authToken: env("DATABASE_TOKEN"),
      })
    },
  engine: "js",
})
Was this page helpful?