dream
dream
XXata
Created by dream on 10/23/2024 in #help
Exclude special columns when fetching records
Using the xata typescript SDK, how do I exclude the xata.* and xata_* columns from the query results? I'm trying to maintain a two way sync between a client side user form and the database. These special columns make the form validation fail, I have to filter them out which is kind of frustrating. Is there a way to select all [*] columns and exclude these xata columns?
4 replies
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