Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the fullstack TypeScript platform for developers and startup founders.

Join

support-community

show-and-tell

general

self-hosted

announcements

`.last()`

Regarding query functions, I noticed there is not a method like last() that would be the opposite of first() https://docs.convex.dev/api/interfaces/server.Query#first To get the last document, do you typically add an index to that column and add something like this to the query: .order("desc").first()? I ask because there doesn't seem to be native functionality to add a unique constraint on a column. So simply doing a last() method may be a hacky way to quickly get coding with a predictable handling of duplicates....

STOP using Layouts for Authentication!

Guys guys! I am current using: - Clerk + Convex To manage my user session and I stepped on this video: ...

Lacking authz in BaaS like Firebase

Theo just dropped this bomb and points out various concerns about BaaS: https://youtu.be/TKyNPg7UIIc?si=Rdpoqfp79Opy8nWx Could someone link me an article on how Convex tries to avoid these kind of security issues or explain it to me.

Next.js Server Rendering | Convex Develo...

Quick question, can we have documentation for next.js serverside rendering with paginated queries? https://docs.convex.dev/client/react/nextjs/server-rendering...

Sharing a convex backend between multiple apps without a monorepo

Is there a way so we wouldn't have to use a mono-repo? 😦

Why SQL Sucks

My path to Convex, a backend as a service built from the ground up for a modern TypeScript app: PlanetScale: MySQL, on Vitess. I got two words for you: “Connection. Pool.” Neon: We are the default Postgres. True serverless. Copy-on-write branching. Go ahead, shop around. You’ll come back. ...

filter performance

I'm reading the post about normal ts filters, and it says it works "with the same performance as built-in Convex filters". Do the q.eq, q.neq, q.lt (...) objects not compile to something more efficient than JS? https://stack.convex.dev/complex-filters-in-convex...

Selecting fields performance

I'm curious what the edge version of this is, requesting a singular field using .map is only possible if you are searching a index. if you just do settings = await ctx.table('users').get(userid).edge('setting') there is no .map available. so down to settings[fieldName].. i know its not a hugelist but im hoping this is as efficient as possible.

Sending push notifications using expo-notifications and Convex actions

This sounds exactly what I’m looking for? Do you some examples that you can share of how you’ve set this up?

Today, I read the Convex database docs.

Today, I read the Convex database docs. Inserts, updates, and deletes are called “mutations.” I used to be mayonnaise. Now, I am aioli.

Bandwidth usage for collaborative editing

I was thinking about delta-based protocols with our current subscription paradigm. If you have a sequence of edits that you apply to make a document, you could do something like: 1. Have multiple documents for the deltas - maybe one document per delta is ok, or maybe you batch them. 2. Have the query for the document be a paginated query, not a single query for the whole thing. 3. To render the document, the client fetches all pages, and automatically fetches new pages. The deltas -> doc transform can then happen on the client, and you can optimistically apply your own deltas without duplicating server logic. 4. As your document deltas grow, you can occasionally have a "snapshot" document that has the whole document as a single delta, so your "full doc deltas" query becomes a "all deltas since the last snapshot". You can make this snapshot after some threshold, when a user leaves the page, whatever heuristic makes sense. ...

Public/private function duplication

I’m often finding myself writing two versions of the same function: a public one with a user guard (using convex-helpers custom functions) and an internal one where i pass the user identity in using the arguments. i’ve just been extracting out the handler function so i can use it in both functions, but it’s a lot of boilerplate code and it’s sometimes annoying to have to refactor a bunch of public functions after i realize i also want to call them internally. i was wondering if anyone else has t...

How can I run the equivalent of this

How can I run the equivalent of this query select ... where field in (list of values)? It looks like there is no in operator. Is the only way to build a long list of or filters?

Building a client for a new language

@Tom might have some tips. he was the one who did the Python wrapper

Chat about hosting and infrastructure decision

I truly don't understand adding Pulumi when you've gone out of your way to essentially avoid managing your own infrastructure.

centralized vs. decentralized client data

question (and maybe I shouldn't worry about this :lul: but I'm curious): if I return an OmegaObject™️ from a query that contains a doc and all of its related docs, does convex make efficient patch updates for that query on change? or is it more efficient to use separate queries still, so that only relevant queries get updated also, generally speaking, which should I prefer: fewer query calls higher up the react tree, or more query calls closer to leaves of the tree? I imagine that depends on the UX you want, but I wonder if there are other factors to consider...

optimistic update syntax

imperative optimistic updates have been tedious and brittle compared to declarative in my experience, is all AFAICT the declarative example only grows by a handful of lines to account for multiple mutations if I wanted that...

Navigating many tables in schema

is there any tools you guys use for navigating the schema faster, we hit 57 tables today 😅

Presence without touching the DB

Have you guys considering exposing the ability to query active connections (with appropriate authorization of course)? Theoretically, "presence" could be done with convex without ever touching the datastore, since it holds active websockets connections to all clients. in most cases it would obviate the need for somethign like https://stack.convex.dev/presence-with-convex and would be 1) faster, 2) lower network bandwidth, 3) lower contention (from mutation transactions) and could make your platform subsume things like https://github.com/yjs/y-websocket...

Memory Leaks

Also, I'm reading through the rest of the docs. https://stack.convex.dev/throttling-requests-by-single-flighting#implementation-usesingleflight-callback this implementation is effectively an always running memory leak generator. It intentionally leaves promises forever unresolved!...