holden
CCConvex Community
•Created by holden on 10/19/2023 in #show-and-tell
ChartPilot - Conversational charts, powered by Convex + OpenAI
Sure! I love DuckDB -- for datasets that fit in memory, it makes querying basically instant, and it runs anywhere (including wasm in the browser).
Here I use it to transform datasets (eg a CSV you upload) into Parquet (often ~90% smaller), and then to query data before charting. e.g. when you sort or filter, that's using DuckDB to query the dataset.
Planning to add more ways to transform, such as grouping, and perhaps even expose a DuckDB SQL interface for power users to do more advanced transforms.
If you have any ideas, shoot me a DM!
16 replies
CCConvex Community
•Created by holden on 10/19/2023 in #show-and-tell
ChartPilot - Conversational charts, powered by Convex + OpenAI
Sweet! Just shout if anything doesn’t work for you
16 replies
CCConvex Community
•Created by holden on 10/19/2023 in #show-and-tell
ChartPilot - Conversational charts, powered by Convex + OpenAI
That’s the plan!
16 replies
CCConvex Community
•Created by holden on 10/19/2023 in #show-and-tell
ChartPilot - Conversational charts, powered by Convex + OpenAI
Uses DuckDB in WebAssembly to crunch the data, so should be able handle fairly large datasets too
16 replies
CCConvex Community
•Created by holden on 10/19/2023 in #show-and-tell
ChartPilot - Conversational charts, powered by Convex + OpenAI
(no mobile experience yet, you'll need to try on a laptop/desktop for now)
16 replies
CCConvex Community
•Created by holden on 9/27/2023 in #general
Hi I m trying to create a Delete user
Sounds good, thanks for your response!
Yeah, I read your single-flight article a couple of times. It was informative, but still hard (for me at least) to figure out the best approach. I couldn't use the optimistic updates feature, because I wanted my UI to be responsive so I needed to duplicate local state somehow, which was the tricky part. Adding a lodash throttle was easy once I had the rest figured out, but writing my own sync logic between local/convex state felt brittle.
I don't have any strong opinions about an API for this. I've used both react-query (more features) and useSWR (simpler) and both are fine. If you had any sort of local cache you could read/write to and have it sync with the server in the background, it would probably work for me. Or if there was a way to use Convex with one of these libraries, that'd also be fine (but not sure if/how that could work).
The two things I want are: 1) instant UI responsiveness, 2) don't flood the server with requests (make it easy to throttle).
And if you come up with anything (library or helper) for undo/redo, I'd definitely be interested! My dream solution is basically hooks like these I can use in components: https://liveblocks.io/docs/api-reference/liveblocks-react#useUndo
Anyway, thanks for the help!
14 replies
CCConvex Community
•Created by holden on 9/27/2023 in #general
Hi I m trying to create a Delete user
A more positive example is I loved the
usePaginatedQuery
hook! Pagination is always annoying, and it was GREAT how simple that was to do with Convex in React! Another example like this that FE devs like me often want but is hard to build yourself is undo/redo. Maybe outside the scope of Convex, but when Liveblocks had hooks that made that trivially easy to implement, I was thrilled!
I'll keep sharing feedback, thanks for listening!14 replies
CCConvex Community
•Created by holden on 9/27/2023 in #general
Hi I m trying to create a Delete user
Sure! What I want here is just to create an internal "admin" action that deletes all records across 4 tables where
ownerId = {value}
, and then deletes the user record.
I imagine I'll have other admin actions like this over time that may modify multiple tables, ideally in one transaction so it either succeeds or fails. It looks like it's actually pretty easy to do in a single mutation if I ignore pagination, so maybe I'll just start with that and not optimize any further until it causes a problem (fine if the action is slow, it's just for me).
I think what feels "simple" to me here is being able to define one function that does some action (like "delete a user"). Once I have to start breaking things up into multiple mutations and thinking about batches or scheduling, I feel like anything is doable but I've fallen out of the "pit of success" 🙂
The main value prop (for me) of a service like Convex or Firebase is that I can spend as much of my time as possible focusing on my UX/frontend, and have the backend "just work" for me. It's when I feel like I'm getting sucked into more complex backend-y work that I occasionally miss SQL (or Firebase, just from more past experience with it).
Since you asked, the other thing I ran into where I really felt this was when I had a slider sending mutations too fast (which made my UI laggy, and ran up my usage a lot even with just me testing). I looked into throttling/debouncing, optimistic updates, single flighting, etc but it was tricky to figure out. I ended up duplicating local state in zustand and throttling updates to Convex, but duplicating the state felt error prone and I don't feel confident I did it correctly. What I wanted there was something like react-query/useSWR/Replicache/ApolloClient, where someone smarter than me writes that local vs remote state logic, so I can have my UI write to "local" state and somehow not flood the backend with too many requests.14 replies
CCConvex Community
•Created by holden on 9/27/2023 in #general
Hi I m trying to create a Delete user
Ok thanks for the pointers, will try that!
Running a migration that affects multiple tables seems like a common use case, so anything you have planned (either in the platform or a helper) to make that easier would likely be very useful!
Overall liking Convex - ~80% of the time, I feel like it's nicer than using SQL. But there are these 20% cases when I feel like something is easy with SQL and hard with Convex. Hopefully that % goes down over time as the platform matures 🙂
14 replies
CCConvex Community
•Created by holden on 9/27/2023 in #general
Hi I m trying to create a Delete user
Thanks for the pointer, makes sense.
But it looks like there's no way to pass an arg (like userId) to the
migration
helper? I was using a closure to do this (code below). I guess I could modify that helper to accept args or write my own pagination logic in the mutations?
14 replies
CCConvex Community
•Created by holden on 9/22/2023 in #support-community
Import warning since upgrading Convex
ah ok, thanks. yeah, everything seems to be working fine, so maybe just a harmless warning and not specific to convex. i believe i'm using latest node.
i'll just ignore for now, and hope someone fixes upstream of you, thanks!
8 replies
CCConvex Community
•Created by holden on 9/21/2023 in #general
optional fields
Ok, makes sense, thanks for the explanation!
5 replies
CCConvex Community
•Created by holden on 9/21/2023 in #general
optional fields
sure! storing as "unset" is fine. Here's my mutation (omitting some irrelevant parts):
Calling it in a React client component like this:
When I console.log the args, I only get the id field, nothing for themeId:
5 replies