Clever Tagline
Clever Tagline
CCConvex Community
Created by Clever Tagline on 12/13/2024 in #support-community
Request: Is a document is referenced anywhere else?
If this check would only happen occasionally, and the regionId fields were indexed (helpfully with a common name), you could enumerate your schema for any tables that have that field, and query for a matching id.
How would that be accomplished? I've not delved into traversing the schema programmatically.
22 replies
CCConvex Community
Created by Clever Tagline on 12/13/2024 in #support-community
Request: Is a document is referenced anywhere else?
I can accept that. I'll just work with what I've got and try to be careful about remembering to add the relevant table searches.
22 replies
CCConvex Community
Created by Clever Tagline on 12/13/2024 in #support-community
Request: Is a document is referenced anywhere else?
So in short, it's doable, but would add a lot of overhead even to track documents in a single field.
22 replies
CCConvex Community
Created by Clever Tagline on 12/13/2024 in #support-community
Request: Is a document is referenced anywhere else?
Appreciate the feedback, Tom. I'm not familiar with foreign key constraints, but after looking it up, I'm not sure that it matches my desire for this function that I'm envisioning. The reference I found says that foreign key constraints are "used to prevent actions that would destroy links between tables." In the situation I described, I don't want to prevent any action on the Convex side. I guess what I'm looking for is a project-wide search feature: search all tables for any reference to a given document. In fact, I don't even want the actual references found. I just want a boolean that tells me whether or not any foreign keys exist. Whatever calls this function would be responsible for deciding what to do with the result.
22 replies
CCConvex Community
Created by Clever Tagline on 12/13/2024 in #support-community
Request: Is a document is referenced anywhere else?
I appreciate the suggestion about using Convex ents, but I'm too far into development to pivot to that setup. Just to be clear, the main purpose of my original post was to submit a feature request. Preventing a document from being deleted is a secondary issue. While I appreciate the tips in that direction, I'm still curious to hear from the dev team if that function concept I mentioned is something that could be added as a built-in Convex feature. My main goal is to find an easier way to check for any reference to a given document across all of the tables in a project without needing to build a function that queries each table one by one.
22 replies
CCConvex Community
Created by burnstony#1975 on 12/12/2024 in #support-community
httpAction
The problem I see is that the code snippet @burnstony#1975 shared is directly from the docs, where it shows unpacking both author and body from the request.
11 replies
CCConvex Community
Created by burnstony#1975 on 12/12/2024 in #support-community
httpAction
Can you share an example of how you're calling the HTTP endpoint?
11 replies
CCConvex Community
Created by burnstony#1975 on 12/12/2024 in #support-community
httpAction
I'm guessing you're testing this in the Dev deployment?
11 replies
CCConvex Community
Created by cyremur on 9/30/2024 in #support-community
Delta updates on query? - understanding bandwidth
Appreciate the info. As I said earlier, this isn't really my type of game. My wife might be interested in taking it for a spin, though. I'll show her the screenshot and if she's interested, I'll DM you.
25 replies
CCConvex Community
Created by David Alonso on 11/30/2024 in #support-community
Cannot store/validate `undefined` in array?
In your code snippet you have the literal word or instead of the "or" operator ||. Not sure if that could be contributing to any of the issues you're experiencing.
13 replies
CCConvex Community
Created by David Alonso on 11/30/2024 in #support-community
Cannot store/validate `undefined` in array?
I know that undefined is scrubbed if passed as a single argument value to a function (more info from the Convex side in this thread), but I wouldn’t expect it to scrub an entire function call if a single array value is undefined.
13 replies
CCConvex Community
Created by ChrisLi on 11/29/2024 in #support-community
Is that possible to convert a type to validator?
There may be a way to go the direction you asked. I just haven't played with it yet (or searched for a solution) to find out how.
7 replies
CCConvex Community
Created by ChrisLi on 11/29/2024 in #support-community
Is that possible to convert a type to validator?
Would it work for your use case to do the reverse, turning validators into types? Here's an example how to do that:
export const taskGroup = v.union(
v.literal("Personal"),
v.literal("Work"),
v.literal("Family"),
v.literal("Church")
)

export type TaskGroup = Infer<typeof taskGroup>
export const taskGroup = v.union(
v.literal("Personal"),
v.literal("Work"),
v.literal("Family"),
v.literal("Church")
)

export type TaskGroup = Infer<typeof taskGroup>
7 replies
CCConvex Community
Created by too_easy on 11/25/2024 in #support-community
ConvexAuthNextjsServerProvider not exported
Sorry, but this is getting into unfamiliar territory. I'm not a NextJS guy. I only spotted the earlier problem because it was a simple typo. Hoping that someone else who uses NextJS with Convex can take it from here.
12 replies
CCConvex Community
Created by too_easy on 11/25/2024 in #support-community
ConvexAuthNextjsServerProvider not exported
I ran a quick test with the import using @convex-dev/auth, and that provider is there.
12 replies
CCConvex Community
Created by too_easy on 11/25/2024 in #support-community
ConvexAuthNextjsServerProvider not exported
Not sure if this is a typo in your post, but you said that the provider isn't in @convex/auth. The docs mention@convex-dev/auth, which is different.
12 replies
CCConvex Community
Created by David Alonso on 11/2/2024 in #support-community
Mutation error: `Returned promise will never resolve` caused by triggers
My bad. I've been mostly following the conversation in this thread, not necessarily following all links.
54 replies
CCConvex Community
Created by David Alonso on 11/2/2024 in #support-community
Mutation error: `Returned promise will never resolve` caused by triggers
I had to go digging to find where those examples were shown. Ironically they're right under the text that @David Alonso quoted, which comes from the "Best Practices" page under "Production". 🫢 Admittedly I don't recall reading that page yet (I thought I had, but those functions don't look familiar), and I'm trying to figure out why. First off, I guess I've seen the phrase "helper functions" enough that I thought that the text David quoted was from some other part of the docs that I had read. That aside, I'm guessing that I missed it because my approach to docs is to read the first few pages/sections to get the core info that I need, then to refer to the rest on an as-needed basis; e.g. to brush up on specific features. For me, I'd love to see the whole "Best Practices" page surfaced higher in the docs hierarchy. It feels buried in its current location, plus I feel that a list of best practices is useful for all phases of development, not just production. If I'd seen those example functions earlier in my introduction to Convex, it would have been really helpful as I was mulling over how to solve certain problems.
54 replies
CCConvex Community
Created by David Alonso on 11/2/2024 in #support-community
Mutation error: `Returned promise will never resolve` caused by triggers
For a while I've been a little foggy on what such "helper functions" might look like, but I think I saw an example in a video posted to the Convex YT channel last night. Jamie walks through the recreation of a Pokemon-related app that was demonstrated on Theo's channel. Here's a link to the relevant part of the video where he mentions this helper (updateTally). Having an example like this in the docs would be really helpful IMO.
54 replies
CCConvex Community
Created by hamid1882 on 11/20/2024 in #support-community
extra field `ttl` that is not in the validator - cache component
When you say "cache component" are you referring to the Action Cache component, or the query caching available in the convex-helpers package?
7 replies