From fb33a851b418653872fa564fcd2c60682298e35b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 26 Jul 2010 15:44:33 +0200 Subject: Add stubs for the next chunk of functionality --- odb/mysql/header.cxx | 31 +++++++++++++++++++++++++++++++ odb/mysql/source.cxx | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/odb/mysql/header.cxx b/odb/mysql/header.cxx index ad329d8..0d34991 100644 --- a/odb/mysql/header.cxx +++ b/odb/mysql/header.cxx @@ -413,12 +413,40 @@ namespace mysql os << "static const odb::id_source id_source = odb::ids_assigned;" << endl; + // column_count @@ + // + os << "static const std::size_t column_count = 10;" + << endl; + + // insert_query + // + os << "static const char* const insert_query;" + << endl; + // id () // os << "static id_type" << endl << "id (const object_type&);" << endl; + // bind () + // + os << "static void" << endl + << "bind (MYSQL_BIND*, image_type&);" + << endl; + + // init (image, object) + // + os << "static void" << endl + << "init (image_type&, object_type&);" + << endl; + + // init (object, image) + // + os << "static void" << endl + << "init (object_type&, image_type&);" + << endl; + // persist () // os << "static void" << endl @@ -470,6 +498,9 @@ namespace mysql ns >> ns_defines >> ns; ns_defines >> c; + ctx.os << "#include " << endl // std::size_t + << endl; + ctx.os << "#include " << endl << endl; diff --git a/odb/mysql/source.cxx b/odb/mysql/source.cxx index 5dfcf2e..3959894 100644 --- a/odb/mysql/source.cxx +++ b/odb/mysql/source.cxx @@ -37,11 +37,45 @@ namespace mysql << "//" << endl << endl; + // insert_query + // + os << "const char* const " << traits << "::insert_query = " << endl + << "\"INSERT INTO\";" + << endl; + + // bind () + // + os << "void " << traits << "::" << endl + << "bind (MYSQL_BIND*, image_type&)" + << "{" + << "}"; + + // init (image, object) + // + os << "void " << traits << "::" << endl + << "init (image_type&, object_type&)" + << "{" + << "}"; + + // init (object, image) + // + os << "void " << traits << "::" << endl + << "init (object_type&, image_type&)" + << "{" + << "}"; + // persist () // os << "void " << traits << "::" << endl << "persist (database&, object_type& obj)" << "{" + << "using namespace mysql;" + << endl + << "connection& conn (mysql::transaction::current ().connection ());" + << "insert_statement& st (" << endl + << "conn.statement_cache ().find ().insert ());" + << "init (st.image (), obj);" + << "st.execute ();" << "}"; // store () @@ -93,6 +127,9 @@ namespace mysql ns_defines >> c; ctx.os << "#include " << endl + << "#include " << endl + << "#include " << endl + << "#include " << endl << "#include " << endl << endl; -- cgit v1.1