config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package config provides the config for adapt query generation to targets.

Implementations may return their own config to disable some property types and functions, or provide their own additional functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(conf Config)

SetConfig sets the generation config to be used by all clauses.

Types

type Config

type Config struct {
	// If this is set, then the targets of SET, DELETE and REMOVE clauses will always be simple
	// variables referencing nodes or relationships instead of general expressions evaluating to
	// nodes or relationships (e.g. through a CASE expression or a startNode function invocation).
	// Setting this also implies that NULL is an invalid candidate.
	OnlyVariablesAsWriteTarget bool
	// These property types won't be generated
	DisallowedPropertyTypes []schema.PropertyType
	// The names of disallowed functions. Function names in this slice won't be generated.
	DisallowedFunctions []string
	// Functions returning property values in addition to the ones from the OpenCypher specifications.
	//
	// Guaranteed to be non-nil during query generation.
	AdditionalPropertyFunctions map[schema.PropertyType][]schema.Function
	// Functions returning structural values in addition to the ones from the OpenCypher specifications
	//
	// Guaranteed to be non-nil during query generation.
	AdditionalStructuralFunctions map[schema.StructuralType][]schema.Function
	// Aggregation functions in addition to the ones from the OpenCypher specifications
	//
	// Guaranteed to be non-nil during query generation.
	AdditionalAggregationFunctions map[schema.PropertyType][]schema.Function
	// Functions returning maps in addition to the ones from the OpenCypher specifications
	AdditionalMapFunctions []schema.Function
}

The Config for OpenCypher query generation

func GetConfig

func GetConfig() Config

GetConfig returns the currently set config.

Jump to

Keyboard shortcuts

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