Changelog

v1.8.2 — September 21 2020

Additions

db.delete can take additional arguments for RETURNING , Model\delete method also supports additional arguments to control returning clause

can take additional arguments for , method also supports additional arguments to control returning clause get_X_paginated model relation method now supports passing where and order options to the paginator constructor

Fixes

Using order and group at the same time with Model\include_in will no longer generate an invalid query

and at the same time with will no longer generate an invalid query When running lapis command, the environment is immediately loaded when checking what commands are available for the server, fixes #665

command, the environment is immediately loaded when checking what commands are available for the server, fixes #665 lapis.nginx.cache can correctly serialize array and boolean types that can result from parameter parsing, fixes 683

can correctly serialize array and boolean types that can result from parameter parsing, fixes 683 The substring - is no longer matched by accident for route pattern filters #696

Changes

When running in busted , the test environment is set as the default environment any tests are run. It is not longer necessary to have a setup or use_test_env call to configure the environment

, the environment is set as the default environment any tests are run. It is not longer necessary to have a or call to configure the environment Default buffer size and timout for parsing multipart form data has been increased to allow for slower connections (4k bytes per 5 seconds)

All logging goes stdout when not running in Nginx

Compatibility patches for Lua 5.2, 5.3, 5.4

Improved error message for some lapis commands when using an incomplete configuration

commands when using an incomplete configuration Improved error message when file can not be written when generating app files

(Internal) default_environment function moved to lapis.environment module, added set_default_environment function

function moved to module, added function Better error message when trying to use belongs_to with composite key ( has_one should be used instead)

with composite key ( should be used instead) Better error when trying to use default composite primary key with a has_one relation

Misc

Test suites run across on all versions of Lua on GitHub actions

Added docs for how request parameters are parsed and merged

Added docs for how the default environment works

Fixed bug in docs generator where code snippets were not appearing

The --trace option for the lapis command is enabled by default when running in test

option for the command is enabled by default when running in test Fix minor typos in docs

v1.8.1 — April 27 2020

Fixes

Fix error when parsing Model\paginated() model method arguments"“to detect if ordered paginator should be used

v1.8.0 — April 24 2020

Deprecations

The flip and local_key used with include_in or any relations are now deprecated. Replacement syntax available in documentation for Model\include_in

Additions

Add support for a column mapping table when specifying the key for include_in and any relations. See more documentation for Model\include_in

and any relations. See more documentation for Add support for composite foreign keys with include_in and relations

and relations each_item method for Paginators that will return a Lua iterator for going over every row but queries in batches set by per_page

method for Paginators that will return a Lua iterator for going over every row but queries in batches set by An ordered option can be passed to Model\paginated an get_X_paginated to create an OrderedPaginator instead of a OffsetPaginator

option can be passed to an to create an instead of a Add skip_render action render option to prevent Lapis from writing anything (Suitable for manually writing to output buffer with something like ngx.print )

action render option to prevent Lapis from writing anything (Suitable for manually writing to output buffer with something like ) fetch relations can now specify if they return a collection of items with many so nested preloading can traverse the loaded objects

relations can now specify if they return a collection of items with so nested preloading can traverse the loaded objects add serve alias for the lapis server command line command

alias for the command line command add app_only code cache option for cqueues to attempt to load app on every dispatch

code cache option for cqueues to attempt to load app on every dispatch A resty_mysql object can be included in the MySQL configuration object to provide additional parameters when initializng a resty.mysql connection

object can be included in the MySQL configuration object to provide additional parameters when initializng a connection Pgmoon connections will now read the timeout field from the PostgreSQL config object (Contributed by turbo 679)

field from the PostgreSQL config object (Contributed by turbo 679) Add set_logger and get_logger functions to the lapis.db.mysql and lapis.db.postgres module

and functions to the and module ( lapis.db.postgres ) escape_identifier function will now flatten db.list objects into raw SQL

) function will now flatten objects into raw SQL ( lapis.db.postgres.schema ) create_index support a concurrently option to create index concurrently (Contributed by Michael Ball 659)

) support a option to create index concurrently (Contributed by Michael Ball 659) add test validation for manually specifying a function to test input

Changes

assert_error will now fail with error if the error it yielded was not captured and execution attempted to continue

