Field Reference

This page is the authoritative reference for every field available in the sqry query language. Fields are grouped by category. For syntax rules and operators, see Query Syntax.

Symbol Fields

Symbol fields match attributes of individual code symbols.

FieldValues / TypeDescriptionExample
kind:function, class, struct, method, interface, trait, enum, module, constant, variable, type, macro, namespaceThe syntactic kind of the symbol.kind:function
name:String (segment match) or name~=/regex/Symbol name. Bare value does a case-insensitive segment match: name:login matches login, UserLogin, MyClass.login. Use ~= for regex.name:handler, name~=/^test_/
lang:rust, python, typescript, javascript, go, java, c, cpp, csharp, kotlin, swift, scala, ruby, php, lua, r, dart, groovy, elixir, haskell, perl, sql, shell, zig, vue, svelte, html, css, terraform, puppet, pulumiSource language of the file containing the symbol.lang:rust, lang:typescript
path:Glob pattern or path~=/regex/File path relative to the index root. Supports ** globbing.path:src/api/**, path:*.rs
visibility:public, privateSymbol visibility. public matches exported symbols (pub, export, public). private matches internal symbols.visibility:public
async:true, falseWhether the symbol is declared async.async:true
returns:String (type name, segment match)Return type name. Matches functions whose return type contains the given string.returns:Result, returns:Promise

Relation Fields

Relation fields traverse the cross-file call graph. They require a pre-built index (sqry index .). They are not available with sqry search.

FieldValues / TypeDescriptionExample
callers:Symbol nameSymbols (functions or methods) that call the named symbol. Traverses incoming Calls edges.callers:authenticate
callees:Symbol nameSymbols called by the named symbol. Traverses outgoing Calls edges.callees:main
imports:Module or symbol nameFiles or modules that import the named symbol or module.imports:database, imports:lodash
exports:Symbol nameSymbols exported by the named module.exports:UserService
impl:Trait or interface nameStructs, classes, or types that implement the named trait or interface.impl:Serialize, impl:Iterator

Scope Fields

Scope fields match symbols based on their position in the containment hierarchy.

FieldValues / TypeDescriptionExample
parent:Symbol nameThe immediate parent symbol. Matches methods whose direct container is the named class or struct.parent:ApiController
scope.type:class, struct, module, trait, interface, function, and other kind: valuesThe kind of the immediately containing scope.scope.type:class
scope.name:String (segment match)The name of the immediately containing scope.scope.name:UserService
scope.ancestor:String (segment match)Any ancestor scope at any nesting depth. Matches symbols transitively nested under the named scope.scope.ancestor:Api

Scope field examples

Find all methods inside classes:

sqry query "scope.type:class AND kind:method"

Find all symbols defined inside UserService:

sqry query "scope.name:UserService"

Find all symbols nested anywhere under Api, regardless of depth:

sqry query "scope.ancestor:Api"

Find all methods of ApiController:

sqry query "kind:method AND parent:ApiController"

Combining Fields

All fields can be combined with AND, OR, NOT, and parentheses:

# Public async functions in Rust
sqry query "lang:rust AND kind:function AND visibility:public AND async:true"

# Classes or structs anywhere in the models directory
sqry query "(kind:class OR kind:struct) AND path:src/models/**"

# Functions that call process_data but are not test functions
sqry query "callers:process_data AND NOT name~=/test/"