#Find column usages
3 messages · Page 1 of 1 (latest)
Hi @autumn star. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To find all usages of a specific database column in a Convex codebase, there isn't a built-in feature to automatically detect this. However, you can follow a manual approach to audit your codebase. Here are some steps you can take:
-
Search for field references: Look for instances where you're using
q.field()with the specific column name. For example, if you're looking for usages of a "regionId" field, you might search forq.field("regionId")in your codebase. -
Audit your queries: As suggested in Queries that scale, search for
.filter((q)calls in your codebase. This will help you identify places where you're filtering database results, which often involve field references. -
Check data modifications: Look for instances where you're updating the field. As mentioned in Queries that scale, scan for
.replace(and.patch(operations in your code. -
Examine your schema: Review your schema definitions to see where the field is defined and if it's used in any indexes.
-
Use your IDE's search functionality: Most modern IDEs have powerful search capabilities. You can use these to search for the column name across your entire project.