given

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package given defines typed TypeQL input rows without a driver or CGo dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rows

type Rows interface {
	MarshalGivenRows() ([]byte, error)
}

Rows supplies typed input rows for a TypeQL given stage.

type TypedRows

type TypedRows struct {
	Variables []string  `json:"variables"`
	Rows      [][]Value `json:"rows"`
}

TypedRows contains values ordered by the declared TypeQL variable names.

func NewRows

func NewRows(variables ...string) *TypedRows

NewRows declares the variables shared by every row.

func (*TypedRows) Add

func (r *TypedRows) Add(values ...Value) error

Add appends one row of values in variable order.

func (*TypedRows) MarshalGivenRows

func (r *TypedRows) MarshalGivenRows() ([]byte, error)

MarshalGivenRows validates and encodes the rows for the driver.

type Value

type Value struct {
	Type  string `json:"type"`
	Value any    `json:"value,omitzero"`
}

Value is a typed value in a TypeQL given row.

Jump to

Keyboard shortcuts

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