djfdyuruiry / lualinq

Lightweight LINQ like library for Lua.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lualinq

Lightweight library which allows functional querying and transformation of lua arrays and objects.

The syntax is very similar to the C# linq or Java 8 streams libraries, which are similar in syntax to SQL. It’s released with a BSD 3 clause license.


Install

There is a LuaRocks package for this library: https://luarocks.org/modules/djfdyuruiry/lualinq

To install, install luarocks, and then run:

luarocks install lualinq

Usage

local lualinq = require "lualinq"
local from = lualinq.from

local count = from({1,2,3,4,5}).
  where(function(v) return v > 2; end).
  count()

-- prints '3'
print(count)

Full documentation on all available functions can be found here


I forked this library to add Lua 5.3 support and update the luarocks module I maintain for this library. Originally authored by xanathar

Credit goes to buckle2000 for cleaning up the the original version of lualinq, see their work here

See the original repo for more info

About

Lightweight LINQ like library for Lua.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Lua 100.0%