Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 2.11 KB

File metadata and controls

83 lines (58 loc) · 2.11 KB

given

import "github.com/CaliLuke/go-typeql/v3/given"

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

Index

type Rows

Rows supplies typed input rows for a TypeQL given stage.

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

TypedRows contains values ordered by the declared TypeQL variable names.

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

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

Value is a typed value in a TypeQL given row.

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

Generated by gomarkdoc