will now fail with if the error it yielded was not captured and execution attempted to continue initial project templates use content_by_lua_block (Contributed by ryanford 674)

(Contributed by ryanford 674) each_page method on paginators no longer allocates a coroutine, a plain function iterator is used

method on paginators no longer allocates a coroutine, a plain function iterator is used attempting to preload an object that isn’t a class will throw an error

attempting to use an invalid order with OrderedPaginator will throw an error

will throw an error measure_performance now works even when outside of nginx when reporting query time

now works even when outside of nginx when reporting query time ( lapis.html ) classnames ignores empty strings and will return first argument directly if passed a string

) ignores empty strings and will return first argument directly if passed a string ( lapis.logging ) query log function can now take a prefix and duration

) log function can now take a prefix and duration Removed undocumented locals action render option

Fixes

Fix bug where internal shell_escape function would strip ' characters

characters Returning { json = false } in action render will actually render false as json instead of skipping json render

Documentation

Started rewriting how options tables are described in the documentation. Uses a grid layout with collapsing examples.

Many parts of Models documentation have been rewritten for clarity

Remove outdated references to fields that are deprecated/removed (eg. cmd_url )

) Add documentation for the timestamp option for model\update

option for Updated colors of site to be blue

Misc

Specs now run on GitHub actions with matrix for LuaJIT, OpenResty’s LuaJIT, and all versions of Lua

We now have a MoonScript Discord, join here: https://discord.gg/Y75ZXrD

Fix typo in docs from Chris Tanner 621

Fix typo in docs from TangentFoxy 634 685 672

v1.7.0 — April 2 2018

Changes

Replaced the CSRF implementation, removed the key parameter and replaced with it randomly generated string stored in cookie.

parameter and replaced with it randomly generated string stored in cookie. Sessions now use the lapis.encoding module to encode an decode. Session loading error messages have changed to include the error from encode_with_secret and decode_with_secret

module to encode an decode. Session loading error messages have changed to include the error from and Remove all support for luacrypto, luaossl is required

Additions

Add support for chaning HMAC function, add sha256 HMAC config option

Support parsing cookies when there are multiple cookie headers

Add enum type fro MySQL

type fro MySQL Add support for encoding NULL and empty arrays for to_json and JSON render

and JSON render Add config template for cqueues/lua-http support

Request object for cqueues/lua-http contains all the same fields as OpenResty counterpart

Performance object is available for cqueues/lua-http

Environment name is shown on server start log

Add bind_host config option to set which interface cqueues/lua-http binds to, defaults to 0.0.0.0

Fixes

Fix issue with MySQL migrations where query result was not being converted to number

Fix a crash when request args could not be parsed

Fix a crash when the query parameter type changes when being parsed (between table and literal)

json_params works with cqueues/lua-http

works with cqueues/lua-http cqeueus/lua-http test server now works correctly, is now part of CI

cqeueus/lua-http will no longer get stuck in infinite loop when port is already taken

cqeueus/lua-http will only ready & parse body for form encoded content type

Terminal output buffering is disabled for cqeueus/lua-http so service files can read logs from stdout/stderr

v1.6.0 — July 20th 2017

Additions

Add a new general purpose preload function that can preload many relations at once for many kinds of model instances, including recursively preloading relations

function that can preload many relations at once for many kinds of model instances, including recursively preloading relations Addition of cqueues and lua-http server backend

and server backend Pgmoon connection status is logged to performance table for each request when performance measurements are enable

fetch relations can provide a method for preloading with the preload option

relations can provide a method for preloading with the option default_url_params has been added to request support object for extending the default parameters passed into url_for

has been added to request support object for extending the default parameters passed into matches_pattern validation can be used to test an input against a Lua pattern

validation can be used to test an input against a Lua pattern relation_is_loaded function can be used to test if a model has a relation loaded

function can be used to test if a model has a relation loaded mock_request can insert a session via a Lua table

can insert a session via a Lua table lapis.time module with a sleep function that executes correct implementation for the current backend server

module with a function that executes correct implementation for the current backend server If you use when instead of where when creating an index an error is thrown

instead of when creating an index an error is thrown lapis.spec.request , the mock_request function supports cookies option

, the function supports option Add render_to_file method for widgets

