Xata

X

Xata

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

Join

help

general

Route handlers in Next.js

How do I use route handlers in next.js to post data to Xata?

Drizzle ORM schema conflict with xata_createdat and xata_updatedat

This is my drizzle schema: ```typescript export const users = pgTable('users', { id: text('id').primaryKey(), email: text('email').unique(),...

Remix v2.8.1 (vite) on Vercel serverless function timeout when making xata db calls

The app is deploying properly and I can't see any issues in the runtime logs on Vercel. The serverless function (Node.js 20x) just timeouts after 60 seconds. Via console.logs I'm pretty sure it's related to a xata query. In the build logs I see the following warnings (not sure if this is related): ```...

Directly connect to Postgres instance

Hi! I love working with the Xata UI and SDK! I really miss some features like setting up Triggers and Indices myself. Will this be available with with the the roadmap item "Exposing PostgreSQL: Expose the PostgreSQL wire protocol to directly connect to the Xata PostgreSQL database and your favorite ORMs."? When can we roughly expect to have this functionality?...

Drizzle integration not working anymore

Hey guys, the update 0.29.5 of drizzle-orm broke the SDK as the class PreparedQuery was renamed to PgPreparedQuery and the xata implementation still uses the old name.

What is the best way to connect to two databases to the same project?

I have a Typescript project that needs to connect to two different Xata databases. I used xata init to initialise the project with one database and I was thinking it could be best to set up another XataClient with the other database URL, however this will mean the types will be out. Any help would be great!

My Web UI seems to be down currently

This request from dataPlanefetcher.ts is pending since a couple of minutes. I tried refreshing, signing out and in, clearing cache but nothing seems to be working. The request is just not getting through and my UI is completely empty. this is the section in the client-side code that fires the request: dataPlanefetcher.ts:94: ```...

Idea for Table-UI

Hi 🙂 I have an idea that would improve the UI: Have all columns unselected by default for (large) tables. I currently have a table with ~200 columns and 300 entries and it takes a while to load and unselect columns. If I would keep all columns selected, filtering would basically be impossible. If other users prefer to have the columns pre-selected, maybe a user-setting could provide customizability? Basically just a boolean that asks wether colums should be un/pre-selected....

Question about types in the Typescript client

Hi Team! Since one of the latests versions I got in Intellij the following warning: "Argument type {total_orders: {uniqueCount: {column: "order"}}} is not assignable to parameter type Dictionary<AggregationExpression<XataRecord>> | undefined "...
No description

Running queries with DISTINCT

Hi team! Is there a way to run queries with something like .distinct(["column_name"])? We know about summarize (https://xata.io/docs/sdk/summarize#what-can-summarize-do), but it has a limit on 1000 results (and defaults to 20)....

Different results using summarize vs filtering

Hi team (it's me, again), I'm seeing that, at least in the playground, there is a difference of results when using summaries vs using filtering query (I'll add examples). To make it short, summaries are only returning 20 results, whereas it should be returning more (22, in our current data set). Is there a limit of the number of results provided by a summarize call? It is returning only 20 results. I would like you guys to tell me that there is something very wrong in our code. Like we need to call summarize with something different....

Diagnosing Constraint Violation

Hi team! We are using a direct SQL to update rows in one of our databases. Some of them work, some of them throw a "constraint violation on transactions: link_m29iv801n56pd8oc7tk3q9nn2c" The requestId is "32375456-2959-9b47-925b-4f8fcbbaac14" ...

Can IDs of rows in different branches collide?

I'm using S3 and storing objects based on Xata ID's. Example: When I'm creating/deleting multiple test users (different Xata branch than main) and creating/deleting S3 objects along with them, is there a risk of overwriting actual user objects in S3? Currently the ID is the only differing part in the S3 path of the objects so I'm treating the ID's as globally unique. Could not find this in the Docs...

Slow Intellisense using VSCode on large Typescript Project

Hi everyone, I've been using Xata for ~2 months now on a Sveltekit+Typescript Project as my main DB. Overall I'm very happy and love the SDK! As my project is getting increasingly large (~10k lines of code + 30 dependencies/packages) I noticed that the Intellisense for the Xata SDK is slowing down. E.g. it takes up to 15 seconds for inline suggestions and "go to definition". This is really slowing down my productivity....

Objects with json columns after a summaries request provide properties as strings

Hi team, We are trying to run a summaries like: const summary = await xata.db.items.summarize({ columns: ["linkedTable.*"],...

Import CSV from UI saves data in `main` branch but not in the selected branch

Hi team, We are testing the import and export through CSV, and found out that when using the UI the data exported from a branch it is imported directly into the main branch, but not in the selected branch....

Error in Next.js app with inserting a record

Why is the error persisting?
Uncaught Error: You are trying to use Xata from the browser, which is potentially a non-secure environment. If you understand the security concerns, such as leaking your credentials, pass `enableBrowser: true` to the client options to remove this error.
Uncaught Error: You are trying to use Xata from the browser, which is potentially a non-secure environment. If you understand the security concerns, such as leaking your credentials, pass `enableBrowser: true` to the client options to remove this error.
...