Discover Packages
github.com/rossedman/strata
internal
query
package
Version:
v0.3.1
Opens a new window with list of versions in this module.
Published: Oct 31, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package query parses strata's filter language and compiles it to SQL, so
every filter runs inside DuckDB rather than in application memory.
label.team = "payments" and age > 180d
ancestor("reg.io/base/go:1.21") and not has:sbom
stale in ["stale", "abandoned"] and label.env = "prod"
root ~ "reg.io/base/debian:*" and label.deprecated exists
Expr returns the SQL expression for a field, for use in SELECT, GROUP BY
and ORDER BY. Ref fields return the parent or root digest.
IsList reports whether a field holds several values per image, so a
group-by over it must unnest.
ParseBytes parses a size: 512, 10KB, 1.5GiB.
ParseDays parses a duration as days: 180d, 12h, 6w, 3mo, 1y, or a plain
number of days.
type And struct{ L, R Node }
And matches when both sides match.
Call is a function such as ancestor("reg.io/base/go:1.21").
Compare is field op value, such as age > 180d.
String formats a Compare.
type Compiled struct {
Where string
Args []any
}
Compiled is a WHERE clause and its positional arguments.
Compile parses and compiles a filter. An empty filter compiles to
"true".
CompileNode compiles a parsed filter.
Exists is field exists.
String formats an Exists.
Field describes one queryable field.
Fields returns every static field plus the label.<key> and
missing:<key> patterns, sorted by name, for help and docs.
Lookup resolves a field name, including label.<key> and missing:<key>.
Flag is a field used on its own as a condition, such as has:sbom.
type Node interface {
String() string
}
Node is a parsed filter expression.
Parse parses a filter. An empty filter parses to nil, which matches
every image.
type Not struct{ X Node }
Not matches when its operand does not.
type Or struct{ L, R Node }
Or matches when either side matches.
type SyntaxError struct {
Pos int
Msg string
}
SyntaxError reports a problem at a position in the filter.
Error formats the error with the 1-based column.
Value is a literal.
String formats a Value, quoting strings with the only escapes the lexer
reads, \" and \\, so printing and re-parsing gives the same value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.