How to use Turso without embedded replicas? #25931
QuestionSo, this is my schema: generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}
datasource db {
provider = "sqlite"
url = env("TURSO_DATABASE_URL")
}This works with prisma generate and I can do the queries fine if the tables are already there. But when I want to migrate, this happens: ~$ bunx prisma migrate dev --name init
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": SQLite database
Error: Prisma schema validation - (get-config wasm)
Error code: P1012
error: Error validating datasource `db`: the URL must start with the protocol `file:`.
--> prisma\schema.prisma:14
|
13 | provider = "sqlite"
14 | url = env("TURSO_DATABASE_URL")
|
Validation Error Count: 1
[Context: getConfig]
Prisma CLI Version : 6.1.0I want to use Turso with prisma but without embedded replicas. (As I use stateless servers with low disk limits). How can I do this? How to reproduce (optional)No response Expected behavior (optional)No response Information about Prisma Schema, Client Queries and Environment (optional)No response |
Answered by
nurul3101
Dec 27, 2024
Replies: 1 comment 5 replies
|
Hello @touhidurrr 👋 To make database changes you would need to use Turso CLI as described here. Since libSQL uses HTTP to connect to the remote database, this makes it incompatible with Prisma Migrate, which is why you are getting this error.
|
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Prisma Migrate is currently not supported when working with Turso. This is not due to a requirement for replicas, but rather because of how Turso connects to the database.
The recommended workflow is to generate a migration file using
prisma migrate devagainst a local SQLite database (Not Turso) and then Applying the migration manually using Turso's CLI (To Turso database).I would recommend opening a Feature Request so that our ORM team can share their insights.