dream
dream
XXata
Created by dream on 7/25/2024 in #help
Using prisma to create a new record with a file column
How do I use the prisma client to create a new record with an empty file column? I've tried the following: 1. Placeholder metadata (taking hints from this example: https://xata.io/docs/sdk/file-attachments#1-createupdate-a-record-with-an-empty-file-server-side)
await prisma.message.create({
data: {
conversationId,
userMessage,
botMessage,
image: { name: 'test', mediaType: 'image/png', base64Content: '' },
},
})
await prisma.message.create({
data: {
conversationId,
userMessage,
botMessage,
image: { name: 'test', mediaType: 'image/png', base64Content: '' },
},
})
2. Empty object:
await prisma.message.create({
data: {
conversationId,
userMessage,
botMessage,
image: {},
},
})
await prisma.message.create({
data: {
conversationId,
userMessage,
botMessage,
image: {},
},
})
For each case I get the error:
Can't reach database server at `us-east-1.sql.xata.sh:5432
Can't reach database server at `us-east-1.sql.xata.sh:5432
What is the correct format?
6 replies
XXata
Created by dream on 7/25/2024 in #help
Custom env variable names
Hello! I'm using a vite plugin to check for environment variables before creating a new build. Vite recommends declaring env variable names with the prefix VITE_. The plugin only detects variables with this prefix. How can I configure the xata SDK and CLI to use the env variables VITE_XATA_BRANCH and VITE_XATA_API_KEY?
5 replies