fix(docs): correct drizzle import in Supabase and Xata get-started#678
Open
emmayusufu wants to merge 1 commit into
Open
fix(docs): correct drizzle import in Supabase and Xata get-started#678emmayusufu wants to merge 1 commit into
emmayusufu wants to merge 1 commit into
Conversation
The first connection example on the Supabase and Xata get-started pages
imported drizzle from "drizzle-orm", which doesn't export it (TS2305), and
called drizzle('postgres-js', url), which isn't a valid signature. Both
pages use the postgres-js driver, so import from "drizzle-orm/postgres-js"
and pass the connection string directly, matching the node-postgres
get-started page.
Closes #3161
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes drizzle-team/drizzle-orm#3161.
The first connection example on the Supabase and Xata get-started pages has two problems:
drizzlefromdrizzle-orm, which doesn't export it, so you getModule '"drizzle-orm"' has no exported member 'drizzle'.ts(2305).drizzle('postgres-js', process.env.DATABASE_URL), but the postgres-js driver'sdrizzletakes a connection string (or client) as the first argument, not a dialect name.Both pages use the
postgresdriver, so I changed them to import fromdrizzle-orm/postgres-jsand pass the connection string directly, matching how the node-postgres get-started page already does it:#3161 only mentions Supabase, but Xata had the identical broken snippet, so I fixed both. The later examples on these pages already use the correct
drizzle-orm/postgres-jsimport, so this just brings the first one in line.