#include <sqlpp/bindings/lua/database.hpp>
#include <luabind/luabind.hpp>
#include <sqlpp/field.hpp>
#include <sqlpp/table.hpp>
#include <sqlpp/database.hpp>
namespace sqlpp{
namespace bindings{
namespace lua{
lua_State* lua_sqlppopen_database(lua_State* L)
{
using namespace luabind;
bool (database::* contains_table_string)( string_const_reference ) const
= &database::contains_table;
bool (database::* contains_table_id)( properties::id_type ) const
= &database::contains_table;
table_shared_ptr (database::* get_table_string) ( string_const_reference ) const
= &database::get_table;
table_shared_ptr (database::* get_table_id) ( string_const_reference ) const
= &database::get_table;
table_shared_ptr (database::* add_table_ )(string_const_reference, string_const_reference )
= &database::add_table;
queries::select_query_shared_ptr (database:: *create_query_)()
= &database::create_query;
string_type (database::* get_create_statement_)(bool) const
= &database::get_create_statement;
size_t (database::* get_table_size_)() const
= &database::get_table_size;
module(L, SQLPP_MODULE_NAME)
[
class_<
database
,properties::id_property
,database_shared_ptr
>("database")
.def("add_table", add_table_)
.def("contains_table", contains_table_string)
.def("contains_table", contains_table_id)
.def("get_table", get_table_string)
.def("get_table", get_table_id)
.def("create_query", create_query_)
.def("get_create_statement", get_create_statement_)
.def("get_table_size", get_table_size_)
];
module(L, SQLPP_MODULE_NAME)
[
def("create_db", &database::create)
];
return L;
};
}; // lua
}; // bindings
}; // sqlpp