-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adding a tutorial for seeding a local postgres database #829
Comments
A tutorial would be great. I followed all steps, but it seems that something is missing because I'm not getting the data into the database. |
return Response.json({ You need to delete the file above, and you may consider using bcryptjs instead of bcrypt. Here is how you go about it:
That should fix it. |
This method still failed, and the console shows a 500 error along with an Uncaught Error: [object Object] |
What worked for me is setting the seed/route.ts like below:
The last try catch block was not getting executed. After commenting like shown above, I got it working! |
That issue helped me getting it running locally with @vercel/postgres: vercel/storage#123 To summarize:
import {
neonConfig,
QueryResult,
QueryResultRow,
} from '@neondatabase/serverless';
import { db } from '@vercel/postgres';
neonConfig.wsProxy = (host) => `${host}:54330/v1`;
neonConfig.useSecureWebSocket = false;
neonConfig.pipelineTLS = false;
neonConfig.pipelineConnect = false;
type Primitive = string | number | boolean | undefined | null;
const client = await db.connect();
export function sql<O extends QueryResultRow>(
strings: TemplateStringsArray,
...values: Primitive[]
): Promise<QueryResult<O>> {
return client.sql(strings, ...values);
}
"overrides": {
"@neondatabase/serverless": "0.10.4"
}
// import { sql } from '@vercel/postgres';
import { sql } from '@/app/lib/db'; Updated 2025-01-06: less changes in the tutorial code base necessary. |
I can use local postgres without using docker in the Chapter 6. |
Hello.
There is no tutorial about seeding a local database in "Chapter 6: Setting Up Your Database". I changed the
route.ts
file so it would seed the local postgres database. I would be happy to make a tutorial for it, but I'm not sure how can I contribute to the dashboard app's tutorial. Neither I did find any guides on contributing to the tutorial. Is there a way to edit the existing chapter 6, or to add a new chapter about seeding a local postgres database?The text was updated successfully, but these errors were encountered: