Vinny (@Wasp)
Vinny (@Wasp)
Explore posts from servers
WWasp-lang
Created by Vinny (@Wasp) on 4/2/2024 in #🙋questions
ui
Which ui component library works well with wasp
9 replies
RRailway
Created by Vinny (@Wasp) on 2/21/2024 in #✋|help
pg_restore throwing errors
I've backed up my prod db and want to copy the data to a staging environment. I've copied the prod environment to staging, and followed this guide to get the backup via pg_dump https://blog.railway.app/p/postgre-backup but when I try to run pg_restore it gets stuck at the following error:
error: COPY failed for table "metadata": ERROR: duplicate key value violates unique constraint "metadata_pkey"
DETAIL: Key (key)=(exported_uuid) already exists.
CONTEXT: COPY metadata, line 1
error: COPY failed for table "metadata": ERROR: duplicate key value violates unique constraint "metadata_pkey"
DETAIL: Key (key)=(exported_uuid) already exists.
CONTEXT: COPY metadata, line 1
is this guide in the blog post still valid? when I try restoring to an empty database i get a bunch of timescaledb errors instead...
3 replies
WWasp-lang
Created by Vinny (@Wasp) on 4/13/2023 in #🙋questions
`wasp start db` issue --> docker: Cannot connect to the Docker daemon...
If you're getting the error docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. when trying to run wasp start db, make sure you have Docker installed and its running. On Mac OS, just find the Docker app in your launchpad and click it. You should see a Docker icon in your top right menu bar. If so, you're good to go!
6 replies
WWasp-lang
Created by Vinny (@Wasp) on 12/9/2022 in #🙋questions
Types on the Frontend
To get this question and answer forum going, I'm going to repost a really good question from @breadchris: so the first thing that got me caught up when going through the demo is that I was trying to have shared types between the frontend and backend code. I could setup the backend with the types from prisma:
import {Task} from '@prisma/client'

export const createTask = async (args: Task, context: any) => {
return context.entities.Task.create({
data: {description: args.description}
})
}
import {Task} from '@prisma/client'

export const createTask = async (args: Task, context: any) => {
return context.entities.Task.create({
data: {description: args.description}
})
}
but those are obviously not accessible from the frontend:
const Task = ({props: {task: Task}}) => {
return (
<div>
<input
type='checkbox' id={props.task.id}
checked={props.task.isDone}
/>
{props.task.description}
</div>
)
}
const Task = ({props: {task: Task}}) => {
return (
<div>
<input
type='checkbox' id={props.task.id}
checked={props.task.isDone}
/>
{props.task.description}
</div>
)
}
I would expect to be able to use Task here since I a common task will be to return down an object in its entirety to be formatted and viewed. The workaround here is to put the types in the shared folder, but it would be nice to keep these types in sync with the database. I am not sure how difficult it is to do, but it seems like the "hack" is to copy the index.d.ts from prisma's client into a place that is accessible to the frontend code? the index.d.ts file is all types so it should be fine, but is obviously a dirty hack lol. Would love to know your thoughts!
5 replies
RRailway
Created by Vinny (@Wasp) on 11/22/2022 in #✋|help
Google oauth redirect -- nginx 404
2 replies