#include <sqlpp/bindings/lua/properties.hpp>
#include <luabind/luabind.hpp>
#include <luabind/dependency_policy.hpp>
#include <sqlpp/properties/alias_property.hpp>
#include <sqlpp/properties/name_property.hpp>
#include <sqlpp/properties/id_property.hpp>
#include <sqlpp/properties/table_property.hpp>
#include <sqlpp/properties/database_property.hpp>
namespace sqlpp{
namespace bindings{
namespace lua{
lua_State* lua_sqlppopen_properties(lua_State* L)
{
using namespace luabind;
using namespace ::sqlpp::properties;
bool (id_property:: * check_id_ref )( id_property const& ) const
= &id_property::check_id;
bool (id_property:: * check_id_ptr )( boost::shared_ptr< id_property > const ) const
= &id_property::check_id;
module(L, SQLPP_MODULE_NAME)
[
class_< alias_property, boost::shared_ptr<alias_property> >("alias_property")
.def("has_alias", &alias_property::has_alias)
.property("alias",&alias_property::get_alias, &alias_property::set_alias)
];
module(L, SQLPP_MODULE_NAME)
[
class_< name_property, boost::shared_ptr<name_property> >("name_property")
.property("name", &name_property::get_name, &name_property::set_name)
];
module(L, SQLPP_MODULE_NAME)
[
class_< table_property, boost::shared_ptr<table_property> >("table_property")
.property("table",&table_property::get_checked_table, &table_property::set_table)
.def("is_from_table", &table_property::is_from_table )
];
module(L, SQLPP_MODULE_NAME)
[
class_< id_property, boost::shared_ptr<id_property> >("id_property")
.def("check_id", check_id_ref )
.def("check_id", check_id_ptr )
.property("id", &id_property::get_id )
];
module(L, SQLPP_MODULE_NAME)
[
class_< database_property, boost::shared_ptr<database_property> >("database_property")
.property("database",&database_property::get_checked_database )
];
return L;
};
}; // lua
}; // bindings
}; // sqlpp