Convex Community

CC

Convex Community

Join the community to ask questions about Convex Community and get answers from other members.

Join

support-community

show-and-tell

general

self-hosted

announcements

Ignoring _generated in pull requests/git diff

Hey, does anybody know how to do this? It's suggested to not gitignore the _generated files for CI/CD reasons (and we concur with this), but we would still like to not have the files show up in our diffs for pull requests. We tried putting the belowin a .gitattributes file, but seems like that doesnt apply to github pull requests. Anybody have some advice for this? Thanks! πŸ‡©πŸ‡° ```/convex/_generated/* -diff...

Cron Jobs, Actions, Internal Mutation

I am trying to call gemini api from my backend and I want to record response to the db. After that I want to make a cron job to call this action. I also want world peace.

table value in array when querying

I can’t find a way to check if, say, a number is in an array of numbers when querying the db

CRDT for text editors

@ian what was the reason to choose automerge vs Yjs? I currently use Yjs to sync a react flow nested tree structure, where each node has a lot of data including many text editor blocks (currently using blocknote based on tiptap+prosemirror). But the Yjs sync with the react state manager became too complex and slow, and wanted to switch to convex for everything except the text editors to handle merges / conflicts better. And blocknote is not good for nested schemas (I want nested custom block types, some react RSC) so I need to switch to pure prosemirror or another CRDT text editor. ...

Convex's compatibility

Can someone provide more clarity about these issues: - Is it possible to talk to the Convex database in natural language? - Quite a few people have been showing the power of Postgres with natural language. - Here is a demo- where AI automatically generates relevant queries and give output- https://vercel.com/templates/next.js/natural-language-postgres...

How to query items where array field contains a specific value?

I have a paginated query where I need to filter items based on whether an array field contains a specific category ID. Currently, my query only returns items where the array exactly matches [categoryId], but I need it to return items where categoryId is one of potentially many elements in the array. Here's my current query: ```typescript...

Calculating average rating across a large dataset

Hello! I'm currently looking to build a feature that shows the average rating of a show based on entry logged by users. This is my first time approaching something like this Convex. I was wondering if there were any recommended solutions? I was looking into the Aggregate convex component to potential solve my problem. The only issue I've have with that approach is that a user can log an entry without rating it, but the sameValue does not accept undefined. ```ts export const animeStatsByEntry = new TableAggregate<{ Namespace: Id<'anime'>...

Zod Unions appear to break `Table` helper (maybe zodToConvex related?)

https://stack.convex.dev/convex-the-database-that-made-me-switch-careers I'm following the pattern described in this article and getting an type error here. Looks to be since the Table expects a Record while the union produces an array of members. This still works below so i'll do this, but wanted to flag this in case it wasn't known...
No description

Upload large file

Hello πŸ™‚ I am trying to upload a large video file via upload URLs. When it is via small images or vidos <50mo it works but if it's bigger it doesn't. If anyone can help ?

Turborepo

I'm fiddling around to get a turborepo working. Everything is fine but running "npx convex dev" inside project/packages/backend gives me: Could not resolve "fs" ../../node_modules/next/dist/compiled/gzip-size/index.js:1:2840: 1 β”‚ ...)?processFn(o,r):o}return n}},147:e=>{"use strict";e.exports=require("fs")},781:e=>{"use strict";e.exports=require("stream")},796:e=>{"use str...}...

Is there a way to infer "union of column name literals" from a table schema?

Hi! When implementing a query that accepts sortBy as an arg, I'm specifying it to be a string. ```tsx args: { sortBy: v.optional(v.string()),...

Dashboard functions search bug

If you try to search for functions in dashboard/functions, and its not found, you can like go back to the functions list? Even if you actually click on Files and then Functions, it still show no functions in this deployment! Please fix....

adding react native (expo) to existing Next + Convex app (with Convex Auth)

I'm pretty new with Mobile and prefeably wouldnt want to use Turborepo to avoid major refactor (and i have skill issue). how would i achieve this? any advice ?

Use Multi Convex projects

Hey, I love convex but I was wondering if there was any best practice or advice around using mutli convex projects in a single application. For context, what I want to do is build out a private npm package that has common integration for Clerk so I don't have to keep rewriting code and setting up the integration for each app. In My use case its fine to have a central auth to connect everything. ...

Internal queries/mutations/actions vs helper functions

Hi everyone! I'm trying to understand the difference between internal queries/mutations/actions and regular helper functions. I'm going to write down my thoughts here, in a contrived example., and I hope you can help me understand it better. Thanks! ```ts // convex/somefile.ts import { internalQuery, query } from "./_generated/server";...

The ctx.storage.getUrl() method is marked as deprecated, but Convex docs provide no alternatives

The storage serve docs direct the use of ctx.storage.getUrl(), but my IDE says the function is deprecated. https://docs.convex.dev/file-storage/serve-files What, then, is the best practice for accessing stored file data?...

convex auth with hono

Hi, I'm using Hono with Http Actions. In this case, how could we connect http actions with convex auth? export default new HttpRouterWithHono(app);...

Refine.dev

can any body make a data provider for convex? it will be a great addition.

Handling Upserts with Optional System Fields

Not sure if this is the best practice here but didn't appear there's a way of getting the Id field to be optional so it can be passed in for upserts (if it doesn't exist, insert, if it does patch). Not sure if my types are entirely correct but seems to work but happy to hear if anyone else agrees ```ts function upsertDeal(ctx: MutationCtx, args: MakeIdOptional<Deals>) { if (args._id) { // type _id = string & {} | undefined...

using push notifications component in monorepo with react native expo

Hi all. I am attempting to use the new convex component expo push notifications. I have a monorepo (using turbo-repo + pnpm) with 2 apps: a react-native expo (SDK 52) app and my convex backend. This is (roughly) the monorepo project structure ``` apps/ convex/ expo/...
No description