From 16b1b724695116c878127c9e987a2e9733d56cec Mon Sep 17 00:00:00 2001 From: myun2 Date: Sat, 7 Apr 2012 03:36:03 +0900 Subject: [PATCH] =?utf8?q?table.hpp:=20=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/db/sql/table.hpp | 46 +++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/roast/include/roast/db/sql/table.hpp b/roast/include/roast/db/sql/table.hpp index 4c2f8ff8..e3bee7a4 100644 --- a/roast/include/roast/db/sql/table.hpp +++ b/roast/include/roast/db/sql/table.hpp @@ -12,19 +12,59 @@ namespace roast { /////////////////////////////////////////////////////////////////////////////////// - class create_table + namespace _char + { + typedef chars::space space; + } + + namespace _op_names + { + ROAST_LEXICAL_FIXSTR(create,"CREATE"); + ROAST_LEXICAL_FIXSTR(drop,"DROP"); + ROAST_LEXICAL_FIXSTR(alter,"ALTER"); + ROAST_LEXICAL_FIXSTR(rename,"RENAME"); + + ROAST_LEXICAL_FIXSTR(table,"TABLE"); + ROAST_LEXICAL_FIXSTR(to,"TO"); + } + + /////////////////////////////////////////////////////////////////////////////////// + + // CREATE TABLE + template + class create_table : public seq< + _op_names::create, _char::space, _op_names::table, _char::space, // CREATE TABLE + TABLE_NAME, _char::space, _char::lpare, COLUMNS, _char::rpare> // () + { + }; + + /////////////////////////////////////////////////////////////////////////////////// + + // DROP TABLE + template + class drop_table : public seq< + _op_names::drop, _char::space, _op_names::table, _char::space, // DROP TABLE + TABLE_NAME> //
{ }; /////////////////////////////////////////////////////////////////////////////////// - class drop_table + // ALTER TABLE + template + class alter_table : public seq< + _op_names::alter, _char::space, _op_names::table, _char::space, // ALTER TABLE + TABLE_NAME> //
{ }; /////////////////////////////////////////////////////////////////////////////////// - class alter_table + // RENAME TABLE + template + class rename_table : public seq< + _op_names::rename, _char::space, _op_names::table, _char::space, // RENAME TABLE + TABLE_NAME, _char::space, _op_names::to, _char::space, TO_TABLE_NAME> // TO { }; -- 2.11.0