-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docs): Add "how to" README sections to public-facing Driver Adapters #4377
Conversation
CodSpeed Performance ReportMerging #4377 will not alter performanceComparing Summary
|
TURSO_DATABASE_URL="libsql://turso-prisma-random-user.turso.io" | ||
``` | ||
|
||
You can now reference this environment variable in your `schema.prisma` datasource. Make sure you also include the `driverAdapters` Preview feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any env var referenced in the datasource block of the schema.prisma, but instead a local URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is a copy-paste error of me trying to fit Turso snippets with the same structure used in PlanetScale and Neon's blog post.
import { createClient } from '@libsql/client'; | ||
|
||
// Setup | ||
const connectionString = `${process.env.TURSO_DATABASE_URL}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be confusing to users, in the text above where I previously commented, it was said:
You can now reference this environment variable in your
schema.prisma datasource.
referring to TURSO_DATABASE_URL
while it was not referenced. Now the client is instantiated with that connection string coming from the env. It might be worth (in addition to fixing the above) to make a clarification in case there is a redundant use of the variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the clarification feedback should also be made on https://www.prisma.io/blog/prisma-turso-ea-support-rXGd_Tmy3UXX.
DATABASE_URL="postgres://..." | ||
``` | ||
|
||
You can now reference this environment variable in your `schema.prisma` datasource. Make sure you also include the `driverAdapters` Preview feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, maybe in the case of turso, the text was wrong due to copypasta?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍝
|
||
## How to setup migrations | ||
|
||
As Turso needs to sync between a local sqlite database and another one hosted on Turso Cloud, an additional migration setup is needed. In particular, anytime you modify models and relations in your `schema.prisma` file, you should: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first sentence here is just wrong. There is no local SQLite database involved when using Prisma. There might be weird things needed for our migration flow as we do not support Migrations with Turso yet.
Closes https://github.com/prisma/team-orm/issues/387.
This PR adds instructions about how to install and use the following Driver Adapters: