Skip to content

pedroarmando/amqp-filter

Repository files navigation

amqp-filter: An SQL92 predicate evaluator in Erlang.

Build status

amqp-filter is an Erlang library that allows to evaluate SQL-92 predicates in the same way as in Azure Service Bus.

It supports the BNF grammar specified here.

To create the lexer and parser we have used leex and yecc

Usage:

amqp_filter:evaluate("ID IN (123, 456, 789)", [{"ID", 456}]).
true
amqp_filter:evaluate("USERNAME = 'NICK' AND AGE > 18", [{ "USERNAME", "NICK" }, { "AGE", 25 }]).
true
amqp_filter:evaluate("YEAR % 4 = 0 AND (NOT YEAR % 100 = 0 OR YEAR % 400 = 0)", [{ "YEAR", 2018 }]).
false

Integrating to your project

amqp-filter is available as a Hex.pm package and uses Rebar 3 as its build system so it can be easily integrated in your project.

Rebar

Adding amqp-filter as a package dependency in your rebar.config file:

{deps, [{amqp_filter, "0.3.7"}]}.

Erlang.mk

Adding amqp-filter as a package dependency in your Makefile:

DEPS = amqp_filter
dep_amqp_filter = hex 0.3.7

Mix

Adding amqp-filter as a package dependency in your mix.exs file:

def project do
  [
    deps: [{:amqp_filter, "~> 0.3.7"}]
  ]
end

Complete documentation

See https://hexdocs.pm/amqp_filter/ for a complete documentation.

Building

It is recommended to build amqp-filter on Linux.

About

A SQL92 predicate evaluator in Erlang.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published