Eusebio Trigo
Explore posts from serversCannot perform I/O on behalf of a different request in Cloudflare Workers
Ok, so this may be a long one...
I have several cloudflare workers that write or request data from Xata.
When I do a single request using the TypeScript SDK, it works OK. When I do several requests like in a await Promise.all(array.map(async arrayElem => queryToXata(arrayElem))), then I get an error like:
This is coming from the Cloudflare Worker SDK, Wrangler.
I have attached the stacktrace.
I have tried creating the xata client on each method I call, so it is separated... but to no avail.
If you request or need more information, i'll be happy to share code, or even do a screensharing session, etc.
I want to discard if this is something from the Xata SDK, or it is something else,...
10 replies
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).
We are aware of the alternative using code and filtering out repeated results... Or running direct SQL queries to the API.
What would be the recommended way?
Thanks!
5 replies
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.
Note to Kostas: The workspace and the table and the branch are the same as yesterday 😉
Thanks!
12 replies
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"
This gotta be something wrong in our code, but I am failing to see what, so we need some support from you to see what's wrong.
22 replies
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.*"],
summaries: {},
filter: {
"anotherLinkedTable.someProperty": "someValue",
},
});
the result comes as:
we would expect:
And we are getting the results but the objects we get from the linkedTable have their JSON columns coming back as a string.
If we do a xata.db.linkedTable.read(linkedTable.id), we do get an object whose JSON columns are objects, and not a string.
6 replies
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.12 replies
Migrations across workspaces
Hi Xata team!
I'd like to know if it would be possible to do DDL migrations between different workspaces. I'll explain: we are aiming to have a different workspaces, one for production, another for development, etc. And each workspace contains databases whose branches are for multi-tenant purposes (one customer has one branch).
I already have some code to update from the
main
database to any other branch in that database (I do what we can see in Xata's UI, but in code, but wanted to know if we can do it across workspaces.
Thanks!!21 replies
Exploring Migrations
Hi team,
I'm exploring the migrations API so I can update all my branches with the latest schema (using branches in a multi-tenant approach). Some time ago I could use "xataApiClient.migrations.getBranchSchemaHistory" or https://xata.io/docs/api-reference/db/db_branch_name/schema/history#query-schema-history to query all the migrations that were applied to a branch.
Now, i'm getting a 500 error in some branches and the list of changes in other branches. I have several RequestIDs if they come helpful for you.
fbc58bc0-20d1-93f9-85f5-d8dde259cc2f
30629f5c-36d3-9a8f-9230-057503608b5f
They all just come back as:
status: 500,
errors: [
{
message: 'Internal Error (RequestID: 30629f5c-36d3-9a8f-9230-057503608b5f)',
status: 500
}
],
requestId: '30629f5c-36d3-9a8f-9230-057503608b5f',
cause: undefined
From other branches I can output something like:
Database fc2c3fca-d71d-4657-b6d5-53da8d807de0 does not need to be updated
Commit mig_cfscsaplsg2bukjkiiog was applied on 2023-02-24T14:48:11.396059Z
Commit mig_cfeikv6481ilejqfj0ug was applied on 2023-02-03T15:38:36.792671Z
Thanks in advance for your help!8 replies
Deno support for deps.ts
Hi team!
I´m trying Deno, and following one of their best practices, they recommend moving all the dependencies with a url or a npm prefix to a deps.ts file: https://deno.land/[email protected]/examples/manage_dependencies
Given that the "xata codegen" tool generates the client code and builds something like:
Is there a recommended way to handle it, as we should not change generated code...
3 replies