Xata

X

Xata

This is Xata's community Discord server, where we discuss all things Xata: projects, features, dreams!

Join

help

general

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?

schema migration to add link between users and projects tables.

Trying to run a migration in the xata migration editor. It runs without error but I cannot get the link created. When I use the interactive tool to create the link_to_table it creates a link between the tables but when i try to add a record it gives this error " columns invalid: column [user_xata_id]: column not found " [ { "alter_column": { "table": "projects",...

Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)

Howdy folks. I'm pretty new to Xata and have to say so far it's pretty dang awesome. I'm still figuring things out and have been going through the Astro, Xata, Stripe & Lucia tut (sans the stripe part). The user registration and session parts are working, but I'm getting the following error when signing up as a new user: ...

pg_dump: error: query failed: SSL SYSCALL error: EOF detected

I tried pg_dump like in the documentation https://xata.io/docs/postgres#export but got error 'pg_dump: error: query failed: SSL SYSCALL error: EOF detected', probably issue with sslmode=require. Need help!...

Database error: error parsing response from server: `S` field missing

Hello everyone, I'm trying to use Xata for an app (Umami) I'm trying to deploy to Vercel. Vercel seems to be able to connect to the database (according to logs), but then I get this error: ``` Migration name: 01_init Database error code: none Database error:...

what is the ideal column type to store the content of a Tiptap editor?

I’m building page the saves the whole document provided by the rich text editor using tiptap. I was wondering if the ideal column type would be text or json. Not sure about the the pros and cons of both when considered things like performance, amount of data it can store, compatibility with other databases like SQLite etc. My current requirement is just to query the whole document at page load and update it when the user changes the content with some debouncing....

Issues connecting to the database

Hi We are currently experiencing issues when connecting to the Postgres database on eu-central. Mainly, schema changes are not working. But we also had disconnects when reading data or rather when trying to connect to read data. ...

Xata pull issue

Im using Xata for a next.js application and with drizzle orm I chose not to use the xata client but now i don't know how can i pull schema changes without the xata client...
No description

setting "default_tablespace" is not allowed

Hello, I'm migrating my payload3 db and when restoring I get this, and a bunch of following errors, how can I fix that?

Vercel connections timeout when using a transaction

Hi We are using Drizzle together with the TCP Pool pg client. ```ts import { drizzle as drizzlePg } from 'drizzle-orm/node-postgres';...

Type mismatch: expected vector..

Hey guys, so I have a table with a vector column with dimensions of 1536. Its naturally used to store embeddings generated via openai. Im able to save embeddings to this column via the Xata client. However.. when using the .ask method of the sdk.. im getting the following error: vector search: column [embedding]: type mismatch: expected vector (An array of floats with fixed dimension)...

I'm getting the following error when creating a record on this 'vectors' table

message: 'table [vectors]: record with ID [rec_cq8rnq04vvkm2p5ohj6g] already exists in table [vectors]', even though the table is completely empty, to create the tables i used prisma, only for the regular columns (strings, numbers etc...) and then i the vector one on the UI. any help will be appreciated, Thanks!!...
No description

Preview branches are not being created for Vercel/Github extension

I don't know why. Everything worked normal a couple days ago

File Upload URLs Fails with CORS

I’m having errors on image uploads. I’m using the uploadUrl approach where I send a request to my backend to generate the upload URL for a file. However, from the front-end, I’m getting a CORS error that I didn’t get before when trying to upload the image from the browser. Have there been any changes to those upload URLs that now don’t allow for CORS?...

xata.ts not being generated after command failure

Using react + next.js to make a portoflio. I'm trying to init my db to my project but a command fails "npm install --save @xata.io/client". I can run the command myself but it doesnt solve the issue of the xata.ts file not being generated. Please help
No description

Signed URLs in Xata dashboard (and my app) cease to function

Hi, I've just run into some problem accessing files with signed URLs in my app. All signed URLs (dynamically retrieved) of files created before a specific point cease to return the file (but rather invalid signature). Seems those retrieved from the Xata dashboard also face the same error (although files can still be downloaded and newly created files are free from this problem). ```ts // creating file attachments await xata.db.audio.create({...
No description

Cursor Pagination Broken

Hii, i am facing an error with cursor pagination where i get this error when i use the cursor to paginate through the after and before fields
cursor invalid: filter invalid: column [character-\u003eelement]: invalid identifier, column [character-\u003eelement]: invalid identifier, offset 10: invalid symbol [\], only alphanumerics and '-', '_', or '~' are allowed
cursor invalid: filter invalid: column [character-\u003eelement]: invalid identifier, column [character-\u003eelement]: invalid identifier, offset 10: invalid symbol [\], only alphanumerics and '-', '_', or '~' are allowed
this happens when i use filter on JSON nested key character->element...

How can I restrict the API access to a specific branch?

Is this even possible? I can't find anything in the docs.

Reverse links typescript

Hi there. I'm wondering if it's possible to read a ShoppingCart by it's id and also get all it's ShoppingCartLineItems in one query. I'm trying to avoid making multiple queries to the database. I've had a look at https://xata.io/blog/navigating-many-to-one and https://xata.io/docs/concepts/data-model#links-and-relationships but I'm still not sure how to do this. Schema:...

Xata issues with environment variables in NestJS

I have a simple NestJS app, generated through their cli, and have attempted to add Xata to the project to use as my database. I've ran the xata init command, and everything generated correctly and my environment variables were added to my .env file. However, where I try to run my app with pnpm start:dev (a precreated script) I get this error: ``` E:***\node_modules.pnpm@xata.io+client@0.29.5_typescript@5.4.5\node_modules@xata.io\client\src\client.ts:108 throw new Error('Option apiKey is required');...