From 32c33b95b98e5a6c259505be840cd17c16334c2a Mon Sep 17 00:00:00 2001 From: Myun2 Date: Sun, 6 May 2012 03:06:14 +0900 Subject: [PATCH] =?utf8?q?=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88=E3=81=9A?= =?utf8?q?=E7=B6=99=E6=89=BF=E3=81=AB=E3=81=A4=E3=81=A3=E3=81=93=E3=82=80?= =?utf8?q?=E3=82=8F=E3=83=BB=E3=83=BB=E3=83=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/db/sql/table.hpp | 10 +++++++++- roast/test/roast_test_DB_sqlite/sqlite_test2.cpp | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/roast/include/roast/db/sql/table.hpp b/roast/include/roast/db/sql/table.hpp index c3010b03..46861aa8 100644 --- a/roast/include/roast/db/sql/table.hpp +++ b/roast/include/roast/db/sql/table.hpp @@ -27,8 +27,16 @@ namespace roast create_table_(){}; //create_table_(const TABLE_NAME &tblname, const COLUMNS& columns): // m_tblname(tblname), m_columns(columns){}; + create_table_(const TABLE_NAME &tblname, const COLUMNS& columns): - m_tblname(tblname), m_columns(columns){}; + seq< + _op_names::create, _char::space, _temporary<_IsTemporary>, // CREATE [TEMPORARY] + _op_names::table, _char::space, _if_not_exists<_IsExistNoError>, // TABLE [IF NOT EXISTS] + TABLE_NAME, _char::space, _char::lpare, COLUMNS, _char::rpare> + ( + _op_names::create(), _char::space(), _temporary<_IsTemporary>(), // CREATE [TEMPORARY] + _op_names::table(), _char::space(), _if_not_exists<_IsExistNoError>(), // TABLE [IF NOT EXISTS] + tblname, _char::space(), _char::lpare(), columns, _char::rpare() ){} }; /* diff --git a/roast/test/roast_test_DB_sqlite/sqlite_test2.cpp b/roast/test/roast_test_DB_sqlite/sqlite_test2.cpp index f11eb3fc..b3dcce99 100644 --- a/roast/test/roast_test_DB_sqlite/sqlite_test2.cpp +++ b/roast/test/roast_test_DB_sqlite/sqlite_test2.cpp @@ -37,9 +37,9 @@ int main() sql::type::smallint si; - printf("%s\n", lexical::to_string(sql::create_table("test2", sql::create_table_columns()) ).c_str() ); + //printf("%s\n", lexical::to_string(sql::create_table("test2", sql::create_table_columns()) ).c_str() ); - printf("%s\n", lexical::str_generate >().c_str() ); + //printf("%s\n", lexical::str_generate >().c_str() ); //sql::create_table("hoge"); -- 2.11.0