Download Latest Version v1.19.0 source code.zip (485.8 kB)
Email in envelope

Get an email when there's a new version of Lapis

Home / v1.18.0
Name Modified Size InfoDownloads / Week
Parent folder
lapis-1.18.0-1.all.rock 2026-04-24 142.1 kB
lapis-1.18.0-1.rockspec 2026-04-24 5.4 kB
lapis-1.18.0-1.src.rock 2026-04-24 483.5 kB
README.md 2026-04-24 3.2 kB
v1.18.0 source code.tar.gz 2026-04-24 356.2 kB
v1.18.0 source code.zip 2026-04-24 480.8 kB
Totals: 6 Items   1.5 MB 2

HTTP and OpenResty

  • Added lapis.nginx.resty_http, an HTTP client backed by lua-resty-http.
  • lapis.nginx.http now automatically uses the lua-resty-http implementation from timer phase callbacks, where ngx.location.capture is unavailable.
  • Added documentation for HTTPS certificate verification for both the proxy-pass HTTP client and the new lua-resty-http client.
  • The two-argument http.request(url, body) shorthand now sets Content-Length when using the lua-resty-http path.

Models and Database

  • include_in now supports computed key functions returning db.list(...), allowing a single source object to match multiple related rows.

moon Tags\include_in pages, { name: (page) -> db.list page\get_tag_names! }, many: true, as: "tags"

  • include_in preserves transformed values from the value option when assigning results for computed db.list keys.

moon Tags\include_in pages, { id: (page) -> db.list page.tag_ids }, many: true, as: "tag_names", value: (tag) -> tag.name

  • Polymorphic belongs_to preloading now forwards preload options, such as skip_included, to the underlying model preload calls.

moon preload items, object: { [preload]: { skip_included: true } }

  • Added db.clause + db.clause syntax for combining clauses with OR.

moon active = db.clause status: "active" invited = db.clause invite_pending: true Users\select "where ?", active + invited

  • json_encodable now preserves table metatables, including cjson.array_mt, so empty JSON arrays remain arrays.

moon util.to_json { items: setmetatable {}, cjson.array_mt } -- {"items":[]}

  • OrderedPaginator:each_page(...) now accepts an initial cursor.

moon pager = Posts\paginated "order by id asc", per_page: 50, ordered: "id" for posts in pager\each_page 500 -- starts after id 500

Testing

  • Added simulate_request and simulate_action as clearer names for request simulation helpers. The old mock_request and mock_action names remain as deprecated aliases.
  • stub_request now sets up request params, GET/POST tables, session, cookies, headers, request method, URL fields, and custom request classes more completely.
  • Request simulation now uses higher-resolution time from LuaSocket.

Application and Flows

  • Requests now expose route_pattern in addition to route_name.
  • Renamed is_flow to is_flow_class to clarify that the helper checks flow classes, not flow instances.
  • Expanded and reorganized the flow documentation.

CLI

  • Third-party command modules can now be resolved directly as top-level commands, so packages no longer need to rely on the generic _ command path.
  • Added a shortcut action for lapis-exceptions.
  • Command discovery now checks module availability without requiring the module, avoiding swallowed load-time errors.

Documentation

  • Reworked the testing documentation around request simulation and stub_request.
  • Added documentation for computed db.list keys in model preloading.
  • Updated utility, flow, and exception handling documentation.
Source: README.md, updated 2026-04-24