Adam Harris
Adam Harris
Explore posts from servers
CCConvex Community
Created by Adam Harris on 9/26/2024 in #support-community
Convex in deno workspace/monorepos
Hi, we're just looking into deno as a potential solution to simplify our typescript monorepo/npm workspace. Is anyone using convex with deno? If so, what's the recommended way of setting things up e.g. what's the recommended way of running convex dev? Is there a way to do this with a deno.json or do we need to keep things npm-based with a package.json?
2 replies
DDeno
Created by Adam Harris on 9/26/2024 in #help
In a deno/npm hybrid monorepo, what are the options for importing a deno member from a npm member?
Hi, we're just looking into deno as a potential solution to simplify our typescript monorepo/npm workspace. Suppose have two members of a hybrid deno workspace/npm monorepo: - Member A (a deno member, i.e. with it's own deno.json) - Member B (a npm workspace/"member", i.e with it's own package.json) Suppose we'd like to import Member A into Member B. i.e. we want to use the deno member as a library in the npm "member"... What are the current options for this?
3 replies
XXata
Created by Adam Harris on 9/6/2024 in #help
⨯ FetcherError: dbname: invalid branch name when using client@next ts sdk
Hi, I'm trying to use Xata with postgres enabled via the @next ts sdk. Firstly, the client generation seems broken, as mentioned in my previous post. But secondly, when I try and make a request I'm getting: ⨯ FetcherError: mydbname: invalid branch name However when I inspect the client config, the config via await xata.getConfig();, correct branch name seems to be present... Any help with this would be much appreciated.
11 replies
XXata
Created by Adam Harris on 9/6/2024 in #help
Xata internal postgres fields - can I rely on them?
Hi, I'm just trying to get started with Xata (with postgres enabled). I chose to use prisma to manage the database schema and db migrations and the xata ts client/sdk for accessing the db. All was going well and I decided to try and set up CI/CD properly, which included checking the xata files out of git and regenerating the client (using a prisma schema as source of truth) in the CI/CD pipeline. However after trying to pin the versions of the client and cli in my package.json and running npx xata codegen, I'm now seeing errors because my records are coming back from the db (via the xata ts client) like this:
{
id: 'rec_bla',
... my fields here
xata_createdat: null,
xata_id: null,
xata_updatedat: null,
xata_version: null,
xata: {
createdAt: 2024-09-04T15:26:12.400Z,
updatedAt: 2024-09-04T15:26:12.400Z,
version: 0
}
}
{
id: 'rec_bla',
... my fields here
xata_createdat: null,
xata_id: null,
xata_updatedat: null,
xata_version: null,
xata: {
createdAt: 2024-09-04T15:26:12.400Z,
updatedAt: 2024-09-04T15:26:12.400Z,
version: 0
}
}
whereas, before they were like this:
{
... my fields here
xata_createdat: 2024-09-04T15:26:12.400Z,
xata_id: 'rec_bla',
xata_updatedat: 2024-09-04T15:26:12.400Z,
xata_version: 0
}
{
... my fields here
xata_createdat: 2024-09-04T15:26:12.400Z,
xata_id: 'rec_bla',
xata_updatedat: 2024-09-04T15:26:12.400Z,
xata_version: 0
}
The errors are happening because I was relying on the xata_id field, but it seems like the xata_id field now needs to be accessed at id and the other xata_ fields are now nested in a xata. path? My guess is that I had the @next version of the client installed and had problems with it, so I installed the @latest, which might have caused this change in the xata fields... Is this the case that the interface for accessing these fields has changed across versions of the client, and shouldn't I be relying on these xata_ postgres fields?
8 replies
XXata
Created by Adam Harris on 9/4/2024 in #help
Problems setting up Drizzle ORM with HTTP client via client/cli@ne
Hi, I'm having some trouble setting up the drizzle ORM with http client. In particular following https://xata.io/docs/integrations/drizzle, I'm running yarn add @xata.io/client@next and I also have the following version of the cli installed: @xata.io/cli/0.0.0-next.v64f10283eb9a098c575590d3ea17600e350321c9 However, when I run xata init, one of the steps is overwriting the xata client version in package.json to "@xata.io/client": "^0.30.0", Then the generated xata.ts has an error:
'"@xata.io/client"' has no exported member named 'getDeployPreviewBranch'. Did you mean 'getPreviewBranch'?`
'"@xata.io/client"' has no exported member named 'getDeployPreviewBranch'. Did you mean 'getPreviewBranch'?`
This error gets fixed if then I reinstall the next version of the xata client, however the generated xata.ts file also doesn't export (or even define) getXataClient, which is required by the setup in the guide https://xata.io/docs/integrations/drizzle, ie. it says:
import { drizzle } from 'drizzle-orm/xata-http';
import { getXataClient } from './xata'; // Generated client

const xata = getXataClient();
const db = drizzle(xata);
import { drizzle } from 'drizzle-orm/xata-http';
import { getXataClient } from './xata'; // Generated client

const xata = getXataClient();
const db = drizzle(xata);
Any help getting xata to work with Drizzle orm would be much appreciated.
12 replies
CCConvex Community
Created by Adam Harris on 8/24/2024 in #support-community
How to count a large set of results from a query?
Hi, suppose I have a query such that the full set of results would be over the 16k convex limit. What is the best way/or are there any suggested techniques for counting this result set?
12 replies
CCConvex Community
Created by Adam Harris on 8/9/2024 in #support-community
How to do an array contains query over a large table?
Hi, I have a table with over 100k docs and I have a field (fieldA) on the table, values of which are arrays of strings. What is the best way to find the documents in this table, such that the corresponding array at fieldA contains a certain string? It looks like convex doesn't support an arrayContains filter, and I can see the suggestion to read the full table into memory and then filter this using js...? But I think with a large table like this then this won't work because I will either hit the (~16k) document scan limit, or run out of memory?
3 replies
CCConvex Community
Created by Adam Harris on 7/24/2024 in #support-community
Issue trying to import csv via Airbyte
Hi, I'm trying to import a csv into a Convex table via the Airbyte integration. I've successfully set up convex as a destination and I've tried to import the csv by using a Google sheet as an Airbyte source for the csv and also by using the File (CSV, JSON, Excel, Feather, Parquet) v0.5.3 Airbyte source (using a private AWS bucket). The full csv has around 23k rows. However if I take the first few (eg 20) rows from the csv and try and import that then it works fine via the AWS bucket. Here is the last error I got when trying to sync the full csv via the File connector:
Warning from destination: Something went wrong in the connector. See the logs for more details.

Expecting value: line 1 column 1 (char 0)
Warning from destination: Something went wrong in the connector. See the logs for more details.

Expecting value: line 1 column 1 (char 0)
4 replies
CCConvex Community
Created by Adam Harris on 6/28/2024 in #support-community
Can't import snapshot to dev
Hi, I've exported a snapshot from production and I'm trying to import it into my dev instance. However when I try and do the import I'm getting the following error:
Hit an error while importing:
New table myTableName has IDs that conflict with existing table documents
Hit an error while importing:
New table myTableName has IDs that conflict with existing table documents
The steps I'm taking are as follows: - Clear all dev tables manually - Run a Snapshot Export on the (prod) dashboard - Run npx convex import —replace SNAPSHOT_NAME.zip When running the import, I see the following: Import change summary: table | create | delete | ---------------------------------------------- table1Name | 166 | 0 of 0 | table2Name | 1 | 0 of 0 | .... i.e. all tables are showing that nothing is in there to conflict... Any help with this would be much appreciated.
9 replies
CCConvex Community
Created by Adam Harris on 6/12/2024 in #support-community
How do I test http actions locally?
Hi, I'd like to test my http actions locally i.e. by making requests to localhost. However when try and hit localhost:3000/myEndpoint, I'm getting 404s. The endpoint works in production, so I'm wondering why I'm getting a 404 locally...
4 replies