typeqlcheck

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package typeqlcheck is test support for validating generated TypeQL syntax with the official `typeql-check` CLI from typedb/typedb-tools.

The tool is a soft dependency: when the binary is not installed, assertions degrade to a one-time warning so contributors are never blocked. Set TYPEQL_CHECK_REQUIRED=1 (check.sh does this automatically when the binary is present) to turn a missing binary into a test failure instead.

Install with `make install-typeql-check`, or point TYPEQL_CHECK at a binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertValid

func AssertValid(t testing.TB, label, query string)

AssertValid fails the test if query is not syntactically valid TypeQL. When the binary is missing it warns once and returns, unless TYPEQL_CHECK_REQUIRED=1 is set, in which case it fails the test.

func Available

func Available() bool

Available reports whether the typeql-check binary can be found.

func Path

func Path() (string, bool)

Path returns the resolved typeql-check binary path and whether it was found. Resolution order: $TYPEQL_CHECK, $PATH, then $HOME/go/bin (where `make install-typeql-check` places it, matching the repo's staticcheck convention).

func Validate

func Validate(query string) error

Validate runs the query through typeql-check and returns an error describing the syntax problem if the query is not valid TypeQL. It returns an error only for invalid syntax or a failure to run the tool; callers must check Available() first.

Types

This section is empty.

Jump to

Keyboard shortcuts

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