Search through bodies of all queries

I'd love to have a way to search the bodies of all queries.

Use-case: I want to replace a certain url that has been used in multiple places. Doing that now requires me going through hundreds or thousands of queries manually. Being able to find queries that contain a certain string would be great.

1 Like

Whoo boy! that's a lot of queries.

I don't know your architecture but might I suggest some things to help you out? While you are touching that much of your app anyway, it's worth doing some re-factoring to make things easier in the future.

There are also some devs here that have done far bigger projects than I have who will hopefully pitch in some best practices for managing that many queries - I certainly want to know as well.

As you do your search/replace maybe use variables as placeholders for anything that might change. A state variable like this {{myURL.value}}. Maybe you can use a module to hold some global variables for this and place the module on every page then you only have to manage the module.

Use the Query library for duplicate queries.

If you have a bunch of queries that are very similar, figure out how you can make one query do the work of the bunch of them by using variables, additionalScope, or other refactoring.

Make use of Modules if you have sections of your apps that perform basically the same function.

A good rule for complex applications is if two things are very nearly the same, figure out how to make them the same or get your users to accept the slight difference. Simplify.

Btw, welcome to the forum!

Haha, I might've been slightly exaggerating. Looks like we got 46 dashboards with between 5-20 queries each. It's not a huge issue for us, just takes a little time. And I agree it shouldn't be done this way in the first place.

But you know how it goes, just gotta do this one thing real quick and then months later it becomes an issue

Still think it could be a useful feature to be able to search through queries, even in a well planned architecture.

1 Like

Hey folks! Just want to mention here that the code search beta has recently been rolled out to 100% of cloud orgs! :mag:

You should now be able to find a code search tab in the left panel of your app editor:

2 Likes

@Kabirdas I love it, thanks for building this.