driverclick

package
v0.0.0-...-fdbed73 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Shared = map[expr.Operator]RenderFN{
	expr.Literal: literal,
	expr.And:     basicCompound(expr.And),
	expr.Or:      basicCompound(expr.Or),
	expr.Not:     basicWrap(expr.Not),
	expr.Equals:  equals,
	expr.Range:   rang,
	expr.Must:    noop,
	expr.MustNot: basicWrap(expr.Not),

	expr.Wild:      literal,
	expr.Regexp:    literal,
	expr.Like:      like,
	expr.Greater:   greater,
	expr.GreaterEq: greaterEq,
	expr.Less:      less,
	expr.LessEq:    lessEq,
	expr.In:        inFn,
	expr.List:      list,
}

Shared is the shared set of render functions that can be used as a base and overriden for each flavor of sql

Functions

This section is empty.

Types

type Base

type Base struct {
	RenderFNs map[expr.Operator]RenderFN
}

Base is the base driver that is embedded in each driver

func (Base) Render

func (b Base) Render(e *expr.Expression) (s string, err error)

Render will render the expression based on the renderFNs provided by the driver.

type ClickhouseDriver

type ClickhouseDriver struct {
	Base
}

PostgresDriver transforms a parsed lucene expression to a sql filter.

func NewClickhouseDriver

func NewClickhouseDriver() ClickhouseDriver

NewPostgresDriver creates a new driver that will output a parsed lucene expression as a SQL filter.

type RenderFN

type RenderFN func(left, right string) (string, error)

RenderFN is a rendering function. It takes the left and right side of the operator serialized to a string and serializes the entire expression

Jump to

Keyboard shortcuts

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