Repository navigation
Lapis 1.6.0
Additions
- Add a new general purpose
preloadfunction that can preload many relations
at once for many kinds of model instances, including recursively preloading relations - Addition of
cqueuesandlua-httpserver backend - Pgmoon connection status is logged to performance table for each request when
performance measurements are enable fetchrelations can provide a method for preloading with thepreloadoptiondefault_url_paramshas been added to request support object for extending the default parameters passed into `url_formatches_patternvalidation can be used to test an input against a Lua patternrelation_is_loadedfunction can be used to test if a model has a relation loadedmock_requestcan insert a session via a Lua tablelapis.timemodule with asleepfunction that executes correct implementation for the current backend server- If you use
wheninstead ofwherewhen creating an index an error is thrown lapis.spec.request, themock_requestfunction supportscookiesoption- Add
render_to_filemethod for widgets - Add documentation for
Flow
Changes
- Route precedence sorting now uses a score based approach where multiple variables or splats can affect the final order
- Mocked requests have
ngx.md5implemented withluacrypto - Query logs use luasocket to measure time elapsed for a more accurate measurement
- URL parsing uses
findandsubinstead ofmatchto parse very long paths faster (#498) db.NULLvalues are always stripped when inserting a new row from a model'screatemethod- Test server can be run even if there isn't a database configured
- Refactor backend implementation to be extensible to allow for
cqueues/lua-httpimplementation - Add support for test server to run on cqueues backend
- Replace
luacryptowithluaossl
Minor changes
- Lua and MoonScript are added as mime types in default
mime.typesfile (#513) - Various improvements to the documentation
Fixes
- Encoding a query string with a parameter with a boolean value will no longer throw an error
- Fix issue where
*.luawould be included in.gitignorefor Lua projects (#501) - A user set content type will no longer be overwritten when outputting with the
jsonaction return handler - Check for
Content-Dispositionheader for file uploads is no longer case sensitive
Note on cqueues/lua-http
With this release we're adding a new server backend for Lapis. Although the
backend is functional, there are some things that aren't available yet.
Database connections are shared across all requests so you have to be careful
about leaving transactions or state open. Additionally, there's no way to spawn
multiple workers. For production environments we still recommend OpenResty.