Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. elasticsql

elasticsql

MITGov1.0.1

A Go library that converts SQL queries to Elasticsearch DSL for easier query construction.

GitHubGitHub
1.2k stars198 forks0 contributors

What is elasticsql?

ElasticSQL is a Go library that converts SQL queries into Elasticsearch Domain Specific Language (DSL). It allows developers to write queries using familiar SQL syntax while generating the corresponding Elasticsearch JSON queries underneath. This tool solves the problem of Elasticsearch's steep learning curve by providing a SQL interface to its powerful search capabilities.

Target Audience

Go developers working with Elasticsearch who want to write queries using SQL syntax rather than learning Elasticsearch's native query DSL. It's particularly useful for teams transitioning from relational databases to Elasticsearch.

Value Proposition

Developers choose ElasticSQL because it significantly reduces the learning curve for Elasticsearch querying while maintaining compatibility with most Elasticsearch versions. Unlike other solutions, it focuses specifically on Go applications and avoids deprecated DSL patterns.

Overview

convert sql to elasticsearch DSL in golang(go)

Use Cases

Best For

  • Migrating SQL-based applications to use Elasticsearch as a backend
  • Go developers who need to generate Elasticsearch queries programmatically
  • Teams familiar with SQL syntax but new to Elasticsearch query DSL
  • Building query interfaces that accept SQL and output Elasticsearch-compatible JSON
  • Prototyping Elasticsearch queries using a more familiar query language
  • Converting existing SQL queries to work with Elasticsearch data

Not Ideal For

  • Projects requiring SQL JOINs or complex relational queries across multiple Elasticsearch indexes
  • Teams that need fine-grained control over Elasticsearch query DSL for advanced optimizations or niche features
  • Non-Go development environments or polyglot codebases where language-agnostic tools are preferred
  • Applications where sub-millisecond query translation latency is critical, as the Go library adds overhead

Pros & Cons

Pros

Comprehensive SQL Support

Handles a wide range of SQL operators including =, !=, >, <, IN, NOT IN, LIKE, and BETWEEN, as detailed in the README's feature list, making it versatile for common queries.

Elasticsearch-Specific Aggregations

Supports not only standard SQL functions like COUNT and AVG but also Elasticsearch-native stats, extended_stats, and percentiles, enhancing analytical capabilities beyond typical SQL.

Version Compatibility

Avoids deprecated DSL filters, ensuring compatibility across multiple Elasticsearch versions, which is explicitly noted in the README for broader adoption.

Field Escaping for Keywords

Properly handles Elasticsearch keywords through backtick escaping, preventing conflicts with reserved terms like 'order' or 'timestamp', as shown in the usage examples.

Cons

Missing SQL Features

Lacks support for NULL checks, JOIN expressions, and HAVING clauses, limiting its use for full SQL equivalence and complex data relationships, as admitted in the README's todo list.

LIKE Operator Limitations

Currently uses match phrase queries for SQL LIKE, which may not behave identically to SQL wildcard patterns and could change in future updates, adding uncertainty for pattern matching.

Go-Only Implementation

Locked to the Go ecosystem, making it unsuitable for projects in other languages or teams seeking cross-platform query translation tools.

Frequently Asked Questions

Quick Stats

Stars1,188
Forks198
Contributors0
Open Issues13
Last commit3 years ago
CreatedSince 2016

Tags

#search#data-querying#elastic#dsl#go-library#database-query#query-translation#search-engine#golang#go#elasticsearch#sql

Built With

G
Go

Included in

Go169.1k
Auto-fetched 11 hours ago

Related Projects

elasticelastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch

Stars7,435
Forks1,138
Last commit2 years ago
go-elasticsearchgo-elasticsearch

The official Go client for Elasticsearch

Stars6,069
Forks645
Last commit1 day ago
clickhouse-goclickhouse-go

Golang driver for ClickHouse

Stars3,357
Forks718
Last commit14 hours ago
zoektzoekt

Fast trigram based code search

Stars2,087
Forks267
Last commit14 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub