Skip to content
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

Merged
merged 6 commits into from
Oct 23, 2023

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Oct 23, 2023

Closes https://github.com/prisma/team-orm/issues/387.

This PR adds instructions about how to install and use the following Driver Adapters:

  • PlanetScale
  • Neon
  • libSQL (Turso)

@jkomyno jkomyno added this to the 5.5.0 milestone Oct 23, 2023
@jkomyno jkomyno marked this pull request as ready for review October 23, 2023 13:11
@jkomyno jkomyno requested a review from a team as a code owner October 23, 2023 13:11
@jkomyno jkomyno requested review from miguelff, Weakky and janpio and removed request for a team and Weakky October 23, 2023 13:11
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 23, 2023

CodSpeed Performance Report

Merging #4377 will not alter performance

Comparing docs/readme-driver-adapters (946b5d0) with main (475c616)

Summary

✅ 11 untouched benchmarks

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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}`;
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍝

@SevInf SevInf merged commit 39b6c54 into main Oct 23, 2023
@SevInf SevInf deleted the docs/readme-driver-adapters branch October 23, 2023 17:31

## 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:
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants