elastic2sql

command
v0.0.0-...-0c02112 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

README

elastic2sql

Usage

Stream in the JSON query to translate and provide the desired table name as argument:

$ ./elastic2sql
usage: elastic2sql <table>
$ ./elastic2sql table < query.json
SELECT * FROM table WHERE foo.bar = 'aap'

Pipe to sneller cloud

$ cat query.json | ./elastic2sql table | curl -X POST -H 'Authorization: Bearer <<token>>' --data-binary @- 'https://aws-master-us-east-1.sneller-dev.io/query?database=db&json'

Pretty printing

Install SQL formatter:

$ npm install sql-formatter
$ echo '{"aggs":{}}' | ./elastic2sql table | npx sql-formatter
SELECT
  COUNT(*)
FROM
  table

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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