sql

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sql exposes the Elasticsearch SQL endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Search(c zhttp.Context)

Search runs a SQL query and renders the rows it produced

@Id SQLSearch @Summary SQL search for compatible ES @security BasicAuth @Tags Search @Accept json @Produce json @Param query body sql.Request true "Query" @Param format query string false "Response format: json, txt, csv, tsv" @Success 200 {object} sql.Response @Failure 400 {object} meta.HTTPResponseError @Router /es/_sql [post]

func Translate

func Translate(c zhttp.Context)

Translate returns the query DSL a SQL query maps to

@Id SQLTranslate @Summary SQL translate to query DSL for compatible ES @security BasicAuth @Tags Search @Accept json @Produce json @Param query body sql.Request true "Query" @Success 200 {object} map[string]interface{} @Failure 400 {object} meta.HTTPResponseError @Router /es/_sql/translate [post]

Types

type Request

type Request struct {
	Query     string `json:"query"`
	FetchSize int    `json:"fetch_size"`
	Format    string `json:"format"`
}

Request is the body of a SQL request.

Jump to

Keyboard shortcuts

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