static

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 8 Imported by: ? 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transpiler

type Transpiler struct {
	// contains filtered or unexported fields
}

Transpiler transpiles AIP-160 filters and AIP-132 order_by clauses against a resource message descriptor into static SQL clauses — constants inlined as literals — for callers baking SQL where no runtime parameters exist, such as code generators.

Only the resource's own top-level stored scalar fields are addressable: joined, byte-serialized, repeated and nested fields are excluded, since a static clause runs against the resource's bare table.

func NewTranspiler

func NewTranspiler(descriptor protoreflect.MessageDescriptor, opts ...TranspilerOption) (*Transpiler, error)

NewTranspiler builds a transpiler over the given resource message descriptor.

func (*Transpiler) TranspileFilter

func (t *Transpiler) TranspileFilter(filter string) (string, error)

TranspileFilter transpiles an AIP-160 filter into a bare SQL boolean expression, with column references qualified by their table name. An empty filter yields an empty clause.

func (*Transpiler) TranspileOrderBy

func (t *Transpiler) TranspileOrderBy(orderBy string) (string, error)

TranspileOrderBy transpiles an AIP-132 order_by into a bare SQL ordering expression, with column references qualified by their table name. An empty order_by yields an empty clause.

type TranspilerOption

type TranspilerOption func(*transpilerOptions)

TranspilerOption customizes a Transpiler.

func WithRegistry

func WithRegistry(registry *protoregistry.Files) TranspilerOption

WithRegistry provides the file registry resolving resource types, for callers whose descriptors are not linked into the binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL