prinz
prinz
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
awesome, thanks!!
15 replies
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
with this, conversations can be direct or group, and with the memberConversations, we can write a query that gets conversations and filters them by type, and using the conversationIds of those filtered conversations, we check if among those returned conversationIds, if the other user also shares the same conversationId, and from there return the similar conversation using that conversationId please correct me if I understood it incorrectly, thanks!
15 replies
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
memberConversations: defineTable({ memberId: v.id("members"), conversationId: v.id("conversations"), }) .index("by_member", ["memberId"]) .index("by_conversation", ["conversationId"]), conversations: defineTable({ content: v.string(), fileUrl: v.optional(v.string()), type: MessageType, deleted: v.boolean(), updatedAt: v.string(), }).index("by_type", ["type"]),
15 replies
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
ohh I see, yeah this is a more streamlined and flexible approach. It's worth the effort! Instead of two separate similar messages tables, channels, and direct, we streamline it to one that can be expanded as seen fit during mutations
15 replies
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
Hello, thanks for the input! Yes, that's what I was looking to accomplish, whereby I could use the indexes to query conversations between two members regardless of who initiated it. I thought by just having one, I'd only be able to access those initiated by memberOne and not those initiated by memberTwo, or vice versa. But like you said it seems like the conversation id is what is received when you query by either of the last two indexes. Just to make sure I understand, by using last index for example, we get the conversation Ids by memberTwo, and then if we want those between memberTwo and memberOne, we can add another query on top of that to get the conversation ids just between the both of them. And using those conversation Ids, we can then get the messages between the two. And by having both the last two indexes we're being redundant because it still gives the same conversation Id. If we didn't have the last two indexes, we'd have to query the whole document to find convos involving memebrOne, as per the first index, and from the query that results, see if there is a convo between member Two and One which would stifle performance a bit perhaps. But with one of the last two combined indexes, the last one, its already done, and we can either query by member Two and then One if needed, but not member One and then Two, correct? Also, if my thinking is not flawed, do we need the first index then, given we can accomplish that index with the second index, as well as accomplishing the last index with the second index, because we get the same conversation Id regardless? Apologies for the late reply🙏
15 replies
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
Hello, thanks for that resource! I just wanted to make sure if this is valid, and if it is, is it recommended? conversations: defineTable({ memberOneId: v.id("members"), memberTwoId: v.id("members"), createdAt: v.string(), updatedAt: v.string(), }) .index("by_memberOneId", ["memberOneId"]) .index("by_memberOne_to_memberTwo", ["memberOneId","memberTwoId"]) .index("by_memberTwo_to_memberOne", ["memberTwoId","memberOneId"]),
15 replies
CCConvex Community
Created by prinz on 2/20/2024 in #support-community
Prisma --> Convex
No description
15 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
No description
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
No description
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
nothing really, the console logging of the token, isAuthenticated and isLoading console.log'ed in page is showing, but for some reason, the same variables are not linking so as to use those components
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
that is my ConvexProviderWithProviderX.js file
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
No description
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
quick question, what is the auth.config.js file for?
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
yes, I believe so as well, thanks for clarifying!
14 replies
CCConvex Community
Created by prinz on 2/6/2024 in #support-community
AuthLoading
yeah i think so, thanks! Also does convex allow access to the token_id when we set up ConvexcProviderWithAuth, in that it's possible to use convex to get the token for use in a middleware.ts
14 replies