Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

henry40408/lmb-rs

Repository files navigation

Archival Notice

After time-consuming research, I discovered that the two existing major SQLite libraries, rusqlite and sqlx, are unable to meet the requirements for transactional updates. This is because transactions must be passed into the Lua VM, but rusqlite's transactions are !Send / !Sync, so they cannot satisfy the constraints. On the other hand, sqlx cannot be used with mlua due to its async characteristics.

I have decided to archive this project to provide future researchers interested in mlua with a substantial project to study.


lmb

lmb is a Lua function runner

Casual Maintenance Intended GitHub Workflow Status (with event) GitHub codecov

Features

  • Evaluate a Lua script.
  • Handle HTTP requests via a Lua script.
  • Schedule a Lua script with cron.

Installation

Prerequisites

  • Rust ≥1.80.0
git clone https://github.com/henry40408/lmb
cd lmb
cargo install --path . --locked

Usage

Find some examples:

lmb example ls

Evaluate an example:

lmb example eval --name hello

Evaluate Lua script:

$ lmb eval --file lua-examples/hello.lua
hello, world!

Handle HTTP requests with single script:

$ lmb serve --file lua-examples/echo.lua
(another shell session) $ curl -X POST http://localhost:3000 -d $'hello'
hello

License

MIT

About

Lua function runner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages