Sailor v0.1 - Venus
Pre-releaseSailor MVC Lua Framework v0.1 - Venus
Sailor currently supports parsing of Lua Pages, routing, email sending and ORMs. Our models currently have the following pre-made methods:
- :new() - instantiates an object
- :save() - saves it to the database. If it is a new object it will insert, if not, it will update. (currently tested on MySQL, but should work on PostgreSQL too)
- :find(where_string) - finds one object based on a where clause
- :find_by_id(id) - finds one object using primary key
- :delete() - deletes an object from db
- :find_all() or :find_all(where_string) - finds all objects of that model and returns a table of objects, can restrict them based on where_string clause.
Warning: this is a tech preview and the model class does not avoid SQL injections yet.
Sailor currently requires the following dependencies:
- LuaSocket - get it with luarocks (If you want to send emails)
- LuaSec - get it with luarocks (If you want to send emails)
- LuaSQL - get it with luarocks (If you want to persist your models. You should also install a db server supportted by LuaSQL.)
- Apache2 - (mandatory)
- mod_lua - get it with a2enmod (mandatory)
More information about stuff we use:
http://keplerproject.github.io/cgilua/manual.html#templates
https://httpd.apache.org/docs/trunk/pt-br/mod/mod_lua.html
http://w3.impa.br/~diego/software/luasocket/smtp.html
http://keplerproject.org/luasql/
What's coming on next?
- Safety Measures
- Form - Model Validation
- Basic layout
- Redirects
- General Improvements and other new stuff! :D
How do I use this thing?
Install the dependencies and copy these contents to the directory that your apache is reading from! :) If you have any trouble doing that, tell me so I can improve the manual.
Do I have to pay for this?
No. Sailor is free to use and open source, we follow MIT License. Your help is appreciated though on testing the software and providing comments and feedback.