#include <sqlpp/bindings/lua/constraint.hpp>
#include <luabind/luabind.hpp>
#include <sqlpp/field.hpp>
#include <sqlpp/table.hpp>
#include <sqlpp/database.hpp>
#include <sqlpp/primary_key_constraint.hpp>
#include <sqlpp/unique_constraint.hpp>
#include <sqlpp/ref_constraint.hpp>
namespace sqlpp{
namespace bindings{
namespace lua{
lua_State* lua_sqlppopen_constraint(lua_State* L)
{
using namespace luabind;
module(L, SQLPP_MODULE_NAME)
[
class_< constraint, constraint_shared_ptr >("constraint")
];
module(L, SQLPP_MODULE_NAME)
[
class_< primary_key_constraint, constraint, primary_key_constraint_shared_ptr >("primary_key_constraint")
.def("is_single", &primary_key_constraint::is_single)
.def("is_compound", &primary_key_constraint::is_compound)
];
module(L, SQLPP_MODULE_NAME)
[
class_< unique_constraint, constraint, unique_constraint_shared_ptr >("unique_constraint")
];
module(L, SQLPP_MODULE_NAME)
[
class_< ref_constraint, constraint, ref_constraint_shared_ptr >("ref_constraint")
.enum_("EventAction")
[
value("EventActionUnknown", ref_constraint::EventActionUnknown),
value("EventActionNoAction", ref_constraint::EventActionNoAction),
value("EventActionCascade", ref_constraint::EventActionCascade),
value("EventActionSetNull", ref_constraint::EventActionSetNull),
value("EventActionSetDefault", ref_constraint::EventActionSetNull)
]
.enum_("Match")
[
value("MatchUnknown", ref_constraint::MatchUnknown),
value("MatchFull", ref_constraint::MatchFull),
value("MatchPartial", ref_constraint::MatchPartial)
]
];
return L;
};
}; // lua
}; // bindings
}; // sqlpp