GritQL Tutorial
docs.grit.io·2d
📋Tablegen
Preview
Report Post

Note: You do not need to learn GritQL to use Grit. New users should start with one of our many built-in migrations.

GritQL is a query language designed for searching and modifying source code, with semantics similar to SQL or other declarative query languages.

Patterns

The root of every GritQL query is a pattern to search for in a codebase. If you know JavaScript, you already know GritQL: any valid JavaScript code snippet is a valid GritQL pattern if you surround it with backticks.

For example, this query will find everywhere we log "Hello world!" in our codebase:

Click the "Run Pattern" button to run the query on a sample file. Notice how it is able to find the cases where the call i…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help