# ANN: LightQuery

**URL:** <https://discourse.julialang.org/t/ann-lightquery/16482>\
**Category:** General Usage\
**Created:** [October 18, 2018, 3:14am UTC](https://discourse.julialang.org/t/ann-lightquery/16482 "2018-10-18T03:14:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Post date:** [October 18, 2018, 3:14am UTC](https://discourse.julialang.org/t/ann-lightquery/16482/1 "2018-10-18T03:14:59Z")

</div>

Hey, so this is actually [a pretty cool one](https://github.com/bramtayl/LightQuery.jl). If you’re an author of a query-like package, chances are, you only will need a few method wrappers to make your package compatible with LightQuery. Then, users can use LightQuery to easily mix and match various backends. Here’s an example. First, make the wrappers.

```julia
using LightQuery: @query

import DataFramesMeta: AbstractDataFrame, where
where(d::AbstractDataFrame, f_tuple::Tuple{Function, Expr}) = where(d, f_tuple[1])

import QueryOperators: Enumerable, orderby, query
orderby(source::Enumerable, f_tuple::Tuple{Function, Expr}) = orderby(source, f_tuple...)

```

Now mix and match!

```julia
julia> @query DataFrame(a = [0, 1, 2], b = [2, 1, 0]) |>
           where1(_, _.a .> 0) |>
           query(_) |>
           orderby1(_, _.b)
2x2 query result
a │ b
──┼──
2 │ 0
1 │ 1

```

---

<div class="post-metadata">

**Author:** ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Post date:** [October 18, 2018, 3:23am UTC](https://discourse.julialang.org/t/ann-lightquery/16482/2 "2018-10-18T03:23:41Z")

</div>

Please let me know (open an issue) if you’d like help adding LightQuery compatibility methods to your package. I’d feel rude tagging query package authors but I’m hoping they’ll see this.

---

<div class="post-metadata">

**Author:** ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Post date:** [January 28, 2019, 1:36am UTC](https://discourse.julialang.org/t/ann-lightquery/16482/3 "2019-01-28T01:36:50Z")

</div>

Version 0.1 is up. Take a look!
