package
0.0.0-20211214223051-68b45a2eb8e1
Repository: https://github.com/stevejuma/pkg.git
Documentation: pkg.go.dev

# README

Lucene Query SQL Generator

A simple library that takes a predicate in the lucene query syntax format and converts it to a sql query with placeholders replaced.

package querytest

query, err := ToSQL("body:(+apple +mac)", &ToSQLOptions{
    DefaultField: "id",
})
if err != nil {
    log.Fatalf("Error while parsing query: %v", err)
}
query == {
    filter: `body:(+apple +mac)`,
    sql:    `(body = ? AND body = ?)`,
    args:   []interface{}{"apple", "mac"},
}

# Functions

ToSQL returns the query as SQL string.

# Constants

PlaceHolder is the constant value used to indicate a variable substitution.
No description provided by the author
No description provided by the author

# Variables

Enum value maps for SearchMode.
Enum value maps for SearchMode.

# Structs

Fragment a generated sql fragment with args.
Query is the generated query.
ToSQLOptions specifies properties for the ToSQL function.

# Type aliases

ColumnHandler returns the true expression for the column.
InHandler is a handler for generating in values.
SearchMode is the mode to apply searches in.