Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Logflare/epg_query

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EpgQuery

Installation

If available in Hex, the package can be installed by adding epg_query to your list of dependencies in mix.exs:

def deps do
  [
    {:epg_query, "~> 0.1.0", git: "https://github.com/abc3/epg_query"}
  ]
end

Usage

mix deps.get
make dev
iex(1)> EpgQuery.parse("select * from some_table")
{:ok,
 %{
   "stmts" => [
     %{
       "stmt" => %{
         "SelectStmt" => %{
           "fromClause" => [
             %{
               "RangeVar" => %{
                 "inh" => true,
                 "location" => 14,
                 "relname" => "some_table",
                 "relpersistence" => "p"
               }
             }
           ],
           "limitOption" => "LIMIT_OPTION_DEFAULT",
           "op" => "SETOP_NONE",
           "targetList" => [
             %{
               "ResTarget" => %{
                 "location" => 7,
                 "val" => %{
                   "ColumnRef" => %{
                     "fields" => [%{"A_Star" => %{}}],
                     "location" => 7
                   }
                 }
               }
             }
           ]
         }
       }
     }
   ],
   "version" => 130003
 }}

Benchmarks

Operating System: macOS
CPU Information: Apple M1 Pro
Number of Available Cores: 10
Available memory: 16 GB
Elixir 1.13.4
Erlang 25.0

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
reduction time: 0 ns
parallel: 1
inputs: none specified
Estimated total run time: 14 s

Benchmarking EpgQuery.Port.parse/1 ...
Benchmarking EpgQuery.parse/1 ...

Name                            ips        average  deviation         median         99th %
EpgQuery.Port.parse/1      188.41 K        5.31 μs   ±177.95%        5.21 μs        5.63 μs
EpgQuery.parse/1           108.99 K        9.18 μs   ±151.19%        8.88 μs       13.79 μs

Comparison: 
EpgQuery.Port.parse/1      188.41 K
EpgQuery.parse/1           108.99 K - 1.73x slower +3.87 μs

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/epg_query.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 81.2%
  • PLpgSQL 15.0%
  • Rust 3.2%
  • Ruby 0.5%
  • Makefile 0.1%
  • C++ 0.0%