method 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.md5 implemented with luacrypto

implemented with Query logs use luasocket to measure time elapsed for a more accurate measurement

URL parsing uses find and sub instead of match to parse very long paths faster (#498)

and instead of to parse very long paths faster (#498) db.NULL values are always stripped when inserting a new row from a model’s create method

values are always stripped when inserting a new row from a model’s method Test server can be run even if there isn’t a database configured

Refactor backend implementation to be extensible to allow for cqueues / lua-http implementation

/ implementation Add support for test server to run on cqueues backend

Replace luacrypto with luaossl

Minor changes

Lua and MoonScript are added as mime types in default mime.types file (#513)

file (#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 *.lua would be included in .gitignore for Lua projects (#501)

would be included in for Lua projects (#501) A user set content type will no longer be overwritten when outputting with the json action return handler

action return handler Check for Content-Disposition header 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.

v1.5.1 — July 21st 2016

Security Fixes

The trim implementation was vulnerable to high CPU usage with a specially crafted string due to how the pattern was written. (More information: 4a58f5c1)

Additions

has_one relations can specify a local_key (similar to the parameter passed to include_in )

relations can specify a (similar to the parameter passed to ) has_many relations can specify a local_key

relations can specify a Add a generate template for flows: lapis generate flow my_flow

Changes

Flows now use _ as the backing variable, so it’s clear they can be used on any type of object. (Previously _req )

as the backing variable, so it’s clear they can be used on any type of object. (Previously ) Interval fields cleaned up and renamed on Request to make way for different server backends

to make way for different server backends Nginx specific modules moved to make way for different server backends (daurnimator)

Add /opt/openresty/nginx/sbin/ to the OpenResty search path for lapis server (Cristian Haunsen)

Fixes

has_one work correctly by default if primary key is not id

work correctly by default if primary key is not Many documentation fixes, thanks to all the contributors

Host and port correct passed to console MySQL connection (Douglas Roeder)

Test environments automatically close database connections to avoid lingering connections due to Busted hiding module

v1.5.0 — March 25th 2016

Additions

Add flow method to request object for invoking flows

method to request object for invoking flows You can now pass output headers to write and action return values

and action return values has_one relations now work with where clause

relations now work with clause Better error message for missing value during query interpolation

MySQL db now supports db.list

Changes

Error handling interface rewritten to match regular actions

Any db.NULL passed to Model.create will be stripped

passed to Model.create will be stripped Any db.NULL passed to Model.update will be stripped, and not assigned to updated model

passed to Model.update will be stripped, and not assigned to updated model Flows instances inherit the __call metamethod

metamethod Passing nil as an argument to truncate tables will error

as an argument to truncate tables will error Request support methods no longer take up names on the request object

The cookie and session loading code is now overridable

Layout loading works the same everywhere: provide either module name or layout widget

Fixes

Fix crash when using ? inside query value with no interpolation. Interpolation is only performed when extra fields are passed.

inside query value with no interpolation. Interpolation is only performed when extra fields are passed. Empty where in include_in and find_all will no longer generate invalid query

v1.4.3 — January 23rd 2016

Additions

url_for will only include optional components of routes if all nested parameters are provided

will only include optional components of routes if all nested parameters are provided time_ago_in_words is documented, add date module as a dependency

is documented, add module as a dependency validate can take options, add key option to return errors as hash table instead of array

can take options, add option to return errors as hash table instead of array layout field of app can be specified as string, will be loaded as module from views directory at runtime

Fixes

Fix issue where url_for was including character class of named parameter in result

was including character class of named parameter in result Fix issue with --trace flag interrupting arguments of command line commands

v1.4.2 — January 22nd 2016

Additions

Read about all the new route matching syntax: Routes and URL patterns

Routes now have a precedence and are sorted. Static routes have highest precedence

New syntax for optional parts of routes using parentheses

Splats in routes are no longer greedy, text after splat can match

Named parameters in routes are no longer greedy, text after parameter can match

Named parameters can take character classes

url_for can correctly fill the splat parameter

can correctly fill the splat parameter Add allow_error option to mock_request to allow 500 error to return without failing spec

option to to allow 500 error to return without failing spec Add documentation for OrderedPaginator

Changes

Empty class attributes within HTML builder do not add a blank attribute

Fixes

OrderedPaginator with multiple fields now works correctly when fetching additional pages

with multiple fields now works correctly when fetching additional pages Typo in time_ago_in_words

v1.4.0 — December 29th 2015

Additions

Relations provide preload functions for automatically calling include_in with the correct parrameters

with the correct parrameters Introduce preload_relations and preload_relation on models with relations

and on models with relations Introduce clear_loaded_relation method on models with relations

method on models with relations Rewrite super for lua classes to avoid issues with complicated hierarchies

for lua classes to avoid issues with complicated hierarchies Model.include_in can take a relation name with for_relation to mark it as loaded

can take a relation name with to mark it as loaded Model.include_in can take a group option to add a group by clause to query

can take a option to add a clause to query Model.include_in can take a value option to transform the fetched results before being placed on the model instances

can take a option to transform the fetched results before being placed on the model instances lapis new now generates a models.moon file, with code to autoload from models directory

Changes

Relations are now implemented as intermediate class (can override their helpers and call super)

Model.include_in will now set an empty array for any many preloads that return no results

will now set an empty array for any preloads that return no results Model.refresh will clear relation load status when refreshing all columns

Fixes

Fix bug where __inherited callback was called twice when using Lua classes

callback was called twice when using Lua classes MySQL connection initialized if necessary when trying to escape value (fixes migration issue)

v1.3.2 — December 10rd 2015

Additions

relation getters now keep track if they've fetched before with internal state to prevent fetching again on nil relations

relations add clear_loaded_relation method to clear a cached relation’s value to module lapis.models.relations

method to clear a cached relation’s value to module The class attribute for HTML builders can now take a table to generate class

Fixes

Ordered paginator prefixes column names with table names to allow for joins with shared columns

https URLs generated with port 443 will have the port stripped from the output

URLs generated with port 443 will have the port stripped from the output All json encoding now strips any keys that are not strings or numbers

The returning option for Model\create can take the value "*" to return all fields

Misc

Rebuilt with latest MoonScript

v1.3.1 — October 23rd 2015

Additions

Add Model\scoped_model for easily creating plugins/extensions that have their own models

for easily creating plugins/extensions that have their own models Add extension point to add custom lapis command line commands

command line commands build_url can take empty string scheme to build protocol relative URL

can take empty string scheme to build protocol relative URL Add util.date_diff function

Changes

Improve error messages for models with table name

ngx ’s query string escape function will be used if available

’s query string escape function will be used if available Invalid enum access throw better error messages

Error page will wrap exception error to avoid scrollbar

v1.3.0 — July 18th 2015

Additions

pgmoon updated to 1.2.0

Add support for Postgres array types

All schema builders have new array property

property Add db.postgres.array and db.postgres.is_array for constructing and testing arrays

and for constructing and testing arrays Array types automatically deserialized and serialized

update spec generator to support both model and server style specs

custom generators can be created by creating modules in generators.

create_table now fails if table already exists (Postgres, MySQL)

now fails if table already exists (Postgres, MySQL) create_index now fails by default if index exists (Postgres, MySQL)

now fails by default if index exists (Postgres, MySQL) create_index can take index_name option to set specific index name (Postgres, MySQL)

can take option to set specific index name (Postgres, MySQL) create_index can take if_not_exists option to skip if already exixists (Postgres)

can take option to skip if already exixists (Postgres) belongs_to relations now support a key option

relations now support a option Model\select now can take a load option to control what model the results are loaded with. Can take false to not load any model

now can take a option to control what model the results are loaded with. Can take false to not load any model Add has_items method to paginator

method to paginator Add enum schema type for alias to small int (Postgres)

schema type for alias to (Postgres) Polymorphic relation preload can take fields option

Changes

Any empty table passed to URL params in url_for no longer leaves a ? at the end of the URL

Bugs

Fix bug where before_filter would not work in Lua API

would not work in Lua API Fix bug where HTTP 1.0 requests without host header would fail

Fix bug where sending two content type headers would cause error

Fix a bug where Model table name caching could affect subclasses

v1.2.0 — May 14th 2015

Breaking changes

There are a few changes that affect backwards compatibility:

The default Postgres backend, which utilizes ngx_postgres , has been entirely removed. Early users of Lapis are recommended to upgrade to pgmoon

Postgres backend, which utilizes , has been entirely removed. Early users of Lapis are recommended to upgrade to The has_many relation now defines two methods: the get_relation method no longer returns a pager but all the associated rows. A new method, get_relation_paginated will return a pager

Database

Add support for MySQL (Thanks starius)

Add db.list for automatically building SQL list syntax for where x in () queries

Models

include_in can now preload many associated objects when many option is set to true

can now preload many associated objects when option is set to true A flipped include_in can now specify the local_key to use a different key than id

can now specify the to use a different key than Add polymorphic_belongs_to relation

relation has_many now defines two methods, one for pagination and one for fetching all the rows

now defines two methods, one for pagination and one for fetching all the rows has_many relation now supports the order option

relation now supports the option Fix all syntax errors in reference manual

Misc

Enhance singularize function, can singularize words like Categories to Category

function, can singularize words like Categories to Category Main Lapis server and spec server can now be launched in different directories from the current

Fixed a bug when setting config values that would cause function blocks to override previous function blocks instead of merging

v1.1.1 — April 25th 2015

Models

Add singular_name method to model classes, used when determining field name in relations and inclue_in

method to model classes, used when determining field name in relations and Add clause parameter to find_all

parameter to delete method returns true if a row is actually removed, false otherwise

method returns if a row is actually removed, otherwise Relation getters will no longer error if foreign key has nil value

value Fixed bug where ordered paginator with multiple keys could skip records if non-specific keys shared values

lapis.cache

cached will only cache GET requests

will only cache requests cached updated to not interfere with request method

Misc

url_for now takes a third argument, a table of query parameters

now takes a third argument, a table of query parameters A flow can be passed to a flow in place of the req object.

object. New config field, max_request_args , controls OpenResty’s maximum request argument truncation from get_post_args and get_uri_args .

, controls OpenResty’s maximum request argument truncation from and . Generated config includes pid directive to ensure compile time flags don’t interfere

New lapis.spec module with use_test_env and use_test_server for busted

module with and for busted Fixed a bug where respond_to was returning multiple arguments and interfering with Lua match API

v1.1.0 — February 3rd 2015

Models

Added support for relations to models

Added enum function for models

function for models Add returning option to Model.create to fetch initial values from database during create

option to to fetch initial values from database during create db.raw values passed to Model.create are loaded from database after create

values passed to are loaded from database after create db.raw values passed to Model.update are loaded from database after update

values passed to are loaded from database after update Fix bug where constraints were not working correctly for Model.update

Many minor fixes to ordered paginator

Migrations table automatically created on running migrations if it doesn’t exist

Migrations are now run outside of Nginx

Widgets

content_for data in widgets is prefixed to avoid conflict with user defined variables

data in widgets is prefixed to avoid conflict with user defined variables Boolean values for attributes in HTML builder will render value-less attribute

Multiple content_for of same name will now append instead of overwrite

Misc

Flow can now expose instance variable assignments to request with expose_assigns

can now expose instance variable assignments to request with Added new lapis generate command, add basic generators for model and spec

command, add basic generators for model and spec request method in lapis.spec.server will now send merged GET parameters passed with those in URL

v1.0.6 — October 27th 2014

Fix http.request when URL does not contain path

when URL does not contain path json_params will read body before trying to parse it

will read body before trying to parse it util.autoload can take multiple search prefixes

can take multiple search prefixes util.slugify improved to avoid generating multiple - , will also conver _ to - now

v1.0.5 — October 10th 2014

Add refresh method to model instance for reloading properties

updated_at update can be disabled for model update method now

update can be disabled for model method now total_items method of paginator aware of joins, bails out with group by

method of paginator aware of joins, bails out with SQL clause parser (for paginator) is aware of joins and sub queries now, along with other assorted fixes and performance improvements

Add ordered paginator, paginator can be instantiated without where clause

@POST is only parsed if content-type header is set to be a form

is only parsed if header is set to be a form truncate_tables is only allowed to run in test environment

is only allowed to run in test environment mock_request supports expect_json

supports mock_request correctly stubs ngx.now , ngx.update_time and remote_addr

v1.0.4 — August 19th 2014

Add performance metrics API with measure_performance config

config Add environment module for pushing and popping config environments

Experimental support for Leda as a server

pgmoon automatically connects when executing lapis.db queries from command line

queries from command line Errors in spec server as passed back and rethrown locally with backtrace

Nginx config files can be written in etlua when using .etlua extension

extension Add --etlua-config flag to lapis new to create blank project with etlua config

flag to to create blank project with etlua config The names of cookies are correctly unescaped

v1.0.3 — July 23 2014

Default application structure updated, lapis.serve is now executed from Nginx configuration. Default application code is now a regular Lua module that can be required with no side effects

is now executed from Nginx configuration. Default application code is now a regular Lua module that can be required with no side effects ngx_postgres is deprecated, docs removed. pgmoon documentation added. (ngx_postgres support will be removed in 1.1.0)

is deprecated, docs removed. pgmoon documentation added. (ngx_postgres support will be removed in 1.1.0) Spec server waits to shut down before starting new one when runnning non-attached (fixes timeout when executing many test files in a row)

Spec server can be run on fresh checkout without running lapis build first

first Added new documentation for request lifecycle

Added cookie_attributes extension function for configuring new cookies

extension function for configuring new cookies Fix leaking objects passed to lapis.serve (only applies when sending many different applications)

v1.0.2 — July 15 2014

Add new reference guide for etlua

Enforce routes to be searched in order they are defined for Lua style applications

Fix bug where render / widget functions in etlua template scope were shadowed

/ functions in etlua template scope were shadowed Add Model\columns method to get list of column names and types for a table

method to get list of column names and types for a table LAPIS_SHOW_QUERIES environment variable can be used to enable printing pgmoon queries during specs

environment variable can be used to enable printing queries during specs Misc documentation updates, more specs

v1.0.1 — Jun 30 2014

LAPIS_OPENRESTY environment variable can be used to set OpenResty binary location

environment variable can be used to set OpenResty binary location Fixed a bug with lapis.serve that prevented a string argument from loading correctly

that prevented a string argument from loading correctly Deprecate old PostgreSQL configuration syntax, document new table based syntax

v1.0.0 — Jun 16 2014

General

Add a new Lua friendly API, see Getting Started With Lua

Add support for etlua as a view language, see Lua guide

Overhaul to reference manual: better organization, Lua examples, and more guides

Database

Model\include_in can take a where option to filter results

can take a option to filter results A flipped Model\include_in no longer throws error when not using primary key

no longer throws error when not using primary key model\find_all can take a where option to filter results

can take a option to filter results model\find_all can take a db.raw value as search key

can take a value as search key updated_at and created_at aren’t overwritten when creating a model if manually set

and aren’t overwritten when creating a model if manually set db.escape_identifier is aware of db.raw values, won’t try to escape them

is aware of values, won’t try to escape them create_index can take a index method and a tablespace in options table (dant4z)

can take a index method and a tablespace in options table (dant4z) All constraints are checked on Model\create instead of just those for values provided

instead of just those for values provided Errors thrown from failed queries have query in them now

Fix bug where db.raw values would not work in create_index , prevening you from creating indexes on expressions

values would not work in , prevening you from creating indexes on expressions Postgres connection options can be set as table instead of connect string

Add support for pgmoon, documentation forthcoming

Util

util.time_ago_in_words can handle dates in the future

can handle dates in the future util.parse_query_string will correctly parse empty string values

will correctly parse empty string values assert_error passes through all arguments passed to it instead of just first argument

passes through all arguments passed to it instead of just first argument cached can have a dynamically set dictionary by setting dict to a function

Misc

A class passed to widget within MoonScript template will automatically be instantiated

within MoonScript template will automatically be instantiated Update OpenResty search path to find instalation from Brew on OSX (Stefan Natchev)

Add new logging config directive for fine grained control over individual logging

config directive for fine grained control over individual logging Updated homepage, http://leafo.net/lapis

v0.0.10 — Jan 18th, 2014

Correctly detect installation of OpenResty 1.5.x

Bug fix and documentation for @content_for

Add @has_content_for

v0.0.9 — Jan 9th, 2014

Backwards incompatible change to cached API

API Cached can take expiration time, override cache key, and a function to determine when to cache

Fixed bug where NULL check used = instead of is NULL in generated SQL

check used instead of in generated SQL include_in , take take fields to select as an option

, take take fields to select as an option Fixed bug where cache didn’t preserve status code

db.is_raw(val) for detecting if value is created from db.raw

for detecting if value is created from db.format_date(d) for formatting time to SQL syntax

for formatting time to SQL syntax More tests

v0.0.8 — December 7th, 2013

CRITICAL: Fixed an issue where a invalid multipart upload could cause worker to loop infinitely

Fixed an issue where a invalid multipart upload could cause worker to loop infinitely Added new json_params function to parse JSON from request body into @params

function to parse JSON from request body into @content_for can now be used to set content from view widgets to be seen by layout

can now be used to set content from view widgets to be seen by layout respond_to now provides a default HEAD action

now provides a default HEAD action Added lapis signal command line command to send arbitrary signal to Nginx process

command line command to send arbitrary signal to Nginx process Added find_action method to applications

method to applications Attributes now have spaces around them when using HTML builder

Test coverage improved

v0.0.7 — November 5th, 2013

Added prepare_results option to paginated

option to paginated Paginator options are passed to select, enabling you to set fields

Fixed an issue where doing an async operation (eg. querying) inside of a widget render would cause it to lose it’s environment and crash when handling concurrent requests

Optimized HTML renderer to avoid creating excess tables

Added application cache to lapis.server , will cache an instance of the class and reuse it

, will cache an instance of the class and reuse it @include class method on widgets and applications can take a string and will load it using require

class method on widgets and applications can take a string and will load it using Added @include class method on widgets for mixing in other classes

class method on widgets for mixing in other classes "lapis.spec.server" ’s request function can be passed headers, will extract host header if passed a full URL

’s function can be passed headers, will extract host header if passed a full URL Enhanced test coverage

v0.0.6 — October 17th, 2013

Added "lapis.spec.server" module for spawning a test server

module for spawning a test server env LAPIS_ENVIRONMENT=envname is now injected on top of config to ensure correct environment is passed down when changing environments of a running server. Default config has been updated to no longer have env LAPIS_ENVIRONMENT , it’s recommended but not required to remove that line from your config.

is now injected on top of config to ensure correct environment is passed down when changing environments of a running server. Default config has been updated to no longer have , it’s recommended but not required to remove that line from your config. When an application extends from another it will now search up the inheritance tree and take routes from parents

mock_request can take a previous requests headers, see mocking a request

can take a previous requests headers, see mocking a request You can now set nil to @session key to delete it

Rewrote how the command line tools provision a server to execute code one, can now run queries directly in the console.

Fix trying to save write session when it hasn’t been loaded

Fix issue where multiple cookies could not be set in a single request

Fix issue where adding a third value to a single header would not show up

v0.0.5 — September 1st, 2013

Added request mocking for writing tests

Added lapis.cache module

module Added autoload utility method

utility method Added documentation for file uploads

widget method inside of HTML renderer will inject current helpers and set @parent

method inside of HTML renderer will inject current helpers and set Default config has code_cache as a variable now

as a variable now Enhanced test coverage

v0.0.4 — August 13th, 2013

lapis migrate command will start a temporary server if it can’t find a running one

command will start a temporary server if it can’t find a running one Add lapis term command to stop a backgrounded server

command to stop a backgrounded server HTML void tags no longer render a closing tag

Add paginator for paging through queries with many results

Add Model\count for counting items in a query

for counting items in a query Model\update and Model\delete will convert primary key nil values to db.NULL

and will convert primary key values to Small enhancements to command line tool

v0.0.3 — July 22th, 2013

Added ability to execute Lua from command line on server

Documentation for command line interface

lapis build command for building config and sending HUP

command for building config and sending HUP lapis migrate command for running migrations on command line

command for running migrations on command line lapis new can take optional --git and --tup flags

can take optional and flags Commands use lapis_environment module to get default environment

v0.0.2 — June 17th, 2013

Session secret and name are now stored in the config

json and redirect_to can also set status

and can also set Fix issue with precedence of HTML builder helpers

Lua mode

updated trim_filter helper, reference

helper, reference Misc bug fixes

Add a lot more documentation, fix typos

Add test suite

v0.0.1 — April 24th, 2013